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