These instructions pertain to the 4 "main" numeric data types: i32
, i64
, f32
, and f64
const
(declare constant)
-
eqz
(equals zero)
eq
(equals)
ne
(not equals)
lt
(less than)
gt
(greater than)
le
(less than or equals)
ge
(greater than or equals)
-
add
(addition)
sub
(subtraction)
mul
(multiplication)
div
(division)
rem
(remainder)
-
clz
(count leading zeros)
ctz
(count trailing zeros)
popcnt
(population count)
and
(bitwise and)
or
(bitwise or)
xor
(bitwise xor)
shl
(shift left)
shr
(shift right)
rotl
(rotate left)
rotr
(rotate right)
-
Floating Point Operations
-
These instructions pertain to v128
values, and their various formats.
const
(declare constant vector)
splat
(create vector with identical lanes)
-
-
-
eq
(equals)
ne
(not equals)
lt
(less than)
gt
(greater than)
le
(less than or equals)
ge
(greater than or equals)
-
add
(lane-wise addition)
sub
(lane-wise subtraction)
mul
(lane-wise multiplication)
dot
(lane-wise dot product)
neg
(lane-wise negation)
-
Extended Integer Arithmetic
extmul
(extended multiplication)
extadd
(extended pairwise addition)
-
Saturating Integer Arithmetic
add_sat
(saturating addition)
sub_sat
(saturating subtraction)
q15mulr_sat
(saturating Q-format rounding multiplication)
min
(select lane-wise minimum)
max
(select lane-wise maximum)
avgr
(lane-wise rounding average)
abs
(lane-wise absolute value)
-
not
(bitwise not)
and
(bitwise and)
andnot
(bitwise and-not)
or
(bitwise or)
xor
(bitwise xor)
shl
(lane-wise shift left)
shr
(lane-wise shift right)
bitselect
(bitwise select)
bitmask
(bitmask extraction)
popcnt
(lane-wise population count)
-
Boolean Horizontal Reductions
-
Floating-point Operations
neg
(lane-wise negation)
abs
(lane-wise absolute value)
min
(NaN-propagating lane-wise select minimum)
max
(NaN-propagating lane-wise select maximum)
pmin
(lane-wise select psuedo-minimum)
pmax
(lane-wise select psuedo-maximum)
-
Floating-point Arithmetic
add
(addition)
sub
(subtraction)
div
(division)
mul
(multiplication)
sqrt
(square root)
ceil
(ceiling / round up)
floor
(floor / round down)
trunc
(truncate / round toward zero)
nearest
(round to nearest)
-
convert
(convert i32
to floating-point)
trunc_sat
(convert floating-point to i32
with saturation)
demote
(convert f64
to f32
)
promote
(convert f32
to f64
)
narrow
(integer narrowing)
extend
(integer extension)
drop
(drop the top value from the stack)
select
(conditionally select an operand)
local.get
(push local variable to stack)
local.set
(pop stack value and write to local variable)
local.tee
(write top of stack to local variable without pop)
global.get
(push global variable to stack)
global.set
(pop stack value and write to global variable)