Ribbon Bytecode Instruction Set Architecture
This is the canonical instruction set architecture (ISA) definition for the Ribbon virtual machine bytecode.
Overview
Basic layout
The ISA is divided into Categories;
Categories are further divided into Mnemonic bases;
Mnemonics then contain tables describing each concrete instruction variation.
Example
callc
and call_v
are both under the call
mnemonic, within the Control Flow
category.
JIT-only Instructions
Instructions with a jit tag above their name are
only available when Rvm
is compiled with the jit
option.
Encoding
We display the encoding of each instruction as segmented bytes. The Ribbon bytecode is always in little endian order, and we display these bytes as they are ordered in memory.
The opcode is shown first, as a two byte hexadecimal number.
Padding bytes are shown as __
.
In addition to standard hex characters and underscores, we utilize operand
encoding symbology, such as Rx
, indicating the first register operand to use.
Symbolic operand character sequences will begin with a capital letter, and will
be the appropriate width for the operand’s bytes if they were shown in hex form.
Nybbles displayed with .
continue the value to the left of them.
Some instructions take up multiple words. We display word boundaries as line
breaks within the tables’ Encoding columns, with subsequent instruction
address representations arranged lower within these lines. Where the number of
words used is dynamic, a trailing line containing ...
will be shown.
Example
An instruction with a u16
immediate operand will use the notation
I.
..
, because it is 2 bytes.
Similarly, Register
operands are simply R.
or Rx
, Ry
, etc because they
are 1-byte identifiers.
As a concrete example, store64c
, an instruction which stores a 64-bit
immediate value (encoded as Iy
) to memory at the address in a designated
register (encoded as R
), offset by another 32-bit immediate value (encoded as
Ix
), has an encoding column entry like this:
Encoding |
---|
2d 00 R. Ix .. .. .. __ Iy .. .. .. .. .. .. .. |
Immediate Operands
Immediate operands are formatted with I
; immediate in this context means that
the value is literally encoded into the byte stream, rather than encoding a
reference to the value. We allow up to 64-bit immediates for all operations that
are binary or greater in arity; in all cases the bit size of the immediate
operand and the bit size of the operation must match. (I.e. there is no ‘add 8
bit imm to 32 bit reg’ instruction.)
Where instructions utilizing immediate operands are commutative, the version of
the instruction taking a constant will be suffixed with c
.
For instructions that do not commute, the two constant versions will be suffixed
with a
and b
respectively, indicating whether the constant is used on the
left or right side.
Example
Name | Description Excerpt |
---|---|
mem_set | … up to an offset of Rz , is set to … Ry |
mem_set_a | … up to an offset of I , is set to Ry |
mem_set_b | … up to an offset of Ry , is set to I |
… | |
mem_swap | … up to an offset of Rz … |
mem_swap_c | … up to an offset of I … |
Operand Types
Type | Shortcode | Size |
---|---|---|
Register | R | 8 bits |
Id.of(Upvalue) | U | 8 bits |
Id.of(Global) | G | 16 bits |
Id.of(Function) | F | 16 bits |
Abi | A | 8 bits |
Id.of(BuiltinAddress) | B | 16 bits |
Id.of(ForeignAddress) | X | 16 bits |
Id.of(Effect) | E | 16 bits |
Id.of(HandlerSet) | H | 16 bits |
Id.of(Constant) | C | 16 bits |
u8 | I | 8 bits |
u16 | I | 16 bits |
u32 | I | 32 bits |
u64 | I | 64 bits |
Instructions
There are 8
categories.
Separated into those categories, there are a total of 57
mnemonics.
With an average of 7.842105263157895
instructions per mnemonic,
we have a grand total of 447
unique instructions.
- Miscellaneous
- Control flow
- Memory
- Bitwise
- Comparison
- Integer arithmetic
- Floating point arithmetic
- Value conversion
Miscellaneous
Items that do not fit into another category
nop
Name | Encoding | Description |
---|---|---|
nop | 00 00 __ __ __ __ __ __ | No operation |
breakpoint
Name | Encoding | Description |
---|---|---|
breakpoint | 01 00 __ __ __ __ __ __ | Triggers a breakpoint in debuggers; does nothing otherwise |
Control flow
Instructions that control the flow of execution
halt
Name | Encoding | Description |
---|---|---|
halt | 02 00 __ __ __ __ __ __ | Halts execution at this instruction offset |
trap
Marks a point in the code as not normally reachable, in two ways
Name | Encoding | Description |
---|---|---|
trap | 03 00 __ __ __ __ __ __ | Traps execution of the Rvm.Fiber at this instruction offsetUnlike unreachable , this indicates expected behavior; optimizing compilers should not assume it is never reached |
unreachable | 04 00 __ __ __ __ __ __ | Marks a point in the code as unreachable; if executed in Rvm, it is the same as trap Unlike trap , however, this indicates undefined behavior; optimizing compilers should assume it is never reached |
set
Effect handler set stack manipulation
Name | Encoding | Description |
---|---|---|
push_set | 05 00 H. .. __ __ __ __ | Pushes H onto the stack.The handlers in this set will be first in line for their effects’ prompts until a corresponding pop operation. |
pop_set | 06 00 __ __ __ __ __ __ | Pops the top most Id.of(HandlerSet) from the stack, restoring the previous if present |
br
Instruction pointer manipulation
Name | Encoding | Description |
---|---|---|
br | 07 00 I. .. .. .. __ __ | Applies a signed integer offset I to the instruction pointer |
br_if | 08 00 R. I. .. .. .. __ | Applies a signed integer offset I to the instruction pointer, if the value stored in R is non-zero |
call
Various ways of calling functions, in all cases taking up to max(u8
) number of arguments.
Arguments are expected to be Register
values, encoded in the instruction stream after the call instruction.
Register
is not instruction-aligned; padding bytes may need to be added and accounted for following the arguments, to ensure the next instruction is aligned
Name | Encoding | Description |
---|---|---|
call | 09 00 Rx Ry A. I. __ __ ... | Calls the function in Ry using A , placing the result in Rx |
call_c | 0a 00 R. F. .. A. I. __ ... | Calls the function at F using A , placing the result in R |
prompt | 0b 00 R. E. .. A. I. __ ... | Calls the effect handler designated by E using A , placing the result in R . |
return
End the current function, in one of two ways
Name | Encoding | Description |
---|---|---|
return | 0c 00 R. __ __ __ __ __ | Returns flow control to the caller of current function, yielding R to the caller |
cancel | 0d 00 R. __ __ __ __ __ | Returns flow control to the offset associated with the current effect handler’s Id.of(HandlerSet) , yielding R as the cancellation value |
Memory
Instructions that provide memory access
mem_set
Set bytes in memory
Name | Encoding | Description |
---|---|---|
mem_set | 0e 00 Rx Ry Rz __ __ __ | Each byte, starting from the address in Rx , up to an offset of Rz , is set to the least significant byte of Ry |
mem_set_a | 0f 00 Rx Ry I. .. .. .. | Each byte, starting from the address in Rx , up to an offset of I , is set to Ry |
mem_set_b | 10 00 Rx Ry I. __ __ __ | Each byte, starting from the address in Rx , up to an offset of Ry , is set to I |
mem_copy
Copy bytes in memory
Name | Encoding | Description |
---|---|---|
mem_copy | 11 00 Rx Ry Rz __ __ __ | Each byte, starting from the address in Ry , up to an offset of Rz , is copied to the same offset of the address in Rx |
mem_copy_a | 12 00 Rx Ry I. .. .. .. | Each byte, starting from the address in Ry , up to an offset of I , is copied to the same offset from the address in Rx |
mem_copy_b | 13 00 Rx Ry C. .. __ __ | Each byte, starting from the address of C , up to an offset of Ry , is copied to the same offset from the address in Rx |
mem_swap
Swap bytes in memory.
Name | Encoding | Description |
---|---|---|
mem_swap | 14 00 Rx Ry Rz __ __ __ | Each byte, starting from the addresses in Rx and Ry , up to an offset of Rz , are swapped with each-other |
mem_swap_c | 15 00 Rx Ry I. .. .. .. | Each byte, starting from the addresses in Rx and Ry , up to an offset of I , are swapped with each-other |
addr
Get addresses from special values.
Name | Encoding | Description |
---|---|---|
addr_l | 16 00 R. I. .. .. .. __ | Get the address of a signed integer frame-relative operand stack offset I , placing it in R .An operand stack offset of 1 is equivalent to 8 bytes down from the base of the stack frame |
addr_u | 17 00 R. U. __ __ __ __ | Get the address of U , placing it in R |
addr_g | 18 00 R. G. .. __ __ __ | Get the address of G , placing it in R |
addr_f | 19 00 R. F. .. __ __ __ | Get the address of F , placing it in R |
addr_b | 1a 00 R. B. .. __ __ __ | Get the address of B , placing it in R |
addr_x | 1b 00 R. X. .. __ __ __ | Get the address of X , placing it in R |
addr_c | 1c 00 R. C. .. __ __ __ | Get the address of C , placing it in R |
load
Loads a value from memory
Name | Encoding | Description |
---|---|---|
load8 | 1d 00 Rx Ry I. .. .. .. | Loads an 8-bit value from memory at the address in Ry offset by I , placing the result in Rx |
load16 | 1e 00 Rx Ry I. .. .. .. | Loads a 16-bit value from memory at the address in Ry offset by I , placing the result in Rx |
load32 | 1f 00 Rx Ry I. .. .. .. | Loads a 32-bit value from memory at the address in Ry offset by I , placing the result in Rx |
load64 | 20 00 Rx Ry I. .. .. .. | Loads a 64-bit value from memory at the address in Ry offset by I , placing the result in Rx |
store
Stores a value to memory
Name | Encoding | Description |
---|---|---|
store8 | 21 00 Rx Ry I. .. .. .. | Stores an 8-bit value from Ry to memory at the address in Rx offset by I |
store16 | 22 00 Rx Ry I. .. .. .. | Stores a 16-bit value from Ry to memory at the address in Rx offset by I |
store32 | 23 00 Rx Ry I. .. .. .. | Stores a 32-bit value from Ry to memory at the address in Rx offset by I |
store64 | 24 00 Rx Ry I. .. .. .. | Stores a 64-bit value from Ry to memory at the address in Rx offset by I |
store8c | 25 00 R. Ix Iy .. .. .. | Stores an 8-bit value to memory at the address in R offset by Iy |
store16c | 26 00 R. __ __ __ __ __ Ix .. Iy .. .. .. __ __ | Stores a 16-bit value to memory at the address in R offset by Iy |
store32c | 27 00 R. __ __ __ __ __ Ix .. .. .. Iy .. .. .. | Stores a 32-bit value to memory at the address in R offset by Iy |
store64c | 28 00 R. Ix .. .. .. __ Iy .. .. .. .. .. .. .. | Stores a 64-bit value (encoded as Iy ) to memory at the address in R offset by Ix |
Bitwise
Instructions that manipulate values at the bit level.
- Where the size is < 64-bits, the least significant bits of the input value(s) are used, and the remainder of the output value is zeroed
bit_swap
Swaps bits of two registers
Name | Encoding | Description |
---|---|---|
bit_swap8 | 29 00 Rx Ry __ __ __ __ | 8-bit Rx ⇔ Ry |
bit_swap16 | 2a 00 Rx Ry __ __ __ __ | 16-bit Rx ⇔ Ry |
bit_swap32 | 2b 00 Rx Ry __ __ __ __ | 32-bit Rx ⇔ Ry |
bit_swap64 | 2c 00 Rx Ry __ __ __ __ | 64-bit Rx ⇔ Ry |
bit_copy
Copies bits from one register into another
Name | Encoding | Description |
---|---|---|
bit_copy8 | 2d 00 Rx Ry __ __ __ __ | 8-bit Rx = Ry |
bit_copy16 | 2e 00 Rx Ry __ __ __ __ | 16-bit Rx = Ry |
bit_copy32 | 2f 00 Rx Ry __ __ __ __ | 32-bit Rx = Ry |
bit_copy64 | 30 00 Rx Ry __ __ __ __ | 64-bit Rx = Ry |
bit_copy8c | 31 00 R. I. __ __ __ __ | Copies an 8-bit I value into R |
bit_copy16c | 32 00 R. I. .. __ __ __ | Copies a 16-bit I value into R |
bit_copy32c | 33 00 R. I. .. .. .. __ | Copies a 32-bit I value into R |
bit_copy64c | 34 00 R. __ __ __ __ __ I. .. .. .. .. .. .. .. | Copies a 64-bit I value into R |
bit_clz
Counts the number of leading zero bits in the provided value
Name | Encoding | Description |
---|---|---|
bit_clz8 | 35 00 Rx Ry __ __ __ __ | Counts the leading zeroes in 8-bits of Ry , placing the result in Rx |
bit_clz16 | 36 00 Rx Ry __ __ __ __ | Counts the leading zeroes in 16-bits of Ry , placing the result in Rx |
bit_clz32 | 37 00 Rx Ry __ __ __ __ | Counts the leading zeroes in 32-bits of Ry , placing the result in Rx |
bit_clz64 | 38 00 Rx Ry __ __ __ __ | Counts the leading zeroes in 64-bits of Ry , placing the result in Rx |
bit_pop
Counts the number of bits that are set to 1 in the provided value
Name | Encoding | Description |
---|---|---|
bit_pop8 | 39 00 Rx Ry __ __ __ __ | Counts the set bits in 8-bits of Ry , placing the result in Rx |
bit_pop16 | 3a 00 Rx Ry __ __ __ __ | Counts the set bits in 16-bits of Ry , placing the result in Rx |
bit_pop32 | 3b 00 Rx Ry __ __ __ __ | Counts the set bits in 32-bits of Ry , placing the result in Rx |
bit_pop64 | 3c 00 Rx Ry __ __ __ __ | Counts the set bits in 64-bits of Ry , placing the result in Rx |
bit_not
Performs a bitwise NOT
operation on the provided value
Name | Encoding | Description |
---|---|---|
bit_not8 | 3d 00 Rx Ry __ __ __ __ | 8-bit Rx = ~Ry |
bit_not16 | 3e 00 Rx Ry __ __ __ __ | 16-bit Rx = ~Ry |
bit_not32 | 3f 00 Rx Ry __ __ __ __ | 32-bit Rx = ~Ry |
bit_not64 | 40 00 Rx Ry __ __ __ __ | 64-bit Rx = ~Ry |
bit_and
Performs a bitwise AND
operation on the provided values
Name | Encoding | Description |
---|---|---|
bit_and8 | 41 00 Rx Ry Rz __ __ __ | 8-bit Rx = Ry & Rz |
bit_and16 | 42 00 Rx Ry Rz __ __ __ | 6-bit Rx = Ry & Rz |
bit_and32 | 43 00 Rx Ry Rz __ __ __ | 32-bit Rx = Ry & Rz |
bit_and64 | 44 00 Rx Ry Rz __ __ __ | 64-bit Rx = Ry & Rz |
bit_and8c | 45 00 Rx Ry I. __ __ __ | 8-bit Rx = Ry & I |
bit_and16c | 46 00 Rx Ry I. .. __ __ | 6-bit Rx = Ry & I |
bit_and32c | 47 00 Rx Ry I. .. .. .. | 32-bit Rx = Ry & I |
bit_and64c | 48 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry & I |
bit_or
Performs a bitwise OR
operation on the provided values
Name | Encoding | Description |
---|---|---|
bit_or8 | 49 00 Rx Ry Rz __ __ __ | 8-bit Rx = Ry | Rz |
bit_or16 | 4a 00 Rx Ry Rz __ __ __ | 16-bit Rx = Ry | Rz |
bit_or32 | 4b 00 Rx Ry Rz __ __ __ | 32-bit Rx = Ry | Rz |
bit_or64 | 4c 00 Rx Ry Rz __ __ __ | 64-bit Rx = Ry | Rz |
bit_or8c | 4d 00 Rx Ry I. __ __ __ | 8-bit Rx = Ry | I |
bit_or16c | 4e 00 Rx Ry I. .. __ __ | 16-bit Rx = Ry | I |
bit_or32c | 4f 00 Rx Ry I. .. .. .. | 32-bit Rx = Ry | I |
bit_or64c | 50 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry | I |
bit_xor
Performs a bitwise XOR
operation on the provided values
Name | Encoding | Description |
---|---|---|
bit_xor8 | 51 00 Rx Ry Rz __ __ __ | 8-bit Rx = Ry ^ Rz |
bit_xor16 | 52 00 Rx Ry Rz __ __ __ | 16-bit Rx = Ry ^ Rz |
bit_xor32 | 53 00 Rx Ry Rz __ __ __ | 32-bit Rx = Ry ^ Rz |
bit_xor64 | 54 00 Rx Ry Rz __ __ __ | 64-bit Rx = Ry ^ Rz |
bit_xor8c | 55 00 Rx Ry I. __ __ __ | 8-bit Rx = Ry ^ I |
bit_xor16c | 56 00 Rx Ry I. .. __ __ | 16-bit Rx = Ry ^ I |
bit_xor32c | 57 00 Rx Ry I. .. .. .. | 32-bit Rx = Ry ^ I |
bit_xor64c | 58 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry ^ I |
bit_lshift
Performs a bitwise left shift operation on the provided values
Name | Encoding | Description |
---|---|---|
bit_lshift8 | 59 00 Rx Ry Rz __ __ __ | 8-bit Rx = Ry << Rz |
bit_lshift16 | 5a 00 Rx Ry Rz __ __ __ | 16-bit Rx = Ry << Rz |
bit_lshift32 | 5b 00 Rx Ry Rz __ __ __ | 32-bit Rx = Ry << Rz |
bit_lshift64 | 5c 00 Rx Ry Rz __ __ __ | 64-bit Rx = Ry << Rz |
bit_lshift8a | 5d 00 Rx Ry I. __ __ __ | 8-bit Rx = I << Ry |
bit_lshift16a | 5e 00 Rx Ry I. .. __ __ | 16-bit Rx = I << Ry |
bit_lshift32a | 5f 00 Rx Ry I. .. .. .. | 32-bit Rx = I << Ry |
bit_lshift64a | 60 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I << Ry |
bit_lshift8b | 61 00 Rx Ry I. __ __ __ | 8-bit Rx = Ry << I |
bit_lshift16b | 62 00 Rx Ry I. __ __ __ | 16-bit Rx = Ry << I |
bit_lshift32b | 63 00 Rx Ry I. __ __ __ | 32-bit Rx = Ry << I |
bit_lshift64b | 64 00 Rx Ry I. __ __ __ | 64-bit Rx = Ry << I |
bit_rshift
Performs a bitwise right shift operation on the provided values
Name | Encoding | Description |
---|---|---|
u_rshift8 | 65 00 Rx Ry Rz __ __ __ | 8-bit unsigned/logical Rx = Ry >> Rz |
u_rshift16 | 66 00 Rx Ry Rz __ __ __ | 16-bit unsigned/logical Rx = Ry >> Rz |
u_rshift32 | 67 00 Rx Ry Rz __ __ __ | 32-bit unsigned/logical Rx = Ry >> Rz |
u_rshift64 | 68 00 Rx Ry Rz __ __ __ | 64-bit unsigned/logical Rx = Ry >> Rz |
u_rshift8a | 69 00 Rx Ry I. __ __ __ | 8-bit unsigned/logical Rx = I >> Ry |
u_rshift16a | 6a 00 Rx Ry I. .. __ __ | 16-bit unsigned/logical Rx = I >> Ry |
u_rshift32a | 6b 00 Rx Ry I. .. .. .. | 32-bit unsigned/logical Rx = I >> Ry |
u_rshift64a | 6c 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned/logical Rx = I >> Ry |
u_rshift8b | 6d 00 Rx Ry I. __ __ __ | 8-bit unsigned/logical Rx = Ry >> I |
u_rshift16b | 6e 00 Rx Ry I. __ __ __ | 16-bit unsigned/logical Rx = Ry >> I |
u_rshift32b | 6f 00 Rx Ry I. __ __ __ | 32-bit unsigned/logical Rx = Ry >> I |
u_rshift64b | 70 00 Rx Ry I. __ __ __ | 64-bit unsigned/logical Rx = Ry >> I |
s_rshift8 | 71 00 Rx Ry Rz __ __ __ | 8-bit signed/arithmetic Rx = Ry >> Rz |
s_rshift16 | 72 00 Rx Ry Rz __ __ __ | 16-bit signed/arithmetic Rx = Ry >> Rz |
s_rshift32 | 73 00 Rx Ry Rz __ __ __ | 32-bit signed/arithmetic Rx = Ry >> Rz |
s_rshift64 | 74 00 Rx Ry Rz __ __ __ | 64-bit signed/arithmetic Rx = Ry >> Rz |
s_rshift8a | 75 00 Rx Ry I. __ __ __ | 8-bit signed/arithmetic Rx = I >> Ry |
s_rshift16a | 76 00 Rx Ry I. .. __ __ | 16-bit signed/arithmetic Rx = I >> Ry |
s_rshift32a | 77 00 Rx Ry I. .. .. .. | 32-bit signed/arithmetic Rx = I >> Ry |
s_rshift64a | 78 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed/arithmetic Rx = I >> Ry |
s_rshift8b | 79 00 Rx Ry I. __ __ __ | 8-bit signed/arithmetic Rx = Ry >> I |
s_rshift16b | 7a 00 Rx Ry I. __ __ __ | 16-bit signed/arithmetic Rx = Ry >> I |
s_rshift32b | 7b 00 Rx Ry I. __ __ __ | 32-bit signed/arithmetic Rx = Ry >> I |
s_rshift64b | 7c 00 Rx Ry I. __ __ __ | 64-bit signed/arithmetic Rx = Ry >> I |
Comparison
Instructions that compare values
eq
Performs an equality comparison on the provided values
Name | Encoding | Description |
---|---|---|
i_eq8 | 7d 00 Rx Ry Rz __ __ __ | 8-bit integer Rx = Ry == Rz |
i_eq16 | 7e 00 Rx Ry Rz __ __ __ | 16-bit integer Rx = Ry == Rz |
i_eq32 | 7f 00 Rx Ry Rz __ __ __ | 32-bit integer Rx = Ry == Rz |
i_eq64 | 80 00 Rx Ry Rz __ __ __ | 64-bit integer Rx = Ry == Rz |
i_eq8c | 81 00 Rx Ry I. __ __ __ | 8-bit integer Rx = Ry == I |
i_eq16c | 82 00 Rx Ry I. .. __ __ | 16-bit integer Rx = Ry == I |
i_eq32c | 83 00 Rx Ry I. .. .. .. | 32-bit integer Rx = Ry == I |
i_eq64c | 84 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit integer Rx = Ry == I |
f_eq32 | 85 00 Rx Ry Rz __ __ __ | 32-bit floating point Rx = Ry == Rz |
f_eq64 | 86 00 Rx Ry Rz __ __ __ | 64-bit floating point Rx = Ry == Rz |
f_eq32c | 87 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = Ry == I |
f_eq64c | 88 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = Ry == I |
ne
Performs an inequality comparison on the provided values
Name | Encoding | Description |
---|---|---|
i_ne8 | 89 00 Rx Ry Rz __ __ __ | 8-bit integer Rx = Ry != Rz |
i_ne16 | 8a 00 Rx Ry Rz __ __ __ | 16-bit integer Rx = Ry != Rz |
i_ne32 | 8b 00 Rx Ry Rz __ __ __ | 32-bit integer Rx = Ry != Rz |
i_ne64 | 8c 00 Rx Ry Rz __ __ __ | 64-bit integer Rx = Ry != Rz |
i_ne8c | 8d 00 Rx Ry I. __ __ __ | 8-bit integer Rx = Ry != I |
i_ne16c | 8e 00 Rx Ry I. .. __ __ | 16-bit integer Rx = Ry != I |
i_ne32c | 8f 00 Rx Ry I. .. .. .. | 32-bit integer Rx = Ry != I |
i_ne64c | 90 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit integer Rx = Ry != I |
f_ne32 | 91 00 Rx Ry Rz __ __ __ | 32-bit floating point Rx = Ry != Rz |
f_ne64 | 92 00 Rx Ry Rz __ __ __ | 64-bit floating point Rx = Ry != Rz |
f_ne32c | 93 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = Ry != I |
f_ne64c | 94 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = Ry != I |
lt
Performs a less-than comparison on the provided values
Name | Encoding | Description |
---|---|---|
u_lt8 | 95 00 Rx Ry Rz __ __ __ | 8-bit unsigned integer Rx = Ry < Rz |
u_lt16 | 96 00 Rx Ry Rz __ __ __ | 16-bit unsigned integer Rx = Ry < Rz |
u_lt32 | 97 00 Rx Ry Rz __ __ __ | 32-bit unsigned integer Rx = Ry < Rz |
u_lt64 | 98 00 Rx Ry Rz __ __ __ | 64-bit unsigned integer Rx = Ry < Rz |
u_lt8a | 99 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = I < Ry |
u_lt16a | 9a 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = I < Ry |
u_lt32a | 9b 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = I < Ry |
u_lt64a | 9c 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = I < Ry |
u_lt8b | 9d 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = Ry < I |
u_lt16b | 9e 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = Ry < I |
u_lt32b | 9f 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = Ry < I |
u_lt64b | a0 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = Ry < I |
s_lt8 | a1 00 Rx Ry Rz __ __ __ | 8-bit signed integer Rx = Ry < Rz |
s_lt16 | a2 00 Rx Ry Rz __ __ __ | 16-bit signed integer Rx = Ry < Rz |
s_lt32 | a3 00 Rx Ry Rz __ __ __ | 32-bit signed integer Rx = Ry < Rz |
s_lt64 | a4 00 Rx Ry Rz __ __ __ | 64-bit signed integer Rx = Ry < Rz |
s_lt8a | a5 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = I < Ry |
s_lt16a | a6 00 Rx Ry I. .. __ __ | 16-bit signed integer Rx = I < Ry |
s_lt32a | a7 00 Rx Ry I. .. .. .. | 32-bit signed integer Rx = I < Ry |
s_lt64a | a8 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = I < Ry |
s_lt8b | a9 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = Ry < I |
s_lt16b | aa 00 Rx Ry I. .. __ __ | 16-bit signed integer Rx = Ry < I |
s_lt32b | ab 00 Rx Ry I. .. .. .. | 32-bit signed integer Rx = Ry < I |
s_lt64b | ac 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = Ry < I |
f_lt32 | ad 00 Rx Ry Rz __ __ __ | 32-bit floating point Rx = Ry < Rz |
f_lt32a | ae 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = I < Ry |
f_lt32b | af 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = Ry < I |
f_lt64 | b0 00 Rx Ry Rz __ __ __ | 64-bit floating point Rx = Ry < Rz |
f_lt64a | b1 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = I < Ry |
f_lt64b | b2 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = Ry < I |
gt
Performs a greater-than comparison on the provided values
Name | Encoding | Description |
---|---|---|
u_gt8 | b3 00 Rx Ry Rz __ __ __ | 8-bit unsigned integer Rx = Ry > Rz |
u_gt16 | b4 00 Rx Ry Rz __ __ __ | 16-bit unsigned integer Rx = Ry > Rz |
u_gt32 | b5 00 Rx Ry Rz __ __ __ | 32-bit unsigned integer Rx = Ry > Rz |
u_gt64 | b6 00 Rx Ry Rz __ __ __ | 64-bit unsigned integer Rx = Ry > Rz |
u_gt8a | b7 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = I > Ry |
u_gt16a | b8 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = I > Ry |
u_gt32a | b9 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = I > Ry |
u_gt64a | ba 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = I > Ry |
u_gt8b | bb 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = Ry > I |
u_gt16b | bc 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = Ry > I |
u_gt32b | bd 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = Ry > I |
u_gt64b | be 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = Ry > I |
s_gt8 | bf 00 Rx Ry Rz __ __ __ | 8-bit signed integer Rx = Ry > Rz |
s_gt16 | c0 00 Rx Ry Rz __ __ __ | 16-bit signed integer Rx = Ry > Rz |
s_gt32 | c1 00 Rx Ry Rz __ __ __ | 32-bit signed integer Rx = Ry > Rz |
s_gt64 | c2 00 Rx Ry Rz __ __ __ | 64-bit signed integer Rx = Ry > Rz |
s_gt8a | c3 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = I > Ry |
s_gt16a | c4 00 Rx Ry I. .. __ __ | 16-bit signed integer Rx = I > Ry |
s_gt32a | c5 00 Rx Ry I. .. .. .. | 32-bit signed integer Rx = I > Ry |
s_gt64a | c6 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = I > Ry |
s_gt8b | c7 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = Ry > I |
s_gt16b | c8 00 Rx Ry I. .. __ __ | 16-bit signed integer Rx = Ry > I |
s_gt32b | c9 00 Rx Ry I. .. .. .. | 32-bit signed integer Rx = Ry > I |
s_gt64b | ca 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = Ry > I |
f_gt32 | cb 00 Rx Ry Rz __ __ __ | 32-bit floating point Rx = Ry > Rz |
f_gt32a | cc 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = I > Ry |
f_gt32b | cd 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = Ry > I |
f_gt64 | ce 00 Rx Ry Rz __ __ __ | 64-bit floating point Rx = Ry > Rz |
f_gt64a | cf 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = I > Ry |
f_gt64b | d0 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = Ry > I |
le
Performs a less-than-or-equal comparison on the provided values
Name | Encoding | Description |
---|---|---|
u_le8 | d1 00 Rx Ry Rz __ __ __ | 8-bit unsigned integer Rx = Ry ⇐ Rz |
u_le16 | d2 00 Rx Ry Rz __ __ __ | 16-bit unsigned integer Rx = Ry ⇐ Rz |
u_le32 | d3 00 Rx Ry Rz __ __ __ | 32-bit unsigned integer Rx = Ry ⇐ Rz |
u_le64 | d4 00 Rx Ry Rz __ __ __ | 64-bit unsigned integer Rx = Ry ⇐ Rz |
u_le8a | d5 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = I ⇐ Ry |
u_le16a | d6 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = I ⇐ Ry |
u_le32a | d7 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = I ⇐ Ry |
u_le64a | d8 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = I ⇐ Ry |
u_le8b | d9 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = Ry ⇐ I |
u_le16b | da 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = Ry ⇐ I |
u_le32b | db 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = Ry ⇐ I |
u_le64b | dc 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = Ry ⇐ I |
s_le8 | dd 00 Rx Ry Rz __ __ __ | 8-bit signed integer Rx = Ry ⇐ Rz |
s_le16 | de 00 Rx Ry Rz __ __ __ | 16-bit signed integer Rx = Ry ⇐ Rz |
s_le32 | df 00 Rx Ry Rz __ __ __ | 32-bit signed integer Rx = Ry ⇐ Rz |
s_le64 | e0 00 Rx Ry Rz __ __ __ | 64-bit signed integer Rx = Ry ⇐ Rz |
s_le8a | e1 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = I ⇐ Ry |
s_le16a | e2 00 Rx Ry I. .. __ __ | 16-bit signed integer Rx = I ⇐ Ry |
s_le32a | e3 00 Rx Ry I. .. .. .. | 32-bit signed integer Rx = I ⇐ Ry |
s_le64a | e4 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = I ⇐ Ry |
s_le8b | e5 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = Ry ⇐ I |
s_le16b | e6 00 Rx Ry I. .. __ __ | 16-bit signed integer Rx = Ry ⇐ I |
s_le32b | e7 00 Rx Ry I. .. .. .. | 32-bit signed integer Rx = Ry ⇐ I |
s_le64b | e8 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = Ry ⇐ I |
f_le32 | e9 00 Rx Ry Rz __ __ __ | 32-bit floating point Rx = Ry ⇐ Rz |
f_le32a | ea 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = I ⇐ Ry |
f_le32b | eb 00 Rx Ry I. .. .. .. | 32-bit floating point Rx = Ry ⇐ I |
f_le64 | ec 00 Rx Ry Rz __ __ __ | 64-bit floating point Rx = Ry ⇐ Rz |
f_le64a | ed 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = I ⇐ Ry |
f_le64b | ee 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = Ry ⇐ I |
ge
Performs a greater-than-or-equal comparison on the provided values
Name | Encoding | Description |
---|---|---|
u_ge8 | ef 00 Rx Ry Rz __ __ __ | 8-bit unsigned integer Rx = Ry >= Rz |
u_ge16 | f0 00 Rx Ry Rz __ __ __ | 16-bit unsigned integer Rx = Ry >= Rz |
u_ge32 | f1 00 Rx Ry Rz __ __ __ | 32-bit unsigned integer Rx = Ry >= Rz |
u_ge64 | f2 00 Rx Ry Rz __ __ __ | 64-bit unsigned integer Rx = Ry >= Rz |
u_ge8a | f3 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = I >= Ry |
u_ge16a | f4 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = I >= Ry |
u_ge32a | f5 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = I >= Ry |
u_ge64a | f6 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = I >= Ry |
u_ge8b | f7 00 Rx Ry I. __ __ __ | 8-bit unsigned integer Rx = Ry >= I |
u_ge16b | f8 00 Rx Ry I. .. __ __ | 16-bit unsigned integer Rx = Ry >= I |
u_ge32b | f9 00 Rx Ry I. .. .. .. | 32-bit unsigned integer Rx = Ry >= I |
u_ge64b | fa 00 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned integer Rx = Ry >= I |
s_ge8 | fb 00 Rx Ry Rz __ __ __ | 8-bit signed integer Rx = Ry >= Rz |
s_ge16 | fc 00 Rx Ry Rz __ __ __ | 16-bit signed integer Rx = Ry >= Rz |
s_ge32 | fd 00 Rx Ry Rz __ __ __ | 32-bit signed integer Rx = Ry >= Rz |
s_ge64 | fe 00 Rx Ry Rz __ __ __ | 64-bit signed integer Rx = Ry >= Rz |
s_ge8a | ff 00 Rx Ry I. __ __ __ | 8-bit signed integer Rx = I >= Ry |
s_ge16a | 00 01 Rx Ry I. .. __ __ | 16-bit signed integer Rx = I >= Ry |
s_ge32a | 01 01 Rx Ry I. .. .. .. | 32-bit signed integer Rx = I >= Ry |
s_ge64a | 02 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = I >= Ry |
s_ge8b | 03 01 Rx Ry I. __ __ __ | 8-bit signed integer Rx = Ry >= I |
s_ge16b | 04 01 Rx Ry I. .. __ __ | 16-bit signed integer Rx = Ry >= I |
s_ge32b | 05 01 Rx Ry I. .. .. .. | 32-bit signed integer Rx = Ry >= I |
s_ge64b | 06 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed integer Rx = Ry >= I |
f_ge32 | 07 01 Rx Ry Rz __ __ __ | 32-bit floating point Rx = Ry >= Rz |
f_ge32a | 08 01 Rx Ry I. .. .. .. | 32-bit floating point Rx = I >= Ry |
f_ge32b | 09 01 Rx Ry I. .. .. .. | 32-bit floating point Rx = Ry >= I |
f_ge64 | 0a 01 Rx Ry Rz __ __ __ | 64-bit floating point Rx = Ry >= Rz |
f_ge64a | 0b 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = I >= Ry |
f_ge64b | 0c 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit floating point Rx = Ry >= I |
Integer arithmetic
Instructions that perform integer arithmetic operations on values. Because we use two’s compliment integers, the signedness of the operands does not affect all operations. Where it does, the mnemonic will be prefixed with “u” or “s”, otherwise with “i”.
- Where the size is < 64-bits, the least significant bits of the input value(s) are used, and the remainder of the output value is zeroed
i_neg
Performs integer negation on the provided value.
Name | Encoding | Description |
---|---|---|
s_neg8 | 0d 01 Rx Ry __ __ __ __ | 8-bit Rx = -Ry |
s_neg16 | 0e 01 Rx Ry __ __ __ __ | 16-bit Rx = -Ry |
s_neg32 | 0f 01 Rx Ry __ __ __ __ | 32-bit Rx = -Ry |
s_neg64 | 10 01 Rx Ry __ __ __ __ | 64-bit Rx = -Ry |
i_abs
Finds the absolute value of the provided value
Name | Encoding | Description |
---|---|---|
s_abs8 | 11 01 Rx Ry __ __ __ __ | 8-bit Rx = |Ry | |
s_abs16 | 12 01 Rx Ry __ __ __ __ | 16-bit Rx = |Ry | |
s_abs32 | 13 01 Rx Ry __ __ __ __ | 32-bit Rx = |Ry | |
s_abs64 | 14 01 Rx Ry __ __ __ __ | 64-bit Rx = |Ry | |
i_add
Performs integer addition on the provided values.
Name | Encoding | Description |
---|---|---|
i_add8 | 15 01 Rx Ry Rz __ __ __ | 8-bit Rx = Ry + Rz |
i_add16 | 16 01 Rx Ry Rz __ __ __ | 16-bit Rx = Ry + Rz |
i_add32 | 17 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry + Rz |
i_add64 | 18 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry + Rz |
i_add8c | 19 01 Rx Ry I. __ __ __ | 8-bit Rx = Ry + I |
i_add16c | 1a 01 Rx Ry I. .. __ __ | 16-bit Rx = Ry + I |
i_add32c | 1b 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry + I |
i_add64c | 1c 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry + I |
i_sub
Performs integer subtraction on the provided values.
Name | Encoding | Description |
---|---|---|
i_sub8 | 1d 01 Rx Ry Rz __ __ __ | 8-bit Rx = Ry - Rz |
i_sub16 | 1e 01 Rx Ry Rz __ __ __ | 16-bit Rx = Ry - Rz |
i_sub32 | 1f 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry - Rz |
i_sub64 | 20 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry - Rz |
i_sub8a | 21 01 Rx Ry I. __ __ __ | 8-bit Rx = I - Ry |
i_sub16a | 22 01 Rx Ry I. .. __ __ | 16-bit Rx = I - Ry |
i_sub32a | 23 01 Rx Ry I. .. .. .. | 32-bit Rx = I - Ry |
i_sub64a | 24 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I - Ry |
i_sub8b | 25 01 Rx Ry I. __ __ __ | 8-bit Rx = Ry - I |
i_sub16b | 26 01 Rx Ry I. .. __ __ | 16-bit Rx = Ry - I |
i_sub32b | 27 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry - I |
i_sub64b | 28 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry - I |
i_mul
Performs integer multiplication on the provided values.
Name | Encoding | Description |
---|---|---|
i_mul8 | 29 01 Rx Ry Rz __ __ __ | 8-bit Rx = Ry * Rz |
i_mul16 | 2a 01 Rx Ry Rz __ __ __ | 16-bit Rx = Ry * Rz |
i_mul32 | 2b 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry * Rz |
i_mul64 | 2c 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry * Rz |
i_mul8c | 2d 01 Rx Ry I. __ __ __ | 8-bit Rx = Ry * I |
i_mul16c | 2e 01 Rx Ry I. .. __ __ | 16-bit Rx = Ry * I |
i_mul32c | 2f 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry * I |
i_mul64c | 30 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry * I |
i_div
Performs integer division on the provided values.
Name | Encoding | Description |
---|---|---|
u_div8 | 31 01 Rx Ry Rz __ __ __ | 8-bit unsigned Rx = Ry / Rz |
u_div16 | 32 01 Rx Ry Rz __ __ __ | 16-bit unsigned Rx = Ry / Rz |
u_div32 | 33 01 Rx Ry Rz __ __ __ | 32-bit unsigned Rx = Ry / Rz |
u_div64 | 34 01 Rx Ry Rz __ __ __ | 64-bit unsigned Rx = Ry / Rz |
u_div8a | 35 01 Rx Ry I. __ __ __ | 8-bit unsigned Rx = I / Ry |
u_div16a | 36 01 Rx Ry I. .. __ __ | 16-bit unsigned Rx = I / Ry |
u_div32a | 37 01 Rx Ry I. .. .. .. | 32-bit unsigned Rx = I / Ry |
u_div64a | 38 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned Rx = I / Ry |
u_div8b | 39 01 Rx Ry I. __ __ __ | 8-bit unsigned Rx = Ry / I |
u_div16b | 3a 01 Rx Ry I. .. __ __ | 16-bit unsigned Rx = Ry / I |
u_div32b | 3b 01 Rx Ry I. .. .. .. | 32-bit unsigned Rx = Ry / I |
u_div64b | 3c 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned Rx = Ry / I |
s_div8 | 3d 01 Rx Ry Rz __ __ __ | 8-bit signed Rx = Ry / Rz |
s_div16 | 3e 01 Rx Ry Rz __ __ __ | 16-bit signed Rx = Ry / Rz |
s_div32 | 3f 01 Rx Ry Rz __ __ __ | 32-bit signed Rx = Ry / Rz |
s_div64 | 40 01 Rx Ry Rz __ __ __ | 64-bit signed Rx = Ry / Rz |
s_div8a | 41 01 Rx Ry I. __ __ __ | 8-bit signed Rx = I / Ry |
s_div16a | 42 01 Rx Ry I. .. __ __ | 16-bit signed Rx = I / Ry |
s_div32a | 43 01 Rx Ry I. .. .. .. | 32-bit signed Rx = I / Ry |
s_div64a | 44 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed Rx = I / Ry |
s_div8b | 45 01 Rx Ry I. __ __ __ | 8-bit signed Rx = Ry / I |
s_div16b | 46 01 Rx Ry I. .. __ __ | 16-bit signed Rx = Ry / I |
s_div32b | 47 01 Rx Ry I. .. .. .. | 32-bit signed Rx = Ry / I |
s_div64b | 48 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed Rx = Ry / I |
i_rem
Gets the remainder of integer division on the provided values.
Name | Encoding | Description |
---|---|---|
u_rem8 | 49 01 Rx Ry Rz __ __ __ | 8-bit unsigned Rx = Ry % Rz |
u_rem16 | 4a 01 Rx Ry Rz __ __ __ | 16-bit unsigned Rx = Ry % Rz |
u_rem32 | 4b 01 Rx Ry Rz __ __ __ | 32-bit unsigned Rx = Ry % Rz |
u_rem64 | 4c 01 Rx Ry Rz __ __ __ | 64-bit unsigned Rx = Ry % Rz |
u_rem8a | 4d 01 Rx Ry I. __ __ __ | 8-bit unsigned Rx = I % Ry |
u_rem16a | 4e 01 Rx Ry I. .. __ __ | 16-bit unsigned Rx = I % Ry |
u_rem32a | 4f 01 Rx Ry I. .. .. .. | 32-bit unsigned Rx = I % Ry |
u_rem64a | 50 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned Rx = I % Ry |
u_rem8b | 51 01 Rx Ry I. __ __ __ | 8-bit unsigned Rx = Ry % I |
u_rem16b | 52 01 Rx Ry I. .. __ __ | 16-bit unsigned Rx = Ry % I |
u_rem32b | 53 01 Rx Ry I. .. .. .. | 32-bit unsigned Rx = Ry % I |
u_rem64b | 54 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit unsigned Rx = Ry % I |
s_rem8 | 55 01 Rx Ry Rz __ __ __ | 8-bit signed Rx = Ry % Rz |
s_rem16 | 56 01 Rx Ry Rz __ __ __ | 16-bit signed Rx = Ry % Rz |
s_rem32 | 57 01 Rx Ry Rz __ __ __ | 32-bit signed Rx = Ry % Rz |
s_rem64 | 58 01 Rx Ry Rz __ __ __ | 64-bit signed Rx = Ry % Rz |
s_rem8a | 59 01 Rx Ry I. __ __ __ | 8-bit signed Rx = I % Ry |
s_rem16a | 5a 01 Rx Ry I. .. __ __ | 16-bit signed Rx = I % Ry |
s_rem32a | 5b 01 Rx Ry I. .. .. .. | 32-bit signed Rx = I % Ry |
s_rem64a | 5c 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed Rx = I % Ry |
s_rem8b | 5d 01 Rx Ry I. __ __ __ | 8-bit signed Rx = Ry % I |
s_rem16b | 5e 01 Rx Ry I. .. __ __ | 16-bit signed Rx = Ry % I |
s_rem32b | 5f 01 Rx Ry I. .. .. .. | 32-bit signed Rx = Ry % I |
s_rem64b | 60 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit signed Rx = Ry % I |
i_pow
Raises a provided value to the power of the other provided value.
Name | Encoding | Description |
---|---|---|
i_pow8 | 61 01 Rx Ry Rz __ __ __ | 8-bit Rx = Ry ** Rz |
i_pow16 | 62 01 Rx Ry Rz __ __ __ | 16-bit Rx = Ry ** Rz |
i_pow32 | 63 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry ** Rz |
i_pow64 | 64 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry ** Rz |
i_pow8a | 65 01 Rx Ry I. __ __ __ | 8-bit Rx = I ** Ry |
i_pow16a | 66 01 Rx Ry I. .. __ __ | 16-bit Rx = I ** Ry |
i_pow32a | 67 01 Rx Ry I. .. .. .. | 32-bit Rx = I ** Ry |
i_pow64a | 68 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I ** Ry |
i_pow8b | 69 01 Rx Ry I. __ __ __ | 8-bit Rx = Ry ** I |
i_pow16b | 6a 01 Rx Ry I. .. __ __ | 16-bit Rx = Ry ** I |
i_pow32b | 6b 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry ** I |
i_pow64b | 6c 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry ** I |
Floating point arithmetic
Instructions that perform floating point arithmetic operations on values.
- Where the size is < 64-bits, the least significant bits of the input value(s) are used and the remainder of the output value is zeroed
f_neg
Performs floating point negation on the provided value
Name | Encoding | Description |
---|---|---|
f_neg32 | 6d 01 Rx Ry __ __ __ __ | 32-bit Rx = -Ry |
f_neg64 | 6e 01 Rx Ry __ __ __ __ | 64-bit Rx = -Ry |
f_abs
Performs a floating point absolute value operation on the provided value
Name | Encoding | Description |
---|---|---|
f_abs32 | 6f 01 Rx Ry __ __ __ __ | 32-bit Rx = |Ry | |
f_abs64 | 70 01 Rx Ry __ __ __ __ | 64-bit Rx = |Ry | |
f_sqrt
Performs a square root operation on the provided value
Name | Encoding | Description |
---|---|---|
f_sqrt32 | 71 01 Rx Ry __ __ __ __ | 32-bit Rx = sqrt(Ry ) |
f_sqrt64 | 72 01 Rx Ry __ __ __ __ | 64-bit Rx = sqrt(Ry ) |
f_floor
Performs a flooring operation on the provided value
Name | Encoding | Description |
---|---|---|
f_floor32 | 73 01 Rx Ry __ __ __ __ | 32-bit Rx = floor(Ry ) |
f_floor64 | 74 01 Rx Ry __ __ __ __ | 64-bit Rx = floor(Ry ) |
f_ceil
Performs a ceiling operation on the provided value
Name | Encoding | Description |
---|---|---|
f_ceil32 | 75 01 Rx Ry __ __ __ __ | 32-bit Rx = ceil(Ry ) |
f_ceil64 | 76 01 Rx Ry __ __ __ __ | 64-bit Rx = ceil(Ry ) |
f_round
Performs a rounding operation on the provided value
Name | Encoding | Description |
---|---|---|
f_round32 | 77 01 Rx Ry __ __ __ __ | 32-bit Rx = round(Ry ) |
f_round64 | 78 01 Rx Ry __ __ __ __ | 64-bit Rx = round(Ry ) |
f_trunc
Performs a truncation operation on the provided value
Name | Encoding | Description |
---|---|---|
f_trunc32 | 79 01 Rx Ry __ __ __ __ | 32-bit Rx = truncate(Ry ) |
f_trunc64 | 7a 01 Rx Ry __ __ __ __ | 64-bit Rx = truncate(Ry ) |
f_whole
Extracts the whole number part of the provided value
Name | Encoding | Description |
---|---|---|
f_whole32 | 7b 01 Rx Ry __ __ __ __ | 32-bit Rx = whole(Ry ) |
f_whole64 | 7c 01 Rx Ry __ __ __ __ | 64-bit Rx = whole(Ry ) |
f_frac
Extracts the fractional part of the provided value
Name | Encoding | Description |
---|---|---|
f_frac32 | 7d 01 Rx Ry __ __ __ __ | 32-bit Rx = frac(Ry ) |
f_frac64 | 7e 01 Rx Ry __ __ __ __ | 64-bit Rx = frac(Ry ) |
f_add
Performs floating point addition on the provided values
Name | Encoding | Description |
---|---|---|
f_add32 | 7f 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry + Rz |
f_add32c | 80 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry + I |
f_add64 | 81 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry + Rz |
f_add64c | 82 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry + I |
f_sub
Performs floating point subtraction on the provided values
Name | Encoding | Description |
---|---|---|
f_sub32 | 83 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry - Rz |
f_sub32a | 84 01 Rx Ry I. .. .. .. | 32-bit Rx = I - Ry |
f_sub32b | 85 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry - I |
f_sub64 | 86 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry - Rz |
f_sub64a | 87 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I - Ry |
f_sub64b | 88 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry - I |
f_mul
Performs floating point multiplication on the provided values
Name | Encoding | Description |
---|---|---|
f_mul32 | 89 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry * Rz |
f_mul32c | 8a 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry * I |
f_mul64 | 8b 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry * Rz |
f_mul64c | 8c 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry * I |
f_div
Performs floating point division on the provided values
Name | Encoding | Description |
---|---|---|
f_div32 | 8d 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry / Rz |
f_div32a | 8e 01 Rx Ry I. .. .. .. | 32-bit Rx = I / Ry |
f_div32b | 8f 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry / I |
f_div64 | 90 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry / Rz |
f_div64a | 91 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I / Ry |
f_div64b | 92 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry / I |
f_rem
Gets the remainder of floating point division on the provided values
Name | Encoding | Description |
---|---|---|
f_rem32 | 93 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry % Rz |
f_rem32a | 94 01 Rx Ry I. .. .. .. | 32-bit Rx = I % Ry |
f_rem32b | 95 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry % I |
f_rem64 | 96 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry % Rz |
f_rem64a | 97 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I % Ry |
f_rem64b | 98 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry % I |
f_pow
Raises a provided value to the power of the other provided value
Name | Encoding | Description |
---|---|---|
f_pow32 | 99 01 Rx Ry Rz __ __ __ | 32-bit Rx = Ry ** Rz |
f_pow32a | 9a 01 Rx Ry I. .. .. .. | 32-bit Rx = I ** Ry |
f_pow32b | 9b 01 Rx Ry I. .. .. .. | 32-bit Rx = Ry ** I |
f_pow64 | 9c 01 Rx Ry Rz __ __ __ | 64-bit Rx = Ry ** Rz |
f_pow64a | 9d 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = I ** Ry |
f_pow64b | 9e 01 Rx Ry __ __ __ __ I. .. .. .. .. .. .. .. | 64-bit Rx = Ry ** I |
Value conversion
Instructions that convert values between different bit representations
s_ext
Signed bit extension
Name | Encoding | Description |
---|---|---|
s_ext8_16 | 9f 01 Rx Ry __ __ __ __ | Sign extend 8-bits of Ry to 16-bits, placing the result in Rx |
s_ext8_32 | a0 01 Rx Ry __ __ __ __ | Sign extend 8-bits of Ry to 32-bits, placing the result in Rx |
s_ext8_64 | a1 01 Rx Ry __ __ __ __ | Sign extend 8-bits of Ry to 64-bits, placing the result in Rx |
s_ext16_32 | a2 01 Rx Ry __ __ __ __ | Sign extend 16-bits of Ry to 32-bits, placing the result in Rx |
s_ext16_64 | a3 01 Rx Ry __ __ __ __ | Sign extend 16-bits of Ry to 64-bits, placing the result in Rx |
s_ext32_64 | a4 01 Rx Ry __ __ __ __ | Sign extend 32-bits of Ry to 64-bits, placing the result in Rx |
f_to_i
Convert floats to various integer representations.
Name | Encoding | Description |
---|---|---|
f32_to_u8 | a5 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 8-bit integer; discards sign, places the result in Rx |
f32_to_u16 | a6 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 16-bit integer; discards sign, places the result in Rx |
f32_to_u32 | a7 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 32-bit integer; discards sign, places the result in Rx |
f32_to_u64 | a8 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 64-bit integer; discards sign, places the result in Rx |
f32_to_s8 | a9 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 8-bit integer; keeps sign, places the result in Rx |
f32_to_s16 | aa 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 16-bit integer; keeps sign, places the result in Rx |
f32_to_s32 | ab 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 32-bit integer; keeps sign, places the result in Rx |
f32_to_s64 | ac 01 Rx Ry __ __ __ __ | Convert of 32-bit float in Ry to 64-bit integer; keeps sign, places the result in Rx |
i_to_f
Convert various integers to float representations.
- Information loss is possible if the integer’s most significant bit index is larger than the float’s mantissa bit size
Name | Encoding | Description |
---|---|---|
u8_to_f32 | ad 01 Rx Ry __ __ __ __ | Convert 8-bits in Ry to 32-bit float; discards sign, places result in Rx |
u16_to_f32 | ae 01 Rx Ry __ __ __ __ | Convert 16-bits in Ry to 32-bit float; discards sign, places result in Rx |
u32_to_f32 | af 01 Rx Ry __ __ __ __ | Convert 32-bits in Ry to 32-bit float; discards sign, places result in Rx |
u64_to_f32 | b0 01 Rx Ry __ __ __ __ | Convert 64-bits in Ry to 32-bit float; discards sign, places result in Rx |
s8_to_f32 | b1 01 Rx Ry __ __ __ __ | Convert 8-bits in Ry to 32-bit float; keeps sign, places result in Rx |
s16_to_f32 | b2 01 Rx Ry __ __ __ __ | Convert 16-bits in Ry to 32-bit float; keeps sign, places result in Rx |
s32_to_f32 | b3 01 Rx Ry __ __ __ __ | Convert 32-bits in Ry to 32-bit float; keeps sign, places result in Rx |
s64_to_f32 | b4 01 Rx Ry __ __ __ __ | Convert 64-bits in Ry to 32-bit float; keeps sign, places result in Rx |
u8_to_f64 | b5 01 Rx Ry __ __ __ __ | Convert 8-bits in Ry to 64-bit float; discards sign, places result in Rx |
u16_to_f64 | b6 01 Rx Ry __ __ __ __ | Convert 16-bits in Ry to 64-bit float; discards sign, places result in Rx |
u32_to_f64 | b7 01 Rx Ry __ __ __ __ | Convert 32-bits in Ry to 64-bit float; discards sign, places result in Rx |
u64_to_f64 | b8 01 Rx Ry __ __ __ __ | Convert 64-bits in Ry to 64-bit float; discards sign, places result in Rx |
s8_to_f64 | b9 01 Rx Ry __ __ __ __ | Convert 8-bits in Ry to 64-bit float; keeps sign, places result in Rx |
s16_to_f64 | ba 01 Rx Ry __ __ __ __ | Convert 16-bits in Ry to 64-bit float; keeps sign, places result in Rx |
s32_to_f64 | bb 01 Rx Ry __ __ __ __ | Convert 32-bits in Ry to 64-bit float; keeps sign, places result in Rx |
s64_to_f64 | bc 01 Rx Ry __ __ __ __ | Convert 64-bits in Ry to 64-bit float; keeps sign, places result in Rx |
f_to_f
Floating point to floating point conversion
Name | Encoding | Description |
---|---|---|
f32_to_f64 | bd 01 Rx Ry __ __ __ __ | Convert 32-bit float in Ry to 64-bit float; places the result in Rx |
f64_to_f32 | be 01 Rx Ry __ __ __ __ | Convert 64-bit float in Ry to 32-bit float; places the result in Rx |