Specifications
Description
Sign-extends the immediate value IMMED to 32 bits and
compares it to the value of rA. If rA > σ(IMMED), then cmpgti
stores 1 to rB; otherwise stores 0 to rB.
Usage
cmpgti performs the signed > operation of the C programming
language. The maximum allowed value of IMMED is 32766.
The minimum allowed value is –32769.
Pseudo-instruction
cmpgti is implemented using a cmpgei instruction with an
IMM16 immediate value of IMMED + 1.
cmpgtu
Instruction
compare greater than unsigned
Operation
if ((unsigned) rA > (unsigned) rB)
then rC ← 1
else rC ← 0
Assembler Syntax
cmpgtu rC, rA, rB
Example
cmpgtu r6, r7, r8
Description
If rA > rB, then stores 1 to rC; otherwise stores 0 to rC.
Usage
cmpgtu performs the unsigned > operation of the C program‐
ming language.
Pseudo-instruction
cmpgtu is implemented with the cmpltu instruction by
swapping its rA and rB operands.
cmpgtui
Instruction
compare greater than unsigned immediate
Operation
if ((unsigned) rA > (unsigned) IMMED)
then rB ← 1
else rB ← 0
Assembler Syntax
cmpgtui rB, rA, IMMED
Example
cmpgtui r6, r7, 100
Description
Zero-extends the immediate value IMMED to 32 bits and
compares it to the value of rA. If rA > IMMED, then cmpgtui
stores 1 to rB; otherwise stores 0 to rB.
NII51017
2015.04.02
cmpgtu
8-27
Instruction Set Reference
Altera Corporation
Send Feedback