On this page

i64 Instructions

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

i64 Math

Instruction Description
i64.const Push an i64 value onto the stack.
i64.add Adds two numbers together.
i64.sub Subtracts one number from another.
i64.mul Multiples two numbers together.
i64.div_s Divide a number by another (signed).
i64.div_u Divide a number by another (unsigned).
i64.rem_s Get the remainder after dividing a number by another (signed).
i64.rem_u Get the remainder after dividing a number by another (unsigned).

i64 Bitwise

Instruction Description
i64.and Perform bitwise AND operation between two values.
i64.or Perform bitwise OR operation between two values.
i64.xor Perform bitwise XOR operation between two values.
i64.shl Shift a value to the left by a number of bits.
i64.shr_s Shift a value to the right by a number of bits (signed).
i64.shr_u Shift a value to the right by a number of bits (signed).
i64.rotl Rotate a value to the left by a number of bits.
i64.rotr Rotate a value to the right by a number of bits.
i64.clz Count the number of leading 0 bits of a value.
i64.ctz Count the number of trailing 0 bits of a value.
i64.popcnt Count the number of bits that are set to 1 in a value.

i64 Condition

Instruction Description
i64.eqz Checks if a value is zero.
i64.eq Compares two values to see if they are equal.
i64.ne Compares two values to see if they are not equal.
i64.gt_s Compares two values and see if the first is greater than the second (signed).
i64.gt_u Compares two values and see if the first is greater than the second (unsigned).
i64.ge_s Compares two values and see if the first is greater than or equal to the second (signed).
i64.ge_u Compares two values and see if the first is greater than or equal to the second (unsigned).
i64.lt_s Compares two values and see if the first is less than the second (signed).
i64.lt_u Compares two values and see if the first is less than the second (unsigned).
i64.le_s Compares two values and see if the first is less than or equal to the second (signed).
i64.le_u Compares two values and see if the first is less than or equal to the second (unsigned).

i64 Conversion

Instruction Description
i64.extend_i32_s Convert a i32 value into an i64 value (signed).
i64.extend_i32_u Convert a i32 value into an i64 value (unsigned).
i64.trunc_f64_s Convert a f64 value into an i64 value (signed). Throws an error if out of range.
i64.trunc_f64_u Convert a f64 value into an i64 value (unsigned). Throws an error if out of range.
i64.trunc_sat_f64_s Convert a f64 value into an i64 value (signed).
i64.trunc_sat_f64_u Convert a f64 value into an i64 value (unsigned).
i64.trunc_f32_s Convert a f32 value into an i64 value (signed). Throws an error if out of range.
i64.trunc_f32_u Convert a f32 value into an i64 value (unsigned). Throws an error if out of range.
i64.trunc_sat_f32_s Convert a f32 value into an i64 value (signed).
i64.trunc_sat_f32_u Convert a f32 value into an i64 value (unsigned).
i64.extend8_s Convert the first 8 bits of an i64 value into an i64 value.
i64.extend16_s Convert the first 16 bits of an i64 value into an i64 value.
i64.extend32_s Convert the first 32 bits of an i64 value into an i64 value.
i64.reinterpret_f64 Translate the binary structure of a f64 into an i64 value.

i64 Memory

Instruction Description
i64.store Copy an i64 value into memory.
i64.store32 Copy the first 32 bits of an i64 value into memory.
i64.store16 Copy the first 16 bits of an i64 value into memory.
i64.store8 Copy the first 8 bits of an i64 value into memory.
i64.load Copy a 32 bit (4 byte) value from memory.
i64.load32_s Copy a 32 bit (4 byte) value from memory (signed).
i64.load32_u Copy a 32 bit (4 byte) value from memory (unsigned).
i64.load16_s Copy a 16 bit (2 byte) value from memory (signed).
i64.load16_u Copy a 16 bit (2 byte) value from memory (unsigned).
i64.load8_s Copy a 8 bit (1 byte) value from memory (signed).
i64.load8_u Copy a 8 bit (1 byte) value from memory (unsigned).