On this page

f32 Instructions

A collection of the different f32 instructions you can use. Select the instruction to see more information.

f32 Math

Instruction Description
f32.const Push a f32 value onto the stack.
f32.add Adds two numbers together.
f32.sub Subtracts one number from another.
f32.mul Multiples two numbers together.
f32.div Divide a number by another.
f32.abs Get the absolute version of a value.
f32.neg Negates a value.
f32.ceil Get the ceiling amount of a value.
f32.floor Get the floor amount of a value.
f32.nearest Round a value to the nearest whole number.
f32.trunc Truncates a value by removing any decimanl points.
f32.sqrt Get the square root of a value.
f32.min Get the smallest of two values.
f32.max Get the largest of two values.
f32.copysign Copy the sign part of a value (plus or minus) onto another value.

f32 Condition

Instruction Description
f32.eq Compares two values to see if they are equal.
f32.ne Compares two values to see if they are not equal.
f32.gt Compares two values and see if the first is greater than the second.
f32.ge Compares two values and see if the first is greater than or equal to the second.
f32.lt Compares two values and see if the first is less than the second.
f32.le Compares two values and see if the first is less than or equal to the second.

f32 Conversion

Instruction Description
f32.convert_i32_s Convert an i32 value into a f32 value (signed).
f32.convert_i32_u Convert an i32 value into a f32 value (unsigned).
f32.convert_i64_s Convert an i64 value into a f32 value (signed).
f32.convert_i64_u Convert an i64 value into a f32 value (unsigned).
f32.demote_f64 Convert a f64 value into a f32 value.
f32.reinterpret_i32 Translate the binary structure of a f32, stored in an i32 value, back into a f32 value.

f32 Memory

Instruction Description
f32.store Copy an f32 value into memory.
f32.load Copy a 32 bit (4 byte) floating point data value from memory.