WebAssembly numeric instructions
WebAssembly numeric instructions.
Constants
const-
Declare a constant numbers.
Comparison
eq-
Check if two numbers are equal.
ne-
Check if two numbers are not equal.
gt-
Check if a number is greater than another number.
lt-
Check if a number is less than another number.
ge-
Check if a number is greater than or equal to another number.
le-
Check if a number is less than or equal to another number.
Arithmetic
Conversion
extend-
Convert (extend)
i32toi64. wrap-
Convert (wrap)
i64toi32. promote-
Convert (promote)
f32tof64. demote-
Convert (demote)
f64tof32. convert-
Convert integers to floating points.
trunc(to int)-
Convert (truncate fractional part) floating points to integers.
reinterpret-
Reinterpret the bytes of integers as floating points and vice versa.
Floating point specific instructions
min-
Get the lower of two numbers.
max-
Get the higher of two numbers.
nearest-
Round a number to the nearest integer.
ceil-
Round up a number.
floor-
Round down a number.
trunc(to float)-
Discard the fractional part of a number.
abs-
Get the absolute value of a number.
neg-
Negate a number.
sqrt-
Get the square root of a number.
copysign-
Copy just the sign bit from one number to another.
Bitwise
and-
Used for performing a bitwise AND.
or-
Used for performing a bitwise OR.
xor-
Used for performing a bitwise XOR.
shl-
Used for performing a bitwise left-shift.
shr-
Used for performing a bitwise right-shift.
rotl-
Used for performing a bitwise left-rotate.
rotr-
Used for performing a bitwise right-rotate.
clz-
Count the amount of leading zeros in a numbers binary representation.
ctz-
Count the amount of trailing zeros in a numbers binary representation.
popcnt-
Count the total amount of 1s in a numbers binary representation.