WebAssembly numeric instructions
WebAssembly numeric instructions.
Constants
const-
Declare a constant numbers.
Comparison
eq-
Check if two numbers are equal.
eqz-
Check if a number is equal to
0. ne-
Check if two numbers are not equal.
gt-
Check if a floating point number is greater than another floating point number.
gt_s-
Check if a signed integer is greater than another signed integer.
gt_u-
Check if an unsigned integer is greater than another unsigned integer.
lt-
Check if a floating point number is less than another floating point number.
lt_s-
Check if a signed integer is less than another signed integer.
lt_u-
Check if an unsigned integer is less than another unsigned integer.
ge-
Check if a floating point number is greater than or equal to another floating point number.
ge_s-
Check if a signed integer is greater than or equal to another signed integer.
ge_u-
Check if an unsigned integer is greater than or equal to another unsigned integer.
le-
Check if a floating point number is less than or equal to another floating point number.
le_s-
Check if a signed integer is less than or equal to another signed integer.
le_u-
Check if an unsigned integer is less than or equal to another unsigned integer.
Arithmetic
Conversion
extend-
Convert (extend)
i32toi64. wrap_i64-
Convert (wrap)
i64toi32. promote_32-
Convert (promote)
f32tof64. demote-
Convert (demote)
f64tof32. convert-
Convert integers to floating points.
trunc-
Gets the value of a floating point number without its fractional part.
trunc_f32_s-
Removes the fractional part of an
f32value and outputs it as a signed integer. trunc_f32_u-
Removes the fractional part of an
f32value and outputs it as an unsigned integer. trunc_f64_s-
Removes the fractional part of an
f64value and outputs it as a signed integer. trunc_f64_u-
Removes the fractional part of an
f64value and outputs it as an unsigned integer. 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 floating point numbers.
nearest-
Round a number to the nearest integer.
ceil-
Round up a number.
floor-
Round down a number.
trunc-
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_s-
Used for performing a bitwise right-shift on signed integers.
shr_u-
Used for performing a bitwise right-shift on unsigned integers.
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.