CMPGT(U)
Signed or Unsigned Integer Compare for Greater Than
3-54
Description
This instruction does a signed or unsigned comparison of
src1 to src2. If src1
is greater than
src2, then 1 is written to dst. Otherwise, 0 is written to dst. Only
the four LSBs are valid in the 5-bit
cst field when the ucst4 operand is used.
If the MSB of the
cst field is non-zero, the result is invalid.
Execution
if (cond)
{
if (
src1
>
src2) 1
→
dst
else 0
→
dst
}
else
nop
Pipeline
Stage
E1
Read
src1, src2
Written
dst
Unit in use
.L
Instruction Type
Single-cycle
Delay Slots
0
Example 1
CMPGT .L1X A1,B1,A2
Before instruction
1 cycle after instruction
A1
0000 01B6h
438
A1
0000 01B6h
A2
XXXX XXXXh
A2
0000 0000h
false
B1
0000 08BDh
2237
B1
0000 08BDh
Example 2
CMPGT .L1X A1,B1,A2
Before instruction
1 cycle after instruction
A1
FFFF FE91h
–367
A1
FFFF FE91h
A2
XXXX XXXXh
A2
0000 0001h
true
B1
FFFF FDC4h
–572
B1
FFFF FDC4h
Example 3
CMPGT .L1
8,A1,A2
Before instruction
1 cycle after instruction
A1
0000 0023h
35
A1
0000 0023h
A2
XXXX XXXXh
A2
0000 0000h
false
Pipeline