Instructions

cmp

Integer Compare

 

 

cmp

rD, rA, rB

compare rB with rA (signed)

 

cmpu

rD, rA, rB

compare rB with rA (unsigned)

R

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

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.

MicroBlaze Processor Reference Guide

www.xilinx.com

99

UG081 (v6.0) June 1, 2006

1-800-255-7778

 

Page 99
Image 99
Xilinx EDK 8.2i manual Integer Compare Cmp, Cmpu