1 /* Temporary library support for decimal floating point.
2 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4 This file is part of GCC.
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)
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 #include "decContext.h"
23 #include "decimal128.h"
24 #include "decimal64.h"
25 #include "decimal32.h"
27 void __host_to_ieee_32 (_Decimal32
, decimal32
*);
28 void __host_to_ieee_64 (_Decimal64
, decimal64
*);
29 void __host_to_ieee_128 (_Decimal128
, decimal128
*);
31 extern int isinfd32 (_Decimal32
);
32 extern int isinfd64 (_Decimal64
);
33 extern int isinfd128 (_Decimal128
);
34 uint32_t __dec_byte_swap (uint32_t);
37 isinfd32 (_Decimal32 arg
)
42 __host_to_ieee_32 (arg
, &d32
);
43 decimal32ToNumber (&d32
, &dn
);
44 return (decNumberIsInfinite (&dn
));
48 isinfd64 (_Decimal64 arg
)
53 __host_to_ieee_64 (arg
, &d64
);
54 decimal64ToNumber (&d64
, &dn
);
55 return (decNumberIsInfinite (&dn
));
59 isinfd128 (_Decimal128 arg
)
64 __host_to_ieee_128 (arg
, &d128
);
65 decimal128ToNumber (&d128
, &dn
);
66 return (decNumberIsInfinite (&dn
));
70 __dec_byte_swap (uint32_t in
)
73 unsigned char *p
= (unsigned char *) &out
;