Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong documentation of some wq/wdxx instructions #604

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/fuel-vm/instruction-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ Panic if:
|-------------|----------------------------------------------------------------------------------------|
| Description | Combined multiply-divide of 128-bit integers with arbitrary precision. |
| Operation | `b=mem[$rB,16];`<br>`c=mem[$rC,16];`<br>`d=mem[$rD,16];`<br>`mem[$rA,16]=(b * c) / d;` |
| Syntax | `wddv $rA, $rB, $rC, $rD` |
| Syntax | `wdmd $rA, $rB, $rC, $rD` |
| Encoding | `0x00 rA rB rC rD` |
| Notes | Division by zero is treated as division by `1 << 128` instead. |

Expand All @@ -953,7 +953,7 @@ Panic if:
|-------------|----------------------------------------------------------------------------------------|
| Description | Combined multiply-divide of 256-bit integers with arbitrary precision. |
| Operation | `b=mem[$rB,32];`<br>`c=mem[$rC,32];`<br>`d=mem[$rD,32];`<br>`mem[$rA,32]=(b * c) / d;` |
| Syntax | `wqdv $rA, $rB, $rC, $rD` |
| Syntax | `wqmd $rA, $rB, $rC, $rD` |
| Encoding | `0x00 rA rB rC rD` |
| Notes | Division by zero is treated as division by `1 << 256` instead. |

Expand Down Expand Up @@ -997,13 +997,13 @@ Panic if:
|-------------|--------------------------------------------------------------------------------------|
| Description | Add two 256-bit integers and compute modulo remainder with arbitrary precision. |
| Operation | `b=mem[$rB,32];`<br>`c=mem[$rC,32];`<br>`d=mem[$rD,32];`<br>`mem[$rA,32] = (b+c)%d;` |
| Syntax | `wdam $rA, $rB, $rC, $rD` |
| Syntax | `wqam $rA, $rB, $rC, $rD` |
| Encoding | `0x00 rA rB rC rD` |
| Notes | |

`$of` is cleared.

If the rhs operand is zero, `MEM[$rA, 16]` is cleared and `$err` is set to `true`. Otherwise, `$err` is cleared.
If the rhs operand is zero, `MEM[$rA, 32]` is cleared and `$err` is set to `true`. Otherwise, `$err` is cleared.

Panic if:

Expand Down Expand Up @@ -1045,7 +1045,7 @@ Panic if:

`$of` is cleared.

If the rhs operand is zero, `MEM[$rA, 16]` is cleared and `$err` is set to `true`. Otherwise, `$err` is cleared.
If the rhs operand is zero, `MEM[$rA, 32]` is cleared and `$err` is set to `true`. Otherwise, `$err` is cleared.

Panic if:

Expand Down
Loading