Commit | Line | Data |
---|---|---|
f5bc1778 | 1 | /* decDouble module for the decNumber C Library. |
0f5f799a | 2 | Copyright (C) 2007-2013 Free Software Foundation, Inc. |
f5bc1778 DJ |
3 | Contributed by IBM Corporation. Author Mike Cowlishaw. |
4 | ||
5 | This file is part of GCC. | |
6 | ||
7 | GCC is free software; you can redistribute it and/or modify it under | |
8 | the terms of the GNU General Public License as published by the Free | |
168a2f77 | 9 | Software Foundation; either version 3, or (at your option) any later |
f5bc1778 DJ |
10 | version. |
11 | ||
f5bc1778 DJ |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
16 | ||
168a2f77 DD |
17 | Under Section 7 of GPL version 3, you are granted additional |
18 | permissions described in the GCC Runtime Library Exception, version | |
19 | 3.1, as published by the Free Software Foundation. | |
20 | ||
21 | You should have received a copy of the GNU General Public License and | |
22 | a copy of the GCC Runtime Library Exception along with this program; | |
23 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
24 | <http://www.gnu.org/licenses/>. */ | |
f5bc1778 DJ |
25 | |
26 | /* ------------------------------------------------------------------ */ | |
27 | /* decDouble.c -- decDouble operations module */ | |
28 | /* ------------------------------------------------------------------ */ | |
29 | /* This module comprises decDouble operations (including conversions) */ | |
30 | /* ------------------------------------------------------------------ */ | |
31 | ||
87d32bb7 | 32 | #include "decContext.h" /* public includes */ |
f5bc1778 DJ |
33 | #include "decDouble.h" /* .. */ |
34 | ||
35 | /* Constant mappings for shared code */ | |
87d32bb7 DD |
36 | #define DECPMAX DECDOUBLE_Pmax |
37 | #define DECEMIN DECDOUBLE_Emin | |
38 | #define DECEMAX DECDOUBLE_Emax | |
f5bc1778 DJ |
39 | #define DECEMAXD DECDOUBLE_EmaxD |
40 | #define DECBYTES DECDOUBLE_Bytes | |
41 | #define DECSTRING DECDOUBLE_String | |
42 | #define DECECONL DECDOUBLE_EconL | |
87d32bb7 DD |
43 | #define DECBIAS DECDOUBLE_Bias |
44 | #define DECLETS DECDOUBLE_Declets | |
f5bc1778 DJ |
45 | #define DECQTINY (-DECDOUBLE_Bias) |
46 | /* parameters of next-wider format */ | |
47 | #define DECWBYTES DECQUAD_Bytes | |
48 | #define DECWPMAX DECQUAD_Pmax | |
49 | #define DECWECONL DECQUAD_EconL | |
50 | #define DECWBIAS DECQUAD_Bias | |
51 | ||
52 | /* Type and function mappings for shared code */ | |
87d32bb7 DD |
53 | #define decFloat decDouble /* Type name */ |
54 | #define decFloatWider decQuad /* Type name */ | |
f5bc1778 DJ |
55 | |
56 | /* Utilities and conversions (binary results, extractors, etc.) */ | |
87d32bb7 DD |
57 | #define decFloatFromBCD decDoubleFromBCD |
58 | #define decFloatFromInt32 decDoubleFromInt32 | |
59 | #define decFloatFromPacked decDoubleFromPacked | |
60 | #define decFloatFromPackedChecked decDoubleFromPackedChecked | |
61 | #define decFloatFromString decDoubleFromString | |
62 | #define decFloatFromUInt32 decDoubleFromUInt32 | |
63 | #define decFloatFromWider decDoubleFromWider | |
64 | #define decFloatGetCoefficient decDoubleGetCoefficient | |
65 | #define decFloatGetExponent decDoubleGetExponent | |
66 | #define decFloatSetCoefficient decDoubleSetCoefficient | |
67 | #define decFloatSetExponent decDoubleSetExponent | |
68 | #define decFloatShow decDoubleShow | |
69 | #define decFloatToBCD decDoubleToBCD | |
70 | #define decFloatToEngString decDoubleToEngString | |
71 | #define decFloatToInt32 decDoubleToInt32 | |
72 | #define decFloatToInt32Exact decDoubleToInt32Exact | |
73 | #define decFloatToPacked decDoubleToPacked | |
74 | #define decFloatToString decDoubleToString | |
75 | #define decFloatToUInt32 decDoubleToUInt32 | |
76 | #define decFloatToUInt32Exact decDoubleToUInt32Exact | |
77 | #define decFloatToWider decDoubleToWider | |
78 | #define decFloatZero decDoubleZero | |
f5bc1778 DJ |
79 | |
80 | /* Computational (result is a decFloat) */ | |
87d32bb7 DD |
81 | #define decFloatAbs decDoubleAbs |
82 | #define decFloatAdd decDoubleAdd | |
83 | #define decFloatAnd decDoubleAnd | |
84 | #define decFloatDivide decDoubleDivide | |
85 | #define decFloatDivideInteger decDoubleDivideInteger | |
86 | #define decFloatFMA decDoubleFMA | |
87 | #define decFloatInvert decDoubleInvert | |
88 | #define decFloatLogB decDoubleLogB | |
89 | #define decFloatMax decDoubleMax | |
90 | #define decFloatMaxMag decDoubleMaxMag | |
91 | #define decFloatMin decDoubleMin | |
92 | #define decFloatMinMag decDoubleMinMag | |
93 | #define decFloatMinus decDoubleMinus | |
94 | #define decFloatMultiply decDoubleMultiply | |
95 | #define decFloatNextMinus decDoubleNextMinus | |
96 | #define decFloatNextPlus decDoubleNextPlus | |
97 | #define decFloatNextToward decDoubleNextToward | |
98 | #define decFloatOr decDoubleOr | |
99 | #define decFloatPlus decDoublePlus | |
100 | #define decFloatQuantize decDoubleQuantize | |
101 | #define decFloatReduce decDoubleReduce | |
102 | #define decFloatRemainder decDoubleRemainder | |
103 | #define decFloatRemainderNear decDoubleRemainderNear | |
104 | #define decFloatRotate decDoubleRotate | |
105 | #define decFloatScaleB decDoubleScaleB | |
106 | #define decFloatShift decDoubleShift | |
107 | #define decFloatSubtract decDoubleSubtract | |
108 | #define decFloatToIntegralValue decDoubleToIntegralValue | |
109 | #define decFloatToIntegralExact decDoubleToIntegralExact | |
110 | #define decFloatXor decDoubleXor | |
f5bc1778 DJ |
111 | |
112 | /* Comparisons */ | |
87d32bb7 DD |
113 | #define decFloatCompare decDoubleCompare |
114 | #define decFloatCompareSignal decDoubleCompareSignal | |
115 | #define decFloatCompareTotal decDoubleCompareTotal | |
116 | #define decFloatCompareTotalMag decDoubleCompareTotalMag | |
f5bc1778 DJ |
117 | |
118 | /* Copies */ | |
87d32bb7 DD |
119 | #define decFloatCanonical decDoubleCanonical |
120 | #define decFloatCopy decDoubleCopy | |
121 | #define decFloatCopyAbs decDoubleCopyAbs | |
122 | #define decFloatCopyNegate decDoubleCopyNegate | |
123 | #define decFloatCopySign decDoubleCopySign | |
f5bc1778 DJ |
124 | |
125 | /* Non-computational */ | |
87d32bb7 DD |
126 | #define decFloatClass decDoubleClass |
127 | #define decFloatClassString decDoubleClassString | |
128 | #define decFloatDigits decDoubleDigits | |
129 | #define decFloatIsCanonical decDoubleIsCanonical | |
130 | #define decFloatIsFinite decDoubleIsFinite | |
131 | #define decFloatIsInfinite decDoubleIsInfinite | |
132 | #define decFloatIsInteger decDoubleIsInteger | |
133 | #define decFloatIsNaN decDoubleIsNaN | |
134 | #define decFloatIsNormal decDoubleIsNormal | |
135 | #define decFloatIsSignaling decDoubleIsSignaling | |
136 | #define decFloatIsSignalling decDoubleIsSignalling | |
137 | #define decFloatIsSigned decDoubleIsSigned | |
138 | #define decFloatIsSubnormal decDoubleIsSubnormal | |
139 | #define decFloatIsZero decDoubleIsZero | |
140 | #define decFloatRadix decDoubleRadix | |
141 | #define decFloatSameQuantum decDoubleSameQuantum | |
142 | #define decFloatVersion decDoubleVersion | |
f5bc1778 DJ |
143 | |
144 | #include "decNumberLocal.h" /* local includes (need DECPMAX) */ | |
145 | #include "decCommon.c" /* non-arithmetic decFloat routines */ | |
146 | #include "decBasic.c" /* basic formats routines */ | |
147 |