Compaq ECQD2KCTE Laptop User Manual


 
Instruction Descriptions 4–113
4.10.8 IEEE Floating Compare
Format:
Operation:
IF Fav SIGNED_RELATION Fbv THEN
Fc 4000 0000 0000 0000
16
ELSE
Fc 0000 0000 0000 0000
16
Exceptions:
Instruction mnemonics:
Qualifiers:
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.
CMPTyy Fa.rx,Fb.rx,Fc.wq
!Floating-point Operate format
Invalid Operation
CMPTEQ Compare T_floating Equal
CMPTLE Compare T_floating Less Than or Equal
CMPTLT Compare T_floating Less Than
CMPTUN Compare T_floating Unordered
Trapping: Exception Completion (/SU)