quadlib.c revision 90075
190075Sobrien/* Subroutines for long double support.
290075Sobrien   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
390075Sobrien
490075SobrienThis file is part of GNU CC.
590075Sobrien
690075SobrienGNU CC is free software; you can redistribute it and/or modify
790075Sobrienit under the terms of the GNU General Public License as published by
890075Sobrienthe Free Software Foundation; either version 2, or (at your option)
990075Sobrienany later version.
1090075Sobrien
1190075SobrienIn addition to the permissions in the GNU General Public License, the
1290075SobrienFree Software Foundation gives you unlimited permission to link the
1390075Sobriencompiled version of this file into combinations with other programs,
1490075Sobrienand to distribute those combinations without any restriction coming
1590075Sobrienfrom the use of this file.  (The General Public License restrictions
1690075Sobriendo apply in other respects; for example, they cover modification of
1790075Sobrienthe file, and distribution when not linked into a combine
1890075Sobrienexecutable.)
1990075Sobrien
2090075SobrienGNU CC is distributed in the hope that it will be useful,
2190075Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
2290075SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2390075SobrienGNU General Public License for more details.
2490075Sobrien
2590075SobrienYou should have received a copy of the GNU General Public License
2690075Sobrienalong with GNU CC; see the file COPYING.  If not, write to
2790075Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330,
2890075SobrienBoston, MA 02111-1307, USA.  */
2990075Sobrien
3090075Sobrienint _U_Qfcmp (long double a, long double b, int);
3190075Sobrienlong _U_Qfcnvfxt_quad_to_sgl (long double);
3290075Sobrien
3390075Sobrienint
3490075Sobrien_U_Qfeq (long double a, long double b)
3590075Sobrien{
3690075Sobrien  return (_U_Qfcmp (a, b, 4) != 0);
3790075Sobrien}
3890075Sobrien
3990075Sobrienint
4090075Sobrien_U_Qfne (long double a, long double b)
4190075Sobrien{
4290075Sobrien  return (_U_Qfcmp (a, b, 4) == 0);
4390075Sobrien}
4490075Sobrien
4590075Sobrienint
4690075Sobrien_U_Qfgt (long double a, long double b)
4790075Sobrien{
4890075Sobrien  return (_U_Qfcmp (a, b, 17) != 0);
4990075Sobrien}
5090075Sobrien
5190075Sobrienint
5290075Sobrien_U_Qfge (long double a, long double b)
5390075Sobrien{
5490075Sobrien  return (_U_Qfcmp (a, b, 21) != 0);
5590075Sobrien}
5690075Sobrien
5790075Sobrienint
5890075Sobrien_U_Qflt (long double a, long double b)
5990075Sobrien{
6090075Sobrien  return (_U_Qfcmp (a, b, 9) != 0);
6190075Sobrien}
6290075Sobrien
6390075Sobrienint
6490075Sobrien_U_Qfle (long double a, long double b)
6590075Sobrien{
6690075Sobrien  return (_U_Qfcmp (a, b, 13) != 0);
6790075Sobrien}
6890075Sobrien
6990075Sobrienint
7090075Sobrien_U_Qfcomp (long double a, long double b)
7190075Sobrien{
7290075Sobrien  if (_U_Qfcmp (a, b, 4) == 0)
7390075Sobrien    return 0;
7490075Sobrien
7590075Sobrien  return (_U_Qfcmp (a, b, 22) != 0 ? 1 : -1);
7690075Sobrien}
7790075Sobrien
7890075Sobrienlong double
7990075Sobrien_U_Qfneg (long double a)
8090075Sobrien{
8190075Sobrien  return (0.0L - a);
8290075Sobrien}
83