cmpl

Compare Logical

cmpl BF, L, RA, RB

Compares two registers as unsigned integers.

Details

The cmpl instruction compares the contents of register RA with the contents of register RB using unsigned comparison. It sets one bit in the leftmost three bits of the designated CR field to 1, and the other two to 0 based on the result of the comparison.

Pseudocode Operation

if (RA) <u (RB) then CR[BF] <- LT...

Programming Note

Use cmpl for unsigned comparisons. Ensure registers RA and RB are properly aligned if they contain pointers or data structures. The instruction modifies the Condition Register (CR), so check the appropriate field after execution to determine the result of the comparison.

Example

cmpl cr1, 1, r3, r4

Encoding

Binary Layout
31
0
BF
6
/
9
L
10
RA
11
RB
16
0000100000
21
1
31
 
Format X-form
Opcode 0x7C000040
Extension Base
Registers Altered CR

Operands

  • BF
    Condition Register Field
  • L
    Size (0=32-bit, 1=64-bit)
  • RA
    Source Register 1
  • RB
    Source Register 2