FCMP

Floating-point comparison

FCMP

Floating-point CoMPare


[Syntax]

src2 - src;

 

[Operation]

src2 - src;

 

[Function]

-

This instruction compares the single-precision floating numbers stored in src2 and src and changes the states of flags according to the result.

-

Handling of denormalized numbers depends on the setting of the DN bit in the FPSW.

 

[Instruction Format]

Syntax

Processng Size

Operand

Code Size

(Byte)

src

src2

FCMP src, src2

L

#IMM:32

Rs2

7

L

Rs

Rs2

3

L

[Rs].L

Rs2

3

L

dsp:8[Rs].L

Rs2

4

L

dsp:16[Rs].L

Rs2

5

[Flag Change]

Flag

C

Z

S

O

CV

CO

CZ

CU

CX

CE

FV

FO

FZ

FU

FX

Change

 

 

 

 

 

 

 

 

 

 

Conditions

Z : The flag is set if src2 == src; otherwise it is cleared.

S : The flag is set if src2 < src; otherwise it is cleared.

O : The flag is set if an ordered classification based on the comparison result is impossible; otherwise it is cleared.

CV : The flag is set if an invalid operation exception is generated; otherwise it is cleared.

CO : The value of the flag is always 0.

CZ : The value of the flag is always 0.

CU : The value of the flag is always 0.

CX : The value of the flag is always 0.

CE : The flag is set if an unimplemented processing exception is generated; otherwise it is cleared.

FV : The flag is set if an invalid operation exception is generated; otherwise it does not change.

Note

The FV flag does not change if the exception enable bit EV is 1. The O, S, and Z flags do not change when an exception is generated.

 

[Description Example]

FCMP R1, R2

FCMP [R1], R2