summaryrefslogtreecommitdiffstats
path: root/StdLib/LibC/Softfloat/Arm
diff options
context:
space:
mode:
authorNetBSD project <NetBSD project>2015-07-30 09:50:51 +0000
committerlersek <lersek@Edk2>2015-07-30 09:50:51 +0000
commit3352b62bebfd1e5c2e9961f481df968ab317d78d (patch)
tree12bfd6162cefbb63fa6e26c9fc9b7c9526838d9d /StdLib/LibC/Softfloat/Arm
parentb393333538ee3a6b16a3a1d25ab2372942c3aac7 (diff)
downloadedk2-3352b62bebfd1e5c2e9961f481df968ab317d78d.tar.gz
edk2-3352b62bebfd1e5c2e9961f481df968ab317d78d.tar.bz2
edk2-3352b62bebfd1e5c2e9961f481df968ab317d78d.zip
StdLib/LibC: Add software floating point library from NetBSD
Floating point processing is not supported on ARM for UEFI. In order to support UEFI applications in AppPkg we use this library to provide the required functionality. Changes as compared to the NetBSD version: - Formatting changes (tabs to spaces, DOS line endings etc). - Disable exceptions as described in the float_raise() function. - Disable definition of 'Symbolic Boolean literals' in milieu.h. Source originally from: NetBSD project - Source: http://cvsweb.netbsd.org/bsdweb.cgi/?only_with_tag=MAIN - Licensing and Copyright: http://www.netbsd.org/about/redistribution.html Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel <Harry.Liebel@arm.com> Reviewed-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18116 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC/Softfloat/Arm')
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_dcmpeq.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_dcmpge.c35
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_dcmpgt.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_dcmple.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_dcmplt.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_dcmpun.c42
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_fcmpeq.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_fcmpge.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_fcmpgt.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_fcmple.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_fcmplt.c37
-rw-r--r--StdLib/LibC/Softfloat/Arm/__aeabi_fcmpun.c42
12 files changed, 452 insertions, 0 deletions
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpeq.c b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpeq.c
new file mode 100644
index 0000000000..8bde7a5489
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpeq.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_dcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+int __aeabi_dcmpeq(float64, float64);
+
+int
+__aeabi_dcmpeq(float64 a, float64 b)
+{
+
+ return float64_eq(a, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpge.c b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpge.c
new file mode 100644
index 0000000000..c153feb6a8
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpge.c
@@ -0,0 +1,35 @@
+/* $NetBSD: __aeabi_dcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmpge(float64, float64);
+
+int
+__aeabi_dcmpge(float64 a, float64 b)
+{
+
+ return !float64_lt(a, b) && float64_eq(a, a) && float64_eq(b, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpgt.c b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpgt.c
new file mode 100644
index 0000000000..5fb1606697
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpgt.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_dcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmpgt(float64, float64);
+
+int
+__aeabi_dcmpgt(float64 a, float64 b)
+{
+
+ return !float64_le(a, b) && float64_eq(a, a) && float64_eq(b, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_dcmple.c b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmple.c
new file mode 100644
index 0000000000..a8327c5e5b
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmple.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_dcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmple(float64, float64);
+
+int
+__aeabi_dcmple(float64 a, float64 b)
+{
+
+ return float64_le(a, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_dcmplt.c b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmplt.c
new file mode 100644
index 0000000000..8d0e143cb4
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmplt.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_dcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmplt(float64, float64);
+
+int
+__aeabi_dcmplt(float64 a, float64 b)
+{
+
+ return float64_lt(a, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpun.c b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpun.c
new file mode 100644
index 0000000000..fa91120a6c
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_dcmpun.c
@@ -0,0 +1,42 @@
+/* $NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Richard Earnshaw, 2003. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmpun(float64, float64);
+
+int
+__aeabi_dcmpun(float64 a, float64 b)
+{
+ /*
+ * The comparison is unordered if either input is a NaN.
+ * Test for this by comparing each operand with itself.
+ * We must perform both comparisons to correctly check for
+ * signalling NaNs.
+ */
+ return !float64_eq(a, a) || !float64_eq(b, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpeq.c b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpeq.c
new file mode 100644
index 0000000000..83db09e6a4
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpeq.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_fcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_fcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+int __aeabi_fcmpeq(float32, float32);
+
+int
+__aeabi_fcmpeq(float32 a, float32 b)
+{
+
+ return float32_eq(a, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpge.c b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpge.c
new file mode 100644
index 0000000000..db59a98822
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpge.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_fcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_fcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_fcmpge(float32, float32);
+
+int
+__aeabi_fcmpge(float32 a, float32 b)
+{
+
+ return !float32_lt(a, b) && float32_eq(a, a) && float32_eq(b, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpgt.c b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpgt.c
new file mode 100644
index 0000000000..6d6dea6088
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpgt.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_fcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_fcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_fcmpgt(float32, float32);
+
+int
+__aeabi_fcmpgt(float32 a, float32 b)
+{
+
+ return !float32_le(a, b) && float32_eq(a, a) && float32_eq(b, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_fcmple.c b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmple.c
new file mode 100644
index 0000000000..84c0355e2e
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmple.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_fcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_fcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_fcmple(float32, float32);
+
+int
+__aeabi_fcmple(float32 a, float32 b)
+{
+
+ return float32_le(a, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_fcmplt.c b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmplt.c
new file mode 100644
index 0000000000..a421e8ce21
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmplt.c
@@ -0,0 +1,37 @@
+/* $NetBSD: __aeabi_fcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Ben Harris, 2000. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_fcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_fcmplt(float32, float32);
+
+int
+__aeabi_fcmplt(float32 a, float32 b)
+{
+
+ return float32_lt(a, b);
+}
diff --git a/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpun.c b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpun.c
new file mode 100644
index 0000000000..403afba17e
--- /dev/null
+++ b/StdLib/LibC/Softfloat/Arm/__aeabi_fcmpun.c
@@ -0,0 +1,42 @@
+/* $NetBSD: __aeabi_fcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/** @file
+*
+* Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+/*
+ * Written by Richard Earnshaw, 2003. This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_fcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_fcmpun(float32, float32);
+
+int
+__aeabi_fcmpun(float32 a, float32 b)
+{
+ /*
+ * The comparison is unordered if either input is a NaN.
+ * Test for this by comparing each operand with itself.
+ * We must perform both comparisons to correctly check for
+ * signalling NaNs.
+ */
+ return !float32_eq(a, a) || !float32_eq(b, b);
+}