]> git.ipfire.org Git - thirdparty/gcc.git/blame - libdecnumber/decLibrary.c
* Makefile.in (decimal32.o): Prepend $(srcdir) to dependencies
[thirdparty/gcc.git] / libdecnumber / decLibrary.c
CommitLineData
e3f15eef 1/* Temporary library support for decimal floating point.
1bacb3df 2 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
e3f15eef 3
84d7eab9 4 This file is part of GCC.
e3f15eef 5
84d7eab9 6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
e3f15eef 10
79866451 11 In addition to the permissions in the GNU General Public License,
12 the Free Software Foundation gives you unlimited permission to link
13 the compiled version of this file into combinations with other
14 programs, and to distribute those combinations without any
15 restriction coming from the use of this file. (The General Public
16 License restrictions do apply in other respects; for example, they
17 cover modification of the file, and distribution when not linked
18 into a combine executable.)
19
84d7eab9 20 GCC is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 License for more details.
e3f15eef 24
84d7eab9 25 You should have received a copy of the GNU General Public License
26 along with GCC; see the file COPYING. If not, write to the Free
27 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
28 02110-1301, USA. */
e3f15eef 29
f98cf5a9 30#include "config.h"
e3f15eef 31#include "decContext.h"
32#include "decimal128.h"
33#include "decimal64.h"
34#include "decimal32.h"
35
36void __host_to_ieee_32 (_Decimal32, decimal32 *);
37void __host_to_ieee_64 (_Decimal64, decimal64 *);
38void __host_to_ieee_128 (_Decimal128, decimal128 *);
39
40extern int isinfd32 (_Decimal32);
41extern int isinfd64 (_Decimal64);
42extern int isinfd128 (_Decimal128);
7ef78c0e 43uint32_t __dec_byte_swap (uint32_t);
e3f15eef 44
45int
46isinfd32 (_Decimal32 arg)
47{
48 decNumber dn;
49 decimal32 d32;
50
51 __host_to_ieee_32 (arg, &d32);
52 decimal32ToNumber (&d32, &dn);
53 return (decNumberIsInfinite (&dn));
54}
55
56int
57isinfd64 (_Decimal64 arg)
58{
59 decNumber dn;
60 decimal64 d64;
61
62 __host_to_ieee_64 (arg, &d64);
63 decimal64ToNumber (&d64, &dn);
64 return (decNumberIsInfinite (&dn));
65}
66
67int
68isinfd128 (_Decimal128 arg)
69{
70 decNumber dn;
71 decimal128 d128;
72
73 __host_to_ieee_128 (arg, &d128);
74 decimal128ToNumber (&d128, &dn);
75 return (decNumberIsInfinite (&dn));
76}