Example
cmplei 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
cmplei
stores 1 to rB; otherwise stores 0 to rB.
Usage
cmplei
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
cmplei
is implemented using a
cmplti
instruction with an
IMM16 immediate value of IMMED + 1.
8.5.33. cmpleu
Instruction
compare less than or equal unsigned
Operation
if ((unsigned) rA < (unsigned) rB)
then rC ← 1
else rC ← 0
Assembler Syntax
cmpleu rC, rA, rB
Example
cmpleu r6, r7, r8
Description
If rA <= rB, then stores 1 to rC; otherwise stores 0 to rC.
Usage
cmpleu
performs the unsigned <= operation of the C
programming language.
Pseudo-instruction
cmpleu
is implemented with the
cmpgeu
instruction by
swapping its rA and rB operands.
8.5.34. cmpleui
Instruction
compare less than or equal unsigned immediate
Operation
if ((unsigned) rA <= (unsigned) IMMED)
then rB ← 1
else rB ← 0
Assembler Syntax
cmpleui rB, rA, IMMED
Example
cmpleui 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
cmpleui
stores 1 to rB; otherwise stores 0 to rB.
Usage
cmpleui
performs the unsigned <= operation of the C
programming language. The maximum allowed value of
IMMED is 65534. The minimum allowed value is 0.
Pseudo-instruction
cmpleui
is implemented using a
cmpltui
instruction with
an IMM16 immediate value of IMMED + 1.
8.5.35. cmplt
Instruction
compare less than signed
Operation
if ((signed) rA < (signed) rB)
then rC ← 1
else rC ← 0
continued...
8. Instruction Set Reference
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
191