Takes 2 operands from the stack of the same numeric type and compares them.
Places an i32
on the stack representing the result of the comparison: either 1 if the first operand is greater than the second, or 0 otherwise 1 2 3.
For integer types, there are two opcodes per type, to indicate whether to treat the operands as signed or unsigned for the comparison 4.
Opcode | Instruction | Stack Arity |
---|---|---|
0x4A |
i32.gt_s |
|
0x4B |
i32.gt_u |
|
0x58 |
i64.gt_s |
|
0x59 |
i64.gt_u |
|
0x5E |
f32.gt |
|
0x64 |
f64.gt |
todo
Footnotes
-
Execution, Numerics, Integer Operations, igt_u - https://www.w3.org/TR/wasm-core-2/exec/numerics.html#op-igt-u ↩
-
Execution, Numerics, Integer Operations, igt_s - https://www.w3.org/TR/wasm-core-2/exec/numerics.html#op-igt-s ↩
-
Execution, Numerics, Floating-Point Operations, fgt - https://www.w3.org/TR/wasm-core-2/exec/numerics.html#op-fgt ↩
-
Structure, Numeric Instructions - https://www.w3.org/TR/wasm-core-2/syntax/instructions.html#numeric-instructions ↩