Datasheet
Floating-point Support
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-7
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
Function Argument types Result type Condition tested
_fcmpeq
2
float
Flags, EQ/NE
x equal to y
a
_fcmpge
2
float
Flags, HS/LO
x greater than or equal to y
a,b
_fcmple
2
float
Flags, HI/LS
x less than or equal to y
a,b
_feq
2
float
Boolean x equal to y
_fneq
2
float
Boolean x not equal to y
_fgeq
2
float
Boolean
x greater than or equal to y
b
_fgr
2
float
Boolean
x greater than y
b
_fleq
2
float
Boolean
x less than or equal to y
b
_fls
2
float
Boolean
x less than y
b
_dcmpeq
2
double
Flags, EQ/NE
x equal to y
a
_dcmpge
2
double
Flags, HS/LO
x greater than or equal to y
a,b
_dcmple
2
double
Flags, HI/LS
x less than or equal to y
a,b
_deq
2
double
Boolean x equal to y
_dneq
2
double
Boolean x not equal to y
_dgeq
2
double
Boolean
x greater than or equal to y
b
_dgr
2
double
Boolean
x greater than y
b
_dleq
2
double
Boolean
x less than or equal to y
b
_dls
2
double
Boolean
x less than y
b
a. 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
.
b. 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).