Inc. Typewriter User Manual

MicroBlaze Processor Reference Guide www.xilinx.com 99
UG081 (v6.0) June 1, 2006 1-800-255-7778
Instructions
R
cmp
Integer Compare
Description
The contents of register rA is subtracted from the contents of register rB and the result is
placed into register rD.
The MSB bit of rD is adjusted to shown true relation between rA and rB. If the U bit is set,
rA and rB is considered unsigned values. If the U bit is clear, rA and rB is considered
signed values.
Pseudocode
(rD) (rB) + (rA) + 1
(rD)(MSB) (rA) > (rB)
Registers Altered
rD
Latency
1 cycle.
cmp
rD, rA, rB compare rB with rA (signed)
cmpu
rD, rA, rB compare rB with rA (unsigned)
0 0 0 1 0 1 rD rA rB 0 0 0 0 0 0 0 0 0 U 1
0 6 11 16 21 31