R

Chapter 4: MicroBlaze Instruction Set Architecture

fcmp

Floating Point Number Comparison

fcmp.un

rD, rA, rB

Unordered floating point comparison

fcmp.lt

rD, rA, rB

Less-than floating point comparison

fcmp.eq

rD, rA, rB

Equal floating point comparison

fcmp.le

rD, rA, rB

Less-or-Equal floating point comparison

fcmp.gt

rD, rA, rB

Greater-than floating point comparison

fcmp.ne

rD, rA, rB

Not-Equal floating point comparison

fcmp.ge

rD, rA, rB

Greater-or-Equal floating point comparison

0 1 0 1 1 0

rD

rA

rB

0 1 0 0

OpSel

0 0 0 0

0

6

11

16

21

25

28

31

Description

The floating point value in rB is compared with the floating point value in rA and the comparison result is placed into register rD. The OpSel field in the instruction code determines the type of comparison performed.

Pseudocode

if isDnz(rA) or isDnz(rB) then (rD) 0

FSR[DO] 1 ESR[EC] 00110

else

{read out behavior from Table 4-2}

Table 4-2:Floating Point Comparison Operation

Comparison Type

 

 

 

Operand Relationship

 

 

 

 

 

 

 

 

Description

OpSel

(rB) > (rA)

(rB) < (rA)

(rB) = (rA)

isNaN(rA) or isNaN(rB)

 

 

 

 

 

 

 

 

 

 

 

Unordered

000

(rD)

0

(rD)

0

(rD)

0

(rD)

1

 

 

 

 

 

 

 

 

 

 

 

 

Less-than

001

(rD)

0

(rD)

1

(rD)

0

(rD)

0

 

 

 

 

 

 

 

 

 

FSR[IO]

1

 

 

 

 

 

 

 

 

ESR[EC]

00110

 

 

 

 

 

 

 

 

 

 

 

Equal

010

(rD)

0

(rD)

0

(rD)

1

(rD)

0

 

 

 

 

 

 

 

 

 

 

 

 

Less-or-equal

011

(rD)

0

(rD)

1

(rD)

1

(rD)

0

 

 

 

 

 

 

 

 

 

FSR[IO]

1

 

 

 

 

 

 

 

 

ESR[EC]

00110

 

 

 

 

 

 

 

 

 

 

 

104

www.xilinx.com

MicroBlaze Processor Reference Guide

 

1-800-255-7778

UG081 (v6.0) June 1, 2006

Page 104
Image 104
Xilinx EDK 8.2i manual Fcmp