td
Trap Doubleword
Traps if condition (comparison of doublewords) is met.
Details
Compares the 64-bit signed values in RA and RB according to the trap condition bits in TO. If the condition is true, a program interrupt (trap) is generated; otherwise execution continues. The TO field encodes five independent doubleword comparison conditions (less-than, greater-than, equal, unsigned less-than, unsigned greater-than).
Pseudocode Operation
if (TO[0] & (RA <s RB)) | (TO[1] & (RA >s RB)) | (TO[2] & (RA = RB)) | (TO[3] & (RA <u RB)) | (TO[4] & (RA >u RB)) then
Trap_Exception ← 1
else
Trap_Exception ← 0
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.
Example
Encoding
Operands
-
TO
Options -
RA
Src A -
RB
Src B