00001 /* Lightweight function to test for ieee unordered comparison 00002 Copyright (C) 2002 00003 Free Software Foundation, Inc. 00004 Contributed by Ian Dall <ian@beware.dropbear.id.au> 00005 00006 This file is part of GCC. 00007 00008 GCC is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2, or (at your option) 00011 any later version. 00012 00013 GCC is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with GCC; see the file COPYING. If not, write to 00020 the Free Software Foundation, 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. */ 00022 00023 # define ISNAN(x) ( \ 00024 { \ 00025 union u { double d; unsigned int i[2]; } *t = (union u *)&(x); \ 00026 ((t->i[1] & 0x7ff00000) == 0x7ff00000) && \ 00027 (t->i[0] != 0 || (t->i[1] & 0xfffff) != 0); \ 00028 }) 00029 00030 int __unorddf2 (double, double); 00031 int __unorddf2 (double a, double b) 00032 { 00033 return ISNAN(a) || ISNAN(b); 00034 }
1.5.6