![Intel NIOS II Owner Reference Manual Download Page 189](http://html1.mh-extra.com/html/intel/nios-ii/nios-ii_owner-reference-manual_2071826189.webp)
Bit Fields
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
A
B
IMM16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
IMM16
0x28
8.5.27. cmpgt
Instruction
compare greater than signed
Operation
if ((signed) rA > (signed) rB)
then rC ← 1
else rC ← 0
Assembler Syntax
cmpgt rC, rA, rB
Example
cmpgt r6, r7, r8
Description
If rA > rB, then stores 1 to rC; otherwise stores 0 to rC.
Usage
cmpgt
performs the signed > operation of the C
programming language.
Pseudo-instruction
cmpgt
is implemented with the
cmplt
instruction by
swapping its rA and rB operands.
8.5.28. cmpgti
Instruction
compare greater than signed immediate
Operation
if ((signed) rA > (signed) IMMED)
then rB ← 1
else rB ← 0
Assembler Syntax
cmpgti rB, rA, IMMED
Example
cmpgti r6, r7, 100
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.
8.5.29. cmpgtu
Instruction
compare greater than unsigned
Operation
if ((unsigned) rA > (unsigned) rB)
then rC ← 1
else rC ← 0
Assembler Syntax
cmpgtu rC, rA, rB
continued...
8. Instruction Set Reference
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
189