Compaq ECQD2KCTE manual Ieee Floating Compare, Cmpteq, Cmptle, Cmptlt, Cmptun

Models: ECQD2KCTE

1 371
Download 371 pages 20.35 Kb
Page 169
Image 169

4.10.8 IEEE Floating Compare

Format:

CMPTyy

Fa.rx,Fb.rx,Fc.wq

!Floating-point Operate format

Operation:

IF Fav SIGNED_RELATION Fbv THEN

Fc 4000 0000 0000 000016

ELSE

Fc 0000 0000 0000 000016

Exceptions:

Invalid Operation

Instruction mnemonics:

CMPTEQ

Compare T_floating Equal

CMPTLE

Compare T_floating Less Than or Equal

CMPTLT

Compare T_floating Less Than

CMPTUN

Compare T_floating Unordered

Qualifiers:

Trapping:

Exception Completion (/SU)

Description:

The two operands in Fa and Fb are compared. If the relationship specified by the qualifier is true, a non-zero floating value (2.0) is written to register Fc; otherwise, a true zero is written to Fc.

Comparisons are exact and never overflow or underflow. Four mutually exclusive relations are possible: less than, equal, greater than, and unordered. The unordered relation is true if one or both operands are NaN. (This behavior must be provided by an operating system (OS) comple- tion handler, since NaNs trap.) Comparisons ignore the sign of zero, so +0 = –0.

Comparisons with plus and minus infinity execute normally and do not take an invalid operation trap.

Notes:

In order to use CMPTxx with exception completion handling, it is necessary to specify the /SU IEEE trap mode, even though an underflow trap is not possible.

Compare Less Than A,B is the same as Compare Greater Than B,A; Compare Less Than or Equal A,B is the same as Compare Greater Than or Equal B,A. Therefore, only the less-than operations are included.

Instruction Descriptions 4–113

Page 169
Image 169
Compaq ECQD2KCTE manual Ieee Floating Compare, Cmpteq, Cmptle, Cmptlt, Cmptun