5.2.4. Floating-point comparisons

The routines in Table 5.4 perform comparisons between floating-point numbers.

Table 5.4. Floating-point comparison routines

FunctionArgument typesResult typeCondition tested
_fcmpeq2 floatFlags, EQ/NEx equal to y[1]
_fcmpge2 floatFlags, HS/LOx greater than or equal to ya,[2]
_fcmple2 floatFlags, HI/LSx less than or equal to ya,b
_feq2 floatBooleanx equal to y
_fneq2 floatBooleanx not equal to y
_fgeq2 floatBooleanx greater than or equal to yb
_fgr2 floatBooleanx greater than yb
_fleq2 floatBooleanx less than or equal to yb
_fls2 floatBooleanx less than yb
_dcmpeq2 doubleFlags, EQ/NEx equal to ya
_dcmpge2 doubleFlags, HS/LOx greater than or equal to ya,b
_dcmple2 doubleFlags, HI/LSx less than or equal to ya,b
_deq2 doubleBooleanx equal to y
_dneq2 doubleBooleanx not equal to y
_dgeq2 doubleBooleanx greater than or equal to yb
_dgr2 doubleBooleanx greater than yb
_dleq2 doubleBooleanx less than or equal to yb
_dls2 doubleBooleanx less than yb

[1] Returns results in the ARM condition flags. This is efficient in assembly language, because you can directly follow a call to the function with a conditional instruction, but it means there is no way to use these functions from C. These functions are not declared in rt_fp.h.

[2] Causes an Invalid Operation exception if either argument is a NaN, even a quiet NaN. Other functions only cause Invalid Operation if an argument is an SNaN. QNaNs return not equal when compared to anything, including other QNaNs (so comparing a QNaN to the same QNaN still returns not equal).

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D
Non-Confidential