tdi
Trap Doubleword Immediate
tdi TO, RA, SIM
Compares the contents of a register with an immediate value and invokes a trap handler if specified conditions are met.
Encoding
Binary Layout
000010
CRb
RA
SIMM
Operands
-
TO
Options -
RA
Src -
SIM
Imm -
SI
Sign-Extended Immediate Value -
CRb
Condition Register Field -
SIMM
Signed Immediate Value
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
The contents of register RA are compared with the sign-extended value of the SI field. If any bit in the TO field is set to 1 and its corresponding condition is met by the result of the comparison, the system trap handler is invoked.
Operation
a ← (RA)
b ← EXTS(SI)
if (a < b) & TO0 then TRAP
if (a > b) & TO1 then TRAP
if (a = b) & TO2 then TRAP
if (a <u b) & TO3 then TRAP
if (a >u b) & TO4 then TRAP
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
| tdge | |
| tdlnl | |
| tdnei |
Programming Note
Generates a program exception (System Call or Trap type) when the trap condition is true. The condition codes in TO select which comparisons trigger the trap: bit 0 = LT, bit 1 = GT, bit 2 = EQ, bit 3 = LU (unsigned), bit 4 = GU (unsigned). TO=31 (all bits set) always traps.