Home | History | Annotate | Download | only in Arm
      1 /* $NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
      2 
      3 /** @file
      4 *
      5 *  Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
      6 *
      7 *  This program and the accompanying materials
      8 *  are licensed and made available under the terms and conditions of the BSD License
      9 *  which accompanies this distribution.  The full text of the license may be found at
     10 *  http://opensource.org/licenses/bsd-license.php
     11 *
     12 *  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     13 *  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     14 *
     15 **/
     16 
     17 /*
     18  * Written by Richard Earnshaw, 2003.  This file is in the Public Domain.
     19  */
     20 
     21 #include "softfloat-for-gcc.h"
     22 #include "milieu.h"
     23 #include "softfloat.h"
     24 
     25 #if defined(LIBC_SCCS) && !defined(lint)
     26 __RCSID("$NetBSD: __aeabi_dcmpun.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
     27 #endif /* LIBC_SCCS and not lint */
     28 
     29 int __aeabi_dcmpun(float64, float64);
     30 
     31 int
     32 __aeabi_dcmpun(float64 a, float64 b)
     33 {
     34     /*
     35      * The comparison is unordered if either input is a NaN.
     36      * Test for this by comparing each operand with itself.
     37      * We must perform both comparisons to correctly check for
     38      * signalling NaNs.
     39      */
     40     return !float64_eq(a, a) || !float64_eq(b, b);
     41 }
     42