cmpl
Compare Logical
Compares two registers as unsigned integers.
Details
Performs an unsigned logical comparison between RA and RB, with L determining the operand size (L=0 for 32-bit, L=1 for 64-bit). The comparison result is written to condition register field BF. The comparison sets the LT, GT, or EQ bits in the target CR field based on whether RA is less than, greater than, or equal to RB when interpreted as unsigned integers. This Base category instruction affects only the specified condition register field, not CR0.
Pseudocode Operation
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
// Unsigned compare of r3 vs r4.
Encoding
Operands
-
BF
Condition Register Field -
L
Size (0=32-bit, 1=64-bit) -
RA
Source Register 1 -
RB
Source Register 2