summaryrefslogtreecommitdiffstats
path: root/lib/libc/arm/aeabi/aeabi_float.c
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2014-10-22 13:50:38 +0000
committerandrew <andrew@FreeBSD.org>2014-10-22 13:50:38 +0000
commit58b9da93f03431d6fcab3cd00dd912dbb9b13e20 (patch)
tree6bd00b106ee88f162bf7d09fc60afd27155dd062 /lib/libc/arm/aeabi/aeabi_float.c
parenteb3582e16fc01e7c3e10471374605153ea6bd1f2 (diff)
downloadFreeBSD-src-58b9da93f03431d6fcab3cd00dd912dbb9b13e20.zip
FreeBSD-src-58b9da93f03431d6fcab3cd00dd912dbb9b13e20.tar.gz
MFC r273088:
Add support for the __aeabi_c*cmp* functions. These are similar to the existing functions with the exception they use the condition flags to store the result.
Diffstat (limited to 'lib/libc/arm/aeabi/aeabi_float.c')
-rw-r--r--lib/libc/arm/aeabi/aeabi_float.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/libc/arm/aeabi/aeabi_float.c b/lib/libc/arm/aeabi/aeabi_float.c
index be7a6d6..2e93594 100644
--- a/lib/libc/arm/aeabi/aeabi_float.c
+++ b/lib/libc/arm/aeabi/aeabi_float.c
@@ -74,3 +74,28 @@ float32 AEABI_FUNC2(fdiv, float32, float32_div)
float32 AEABI_FUNC2(fmul, float32, float32_mul)
float32 AEABI_FUNC2(fsub, float32, float32_sub)
+int
+__aeabi_cfcmpeq_helper(float32 a, float32 b)
+{
+ int quiet = 0;
+
+ /* Check if a is a NaN */
+ if ((a << 1) > 0xff000000u) {
+ /* If it's a signalling NaN we will always signal */
+ if ((a & 0x00400000u) == 0)
+ return (0);
+
+ quiet = 1;
+ }
+
+ /* Check if b is a NaN */
+ if ((b << 1) > 0xff000000u) {
+ /* If it's a signalling NaN we will always signal */
+ if ((b & 0x00400000u) == 0)
+ return (0);
+
+ quiet = 1;
+ }
+
+ return (quiet);
+}
OpenPOWER on IntegriCloud