]>
Commit | Line | Data |
---|---|---|
6efd877d KR |
1 | /* flonum_const.c - Useful Flonum constants |
2 | Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GAS, the GNU Assembler. | |
5 | ||
6 | GAS is free software; you can redistribute it and/or modify | |
7 | it 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. | |
10 | ||
11 | GAS is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GAS; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | #include "flonum.h" | |
21 | /* JF: I added the last entry to this table, and I'm not | |
22 | sure if its right or not. Could go either way. I wish | |
23 | I really understood this stuff. */ | |
24 | ||
25 | ||
26 | const int table_size_of_flonum_powers_of_ten = 11; | |
27 | ||
28 | static const LITTLENUM_TYPE zero[] = | |
29 | {1}; | |
30 | ||
31 | /***********************************************************************\ | |
32 | * * | |
33 | * Warning: the low order bits may be WRONG here. * | |
34 | * I took this from a suspect bc(1) script. * | |
35 | * "minus_X"[] is supposed to be 10^(2^-X) expressed in base 2^16. * | |
36 | * The radix point is just AFTER the highest element of the [] * | |
37 | * * | |
38 | * Because bc rounds DOWN for printing (I think), the lowest * | |
39 | * significance littlenums should probably have 1 added to them. * | |
40 | * * | |
41 | \***********************************************************************/ | |
42 | ||
43 | /* JF: If this equals 6553/(2^16)+39321/(2^32)+... it approaches .1 */ | |
44 | static const LITTLENUM_TYPE minus_1[] = | |
45 | { | |
46 | 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, | |
47 | 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 6553}; | |
48 | static const LITTLENUM_TYPE plus_1[] = | |
49 | {10}; | |
50 | ||
51 | /* JF: If this equals 655/(2^16) + 23592/(2^32) + ... it approaches .01 */ | |
52 | static const LITTLENUM_TYPE minus_2[] = | |
53 | { | |
54 | 10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 49807, | |
55 | 10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 655}; | |
56 | static const LITTLENUM_TYPE plus_2[] = | |
57 | {100}; | |
58 | ||
59 | /* This approaches .0001 */ | |
60 | static const LITTLENUM_TYPE minus_3[] = | |
61 | { | |
62 | 52533, 20027, 37329, 65116, 64067, 60397, 14784, 18979, 33659, 19503, | |
63 | 2726, 9542, 629, 2202, 40475, 10590, 4299, 47815, 36280, 6}; | |
64 | static const LITTLENUM_TYPE plus_3[] = | |
65 | {10000}; | |
66 | ||
67 | /* JF: this approaches 1e-8 */ | |
68 | static const LITTLENUM_TYPE minus_4[] = | |
69 | { | |
70 | 22516, 49501, 54293, 19424, 60699, 6716, 24348, 22618, 23904, 21327, | |
71 | 3919, 44703, 19149, 28803, 48959, 6259, 50273, 62237, 42}; | |
72 | /* This equals 1525 * 2^16 + 57600 */ | |
73 | static const LITTLENUM_TYPE plus_4[] = | |
74 | {57600, 1525}; | |
75 | ||
76 | /* This approaches 1e-16 */ | |
77 | static const LITTLENUM_TYPE minus_5[] = | |
78 | { | |
79 | 22199, 45957, 17005, 26266, 10526, 16260, 55017, 35680, 40443, 19789, | |
80 | 17356, 30195, 55905, 28426, 63010, 44197, 1844}; | |
81 | static const LITTLENUM_TYPE plus_5[] = | |
82 | {28609, 34546, 35}; | |
83 | ||
84 | static const LITTLENUM_TYPE minus_6[] = | |
85 | { | |
86 | 30926, 26518, 13110, 43018, 54982, 48258, 24658, 15209, 63366, 11929, | |
87 | 20069, 43857, 60487, 51}; | |
88 | static const LITTLENUM_TYPE plus_6[] = | |
89 | {61313, 34220, 16731, 11629, 1262}; | |
90 | ||
91 | static const LITTLENUM_TYPE minus_7[] = | |
92 | { | |
93 | 29819, 14733, 21490, 40602, 31315, 65186, 2695}; | |
94 | static const LITTLENUM_TYPE plus_7[] = | |
95 | { | |
96 | 7937, 49002, 60772, 28216, 38893, 55975, 63988, 59711, 20227, 24}; | |
97 | ||
98 | static const LITTLENUM_TYPE minus_8[] = | |
99 | { | |
100 | 45849, 19069, 18068, 36324, 37948, 48745, 10873, 64360, 15961, 20566, | |
101 | 24178, 15922, 59427, 110}; | |
102 | static const LITTLENUM_TYPE plus_8[] = | |
103 | { | |
104 | 15873, 11925, 39177, 991, 14589, 19735, 25347, 65086, 53853, 938, | |
105 | 37209, 47086, 33626, 23253, 32586, 42547, 9731, 59679, 590}; | |
106 | ||
107 | static const LITTLENUM_TYPE minus_9[] = | |
108 | { | |
109 | 63601, 55221, 43562, 33661, 29067, 28203, 65417, 64352, 22462, 41110, | |
110 | 12570, 28635, 23199, 50572, 28471, 27074, 46375, 64028, 13106, 63700, | |
111 | 32698, 17493, 32420, 34382, 22750, 20681, 12300}; | |
112 | static const LITTLENUM_TYPE plus_9[] = | |
113 | { | |
114 | 63564, 61556, 29377, 54467, 18621, 28141, 36415, 61241, 47119, 30026, | |
115 | 19740, 46002, 13541, 61413, 30480, 38664, 32205, 50593, 51112, 48904, | |
116 | 48263, 43814, 286, 30826, 52813, 62575, 61390, 24540, 21495, 5}; | |
117 | ||
118 | static const LITTLENUM_TYPE minus_10[] = | |
119 | { | |
120 | 50313, 34681, 1464, 25889, 19575, 41125, 17635, 4598, 49708, 13427, | |
121 | 17287, 56115, 53783, 38255, 32415, 17778, 31596, 7557, 20951, 18477, | |
122 | 40353, 1178, 44405, 11837, 11571, 50963, 15649, 11698, 40675, 2308,}; | |
123 | static const LITTLENUM_TYPE plus_10[] = | |
124 | { | |
125 | 18520, 53764, 54535, 61910, 61962, 59843, 46270, 58053, 12473, 63785, | |
126 | 2449, 43230, 50044, 47595, 10403, 35766, 32607, 1124, 24966, 35044, | |
127 | 25524, 23631, 18826, 14518, 58448, 14562, 49618, 5588, 25396, 28}; | |
128 | ||
129 | static const LITTLENUM_TYPE minus_11[] = | |
130 | { | |
131 | 6223, 59909, 62437, 59960, 14652, 45336, 48800, 7647, 51962, 37982, | |
132 | 60436, 58176, 26767, 8440, 9831, 48556, 20994, 14148, 6757, 17221, | |
133 | 60624, 46129, 53210, 44085, 54016, 24259, 11232, 21229, 21313, 81,}; | |
134 | static const LITTLENUM_TYPE plus_11[] = | |
135 | { | |
136 | 36159, 2055, 33615, 61362, 23581, 62454, 9748, 15275, 39284, 58636, | |
137 | 16269, 42793, 47240, 45774, 50861, 48400, 9413, 40281, 4030, 9572, | |
138 | 7984, 33038, 59522, 19450, 40593, 24486, 54320, 6661, 55766, 805,}; | |
139 | ||
140 | /* Shut up complaints about differing pointer types. They only differ | |
141 | in the const attribute, but there isn't any easy way to do this | |
142 | */ | |
143 | #define X (LITTLENUM_TYPE *) | |
144 | ||
145 | const FLONUM_TYPE flonum_negative_powers_of_ten[] = | |
146 | { | |
147 | {X zero, X zero, X zero, 0, '+'}, | |
148 | {X minus_1, X minus_1 + 19, X minus_1 + 19, -20, '+'}, | |
149 | {X minus_2, X minus_2 + 19, X minus_2 + 19, -20, '+'}, | |
150 | {X minus_3, X minus_3 + 19, X minus_3 + 19, -20, '+'}, | |
151 | {X minus_4, X minus_4 + 18, X minus_4 + 18, -20, '+'}, | |
152 | {X minus_5, X minus_5 + 16, X minus_5 + 16, -20, '+'}, | |
153 | {X minus_6, X minus_6 + 13, X minus_6 + 13, -20, '+'}, | |
154 | {X minus_7, X minus_7 + 6, X minus_7 + 6, -20, '+'}, | |
155 | {X minus_8, X minus_8 + 13, X minus_8 + 13, -40, '+'}, | |
156 | {X minus_9, X minus_9 + 26, X minus_9 + 26, -80, '+'}, | |
157 | {X minus_10, X minus_10 + 29, X minus_10 + 29, -136, '+'}, | |
158 | {X minus_11, X minus_11 + 29, X minus_11 + 29, -242, '+'}, | |
159 | }; | |
160 | ||
161 | const FLONUM_TYPE flonum_positive_powers_of_ten[] = | |
162 | { | |
163 | {X zero, X zero, X zero, 0, '+'}, | |
164 | {X plus_1, X plus_1 + 0, X plus_1 + 0, 0, '+'}, | |
165 | {X plus_2, X plus_2 + 0, X plus_2 + 0, 0, '+'}, | |
166 | {X plus_3, X plus_3 + 0, X plus_3 + 0, 0, '+'}, | |
167 | {X plus_4, X plus_4 + 1, X plus_4 + 1, 0, '+'}, | |
168 | {X plus_5, X plus_5 + 2, X plus_5 + 2, 1, '+'}, | |
169 | {X plus_6, X plus_6 + 4, X plus_6 + 4, 2, '+'}, | |
170 | {X plus_7, X plus_7 + 9, X plus_7 + 9, 4, '+'}, | |
171 | {X plus_8, X plus_8 + 18, X plus_8 + 18, 8, '+'}, | |
172 | {X plus_9, X plus_9 + 29, X plus_9 + 29, 24, '+'}, | |
173 | {X plus_10, X plus_10 + 29, X plus_10 + 29, 77, '+'}, | |
174 | {X plus_11, X plus_11 + 29, X plus_11 + 29, 183, '+'}, | |
175 | }; | |
176 | ||
177 | #ifdef VMS | |
178 | dummy1 () | |
179 | { | |
180 | } | |
181 | ||
182 | #endif | |
183 | /* end of flonum_const.c */ |