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 extern void __dfp_enable_traps (void);
35 extern void __dfp_raise (int exception
__attribute__ ((unused
)));
38 isinfd32 (_Decimal32 arg
)
43 __host_to_ieee_32 (arg
, &d32
);
44 decimal32ToNumber (&d32
, &dn
);
45 return (decNumberIsInfinite (&dn
));
49 isinfd64 (_Decimal64 arg
)
54 __host_to_ieee_64 (arg
, &d64
);
55 decimal64ToNumber (&d64
, &dn
);
56 return (decNumberIsInfinite (&dn
));
60 isinfd128 (_Decimal128 arg
)
65 __host_to_ieee_128 (arg
, &d128
);
66 decimal128ToNumber (&d128
, &dn
);
67 return (decNumberIsInfinite (&dn
));
73 __dfp_enable_traps (void)
79 __dfp_raise (int exception
__attribute__ ((unused
)))
85 __dec_byte_swap (uint32_t in
)
88 unsigned char *p
= (unsigned char *) &out
;