Daily bump.
[official-gcc.git] / libdecnumber / decDPD.h
blob159683bb9604a4810115a88815d55e7dcd521c1e
1 /* Binary Coded Decimal <--> Densely Packed Decimal lookup tables.
2 Copyright (C) 2005 Free Software Foundation, Inc.
3 Contributed by IBM Corporation. Author Mike Cowlishaw.
5 This file is part of GCC.
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
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 In addition to the permissions in the GNU General Public License,
13 the Free Software Foundation gives you unlimited permission to link
14 the compiled version of this file into combinations with other
15 programs, and to distribute those combinations without any
16 restriction coming from the use of this file. (The General Public
17 License restrictions do apply in other respects; for example, they
18 cover modification of the file, and distribution when not linked
19 into a combine executable.)
21 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
22 WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 for more details.
26 You should have received a copy of the GNU General Public License
27 along with GCC; see the file COPYING. If not, write to the Free
28 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
29 02110-1301, USA. */
31 /* ------------------------------------------------------------------------ */
32 /* For details, see: http://www2.hursley.ibm.com/decimal/DPDecimal.html */
33 /* */
34 /* This include file defines conversion tables for DPD, as follows. */
35 /* */
36 /* uint16_t BCD2DPD[2458]; // BCD -> DPD (0x999 => 2457) */
37 /* uint16_t DPD2BCD[1024]; // DPD -> BCD (0x3FF => 0x999) */
38 /* uint16_t BIN2DPD[1000]; // BIN -> DPD (999 => 2457) */
39 /* uint16_t DPD2BIN[1024]; // DPD -> BIN (0x3FF => 999) */
40 /* */
41 /* In all cases the result (10 bits or 12 bits, or binary) is right-aligned */
42 /* in the table entry. */
43 /* */
44 /* To use a table, its name, prefixed with DEC_, must be defined with a */
45 /* value of 1 before this header file is included. For example: */
46 /* #define DEC_BCD2DPD 1 */
47 /* ------------------------------------------------------------------------ */
49 #if DEC_BCD2DPD==1
51 const uint16_t BCD2DPD[2458] = { 0, 1, 2, 3, 4, 5, 6, 7,
52 8, 9, 0, 0, 0, 0, 0, 0, 16, 17, 18, 19, 20,
53 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 32, 33,
54 34, 35, 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, 0,
55 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 0,
56 0, 0, 0, 0, 64, 65, 66, 67, 68, 69, 70, 71, 72,
57 73, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 85,
58 86, 87, 88, 89, 0, 0, 0, 0, 0, 0, 96, 97, 98,
59 99, 100, 101, 102, 103, 104, 105, 0, 0, 0, 0, 0, 0,
60 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 0, 0, 0,
61 0, 0, 0, 10, 11, 42, 43, 74, 75, 106, 107, 78, 79,
62 0, 0, 0, 0, 0, 0, 26, 27, 58, 59, 90, 91, 122,
63 123, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
64 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
65 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
66 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
67 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
68 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 42, 43, 74,
69 75, 106, 107, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0,
70 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71 0, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 0, 0,
72 0, 0, 0, 0, 144, 145, 146, 147, 148, 149, 150, 151, 152,
73 153, 0, 0, 0, 0, 0, 0, 160, 161, 162, 163, 164, 165,
74 166, 167, 168, 169, 0, 0, 0, 0, 0, 0, 176, 177, 178,
75 179, 180, 181, 182, 183, 184, 185, 0, 0, 0, 0, 0, 0,
76 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 0, 0, 0,
77 0, 0, 0, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
78 0, 0, 0, 0, 0, 0, 224, 225, 226, 227, 228, 229, 230,
79 231, 232, 233, 0, 0, 0, 0, 0, 0, 240, 241, 242, 243,
80 244, 245, 246, 247, 248, 249, 0, 0, 0, 0, 0, 0, 138,
81 139, 170, 171, 202, 203, 234, 235, 206, 207, 0, 0, 0, 0,
82 0, 0, 154, 155, 186, 187, 218, 219, 250, 251, 222, 223, 0,
83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
85 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
86 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
87 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
88 0, 0, 0, 0, 138, 139, 170, 171, 202, 203, 234, 235, 206,
89 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
90 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256, 257, 258,
91 259, 260, 261, 262, 263, 264, 265, 0, 0, 0, 0, 0, 0,
92 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 0, 0, 0,
93 0, 0, 0, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
94 0, 0, 0, 0, 0, 0, 304, 305, 306, 307, 308, 309, 310,
95 311, 312, 313, 0, 0, 0, 0, 0, 0, 320, 321, 322, 323,
96 324, 325, 326, 327, 328, 329, 0, 0, 0, 0, 0, 0, 336,
97 337, 338, 339, 340, 341, 342, 343, 344, 345, 0, 0, 0, 0,
98 0, 0, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 0,
99 0, 0, 0, 0, 0, 368, 369, 370, 371, 372, 373, 374, 375,
100 376, 377, 0, 0, 0, 0, 0, 0, 266, 267, 298, 299, 330,
101 331, 362, 363, 334, 335, 0, 0, 0, 0, 0, 0, 282, 283,
102 314, 315, 346, 347, 378, 379, 350, 351, 0, 0, 0, 0, 0,
103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108 266, 267, 298, 299, 330, 331, 362, 363, 334, 335, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110 0, 0, 0, 0, 0, 0, 384, 385, 386, 387, 388, 389, 390,
111 391, 392, 393, 0, 0, 0, 0, 0, 0, 400, 401, 402, 403,
112 404, 405, 406, 407, 408, 409, 0, 0, 0, 0, 0, 0, 416,
113 417, 418, 419, 420, 421, 422, 423, 424, 425, 0, 0, 0, 0,
114 0, 0, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 0,
115 0, 0, 0, 0, 0, 448, 449, 450, 451, 452, 453, 454, 455,
116 456, 457, 0, 0, 0, 0, 0, 0, 464, 465, 466, 467, 468,
117 469, 470, 471, 472, 473, 0, 0, 0, 0, 0, 0, 480, 481,
118 482, 483, 484, 485, 486, 487, 488, 489, 0, 0, 0, 0, 0,
119 0, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 0, 0,
120 0, 0, 0, 0, 394, 395, 426, 427, 458, 459, 490, 491, 462,
121 463, 0, 0, 0, 0, 0, 0, 410, 411, 442, 443, 474, 475,
122 506, 507, 478, 479, 0, 0, 0, 0, 0, 0, 0, 0, 0,
123 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
124 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
127 0, 0, 0, 0, 0, 0, 0, 0, 0, 394, 395, 426, 427,
128 458, 459, 490, 491, 462, 463, 0, 0, 0, 0, 0, 0, 0,
129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
130 0, 0, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 0,
131 0, 0, 0, 0, 0, 528, 529, 530, 531, 532, 533, 534, 535,
132 536, 537, 0, 0, 0, 0, 0, 0, 544, 545, 546, 547, 548,
133 549, 550, 551, 552, 553, 0, 0, 0, 0, 0, 0, 560, 561,
134 562, 563, 564, 565, 566, 567, 568, 569, 0, 0, 0, 0, 0,
135 0, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 0, 0,
136 0, 0, 0, 0, 592, 593, 594, 595, 596, 597, 598, 599, 600,
137 601, 0, 0, 0, 0, 0, 0, 608, 609, 610, 611, 612, 613,
138 614, 615, 616, 617, 0, 0, 0, 0, 0, 0, 624, 625, 626,
139 627, 628, 629, 630, 631, 632, 633, 0, 0, 0, 0, 0, 0,
140 522, 523, 554, 555, 586, 587, 618, 619, 590, 591, 0, 0, 0,
141 0, 0, 0, 538, 539, 570, 571, 602, 603, 634, 635, 606, 607,
142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
145 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
147 0, 0, 0, 0, 0, 522, 523, 554, 555, 586, 587, 618, 619,
148 590, 591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 640, 641,
150 642, 643, 644, 645, 646, 647, 648, 649, 0, 0, 0, 0, 0,
151 0, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 0, 0,
152 0, 0, 0, 0, 672, 673, 674, 675, 676, 677, 678, 679, 680,
153 681, 0, 0, 0, 0, 0, 0, 688, 689, 690, 691, 692, 693,
154 694, 695, 696, 697, 0, 0, 0, 0, 0, 0, 704, 705, 706,
155 707, 708, 709, 710, 711, 712, 713, 0, 0, 0, 0, 0, 0,
156 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 0, 0, 0,
157 0, 0, 0, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745,
158 0, 0, 0, 0, 0, 0, 752, 753, 754, 755, 756, 757, 758,
159 759, 760, 761, 0, 0, 0, 0, 0, 0, 650, 651, 682, 683,
160 714, 715, 746, 747, 718, 719, 0, 0, 0, 0, 0, 0, 666,
161 667, 698, 699, 730, 731, 762, 763, 734, 735, 0, 0, 0, 0,
162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
163 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
165 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
166 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
167 0, 650, 651, 682, 683, 714, 715, 746, 747, 718, 719, 0, 0,
168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
169 0, 0, 0, 0, 0, 0, 0, 768, 769, 770, 771, 772, 773,
170 774, 775, 776, 777, 0, 0, 0, 0, 0, 0, 784, 785, 786,
171 787, 788, 789, 790, 791, 792, 793, 0, 0, 0, 0, 0, 0,
172 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 0, 0, 0,
173 0, 0, 0, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825,
174 0, 0, 0, 0, 0, 0, 832, 833, 834, 835, 836, 837, 838,
175 839, 840, 841, 0, 0, 0, 0, 0, 0, 848, 849, 850, 851,
176 852, 853, 854, 855, 856, 857, 0, 0, 0, 0, 0, 0, 864,
177 865, 866, 867, 868, 869, 870, 871, 872, 873, 0, 0, 0, 0,
178 0, 0, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 0,
179 0, 0, 0, 0, 0, 778, 779, 810, 811, 842, 843, 874, 875,
180 846, 847, 0, 0, 0, 0, 0, 0, 794, 795, 826, 827, 858,
181 859, 890, 891, 862, 863, 0, 0, 0, 0, 0, 0, 0, 0,
182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
183 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 778, 779, 810,
187 811, 842, 843, 874, 875, 846, 847, 0, 0, 0, 0, 0, 0,
188 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
189 0, 0, 0, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905,
190 0, 0, 0, 0, 0, 0, 912, 913, 914, 915, 916, 917, 918,
191 919, 920, 921, 0, 0, 0, 0, 0, 0, 928, 929, 930, 931,
192 932, 933, 934, 935, 936, 937, 0, 0, 0, 0, 0, 0, 944,
193 945, 946, 947, 948, 949, 950, 951, 952, 953, 0, 0, 0, 0,
194 0, 0, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 0,
195 0, 0, 0, 0, 0, 976, 977, 978, 979, 980, 981, 982, 983,
196 984, 985, 0, 0, 0, 0, 0, 0, 992, 993, 994, 995, 996,
197 997, 998, 999, 1000, 1001, 0, 0, 0, 0, 0, 0, 1008, 1009,
198 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 0, 0, 0, 0, 0,
199 0, 906, 907, 938, 939, 970, 971, 1002, 1003, 974, 975, 0, 0,
200 0, 0, 0, 0, 922, 923, 954, 955, 986, 987, 1018, 1019, 990,
201 991, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
203 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
206 0, 0, 0, 0, 0, 0, 906, 907, 938, 939, 970, 971, 1002,
207 1003, 974, 975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
208 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
209 13, 268, 269, 524, 525, 780, 781, 46, 47, 0, 0, 0, 0,
210 0, 0, 28, 29, 284, 285, 540, 541, 796, 797, 62, 63, 0,
211 0, 0, 0, 0, 0, 44, 45, 300, 301, 556, 557, 812, 813,
212 302, 303, 0, 0, 0, 0, 0, 0, 60, 61, 316, 317, 572,
213 573, 828, 829, 318, 319, 0, 0, 0, 0, 0, 0, 76, 77,
214 332, 333, 588, 589, 844, 845, 558, 559, 0, 0, 0, 0, 0,
215 0, 92, 93, 348, 349, 604, 605, 860, 861, 574, 575, 0, 0,
216 0, 0, 0, 0, 108, 109, 364, 365, 620, 621, 876, 877, 814,
217 815, 0, 0, 0, 0, 0, 0, 124, 125, 380, 381, 636, 637,
218 892, 893, 830, 831, 0, 0, 0, 0, 0, 0, 14, 15, 270,
219 271, 526, 527, 782, 783, 110, 111, 0, 0, 0, 0, 0, 0,
220 30, 31, 286, 287, 542, 543, 798, 799, 126, 127, 0, 0, 0,
221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
222 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
225 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
226 0, 0, 14, 15, 270, 271, 526, 527, 782, 783, 110, 111, 0,
227 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, 0, 0, 140, 141, 396, 397, 652,
229 653, 908, 909, 174, 175, 0, 0, 0, 0, 0, 0, 156, 157,
230 412, 413, 668, 669, 924, 925, 190, 191, 0, 0, 0, 0, 0,
231 0, 172, 173, 428, 429, 684, 685, 940, 941, 430, 431, 0, 0,
232 0, 0, 0, 0, 188, 189, 444, 445, 700, 701, 956, 957, 446,
233 447, 0, 0, 0, 0, 0, 0, 204, 205, 460, 461, 716, 717,
234 972, 973, 686, 687, 0, 0, 0, 0, 0, 0, 220, 221, 476,
235 477, 732, 733, 988, 989, 702, 703, 0, 0, 0, 0, 0, 0,
236 236, 237, 492, 493, 748, 749, 1004, 1005, 942, 943, 0, 0, 0,
237 0, 0, 0, 252, 253, 508, 509, 764, 765, 1020, 1021, 958, 959,
238 0, 0, 0, 0, 0, 0, 142, 143, 398, 399, 654, 655, 910,
239 911, 238, 239, 0, 0, 0, 0, 0, 0, 158, 159, 414, 415,
240 670, 671, 926, 927, 254, 255
242 #endif
244 #if DEC_DPD2BCD==1
246 const uint16_t DPD2BCD[1024] = { 0, 1, 2, 3, 4, 5, 6, 7,
247 8, 9, 128, 129, 2048, 2049, 2176, 2177, 16, 17, 18, 19, 20,
248 21, 22, 23, 24, 25, 144, 145, 2064, 2065, 2192, 2193, 32, 33,
249 34, 35, 36, 37, 38, 39, 40, 41, 130, 131, 2080, 2081, 2056,
250 2057, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 146, 147,
251 2096, 2097, 2072, 2073, 64, 65, 66, 67, 68, 69, 70, 71, 72,
252 73, 132, 133, 2112, 2113, 136, 137, 80, 81, 82, 83, 84, 85,
253 86, 87, 88, 89, 148, 149, 2128, 2129, 152, 153, 96, 97, 98,
254 99, 100, 101, 102, 103, 104, 105, 134, 135, 2144, 2145, 2184, 2185,
255 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 150, 151, 2160,
256 2161, 2200, 2201, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265,
257 384, 385, 2304, 2305, 2432, 2433, 272, 273, 274, 275, 276, 277, 278,
258 279, 280, 281, 400, 401, 2320, 2321, 2448, 2449, 288, 289, 290, 291,
259 292, 293, 294, 295, 296, 297, 386, 387, 2336, 2337, 2312, 2313, 304,
260 305, 306, 307, 308, 309, 310, 311, 312, 313, 402, 403, 2352, 2353,
261 2328, 2329, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 388,
262 389, 2368, 2369, 392, 393, 336, 337, 338, 339, 340, 341, 342, 343,
263 344, 345, 404, 405, 2384, 2385, 408, 409, 352, 353, 354, 355, 356,
264 357, 358, 359, 360, 361, 390, 391, 2400, 2401, 2440, 2441, 368, 369,
265 370, 371, 372, 373, 374, 375, 376, 377, 406, 407, 2416, 2417, 2456,
266 2457, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 640, 641,
267 2050, 2051, 2178, 2179, 528, 529, 530, 531, 532, 533, 534, 535, 536,
268 537, 656, 657, 2066, 2067, 2194, 2195, 544, 545, 546, 547, 548, 549,
269 550, 551, 552, 553, 642, 643, 2082, 2083, 2088, 2089, 560, 561, 562,
270 563, 564, 565, 566, 567, 568, 569, 658, 659, 2098, 2099, 2104, 2105,
271 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 644, 645, 2114,
272 2115, 648, 649, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601,
273 660, 661, 2130, 2131, 664, 665, 608, 609, 610, 611, 612, 613, 614,
274 615, 616, 617, 646, 647, 2146, 2147, 2184, 2185, 624, 625, 626, 627,
275 628, 629, 630, 631, 632, 633, 662, 663, 2162, 2163, 2200, 2201, 768,
276 769, 770, 771, 772, 773, 774, 775, 776, 777, 896, 897, 2306, 2307,
277 2434, 2435, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 912,
278 913, 2322, 2323, 2450, 2451, 800, 801, 802, 803, 804, 805, 806, 807,
279 808, 809, 898, 899, 2338, 2339, 2344, 2345, 816, 817, 818, 819, 820,
280 821, 822, 823, 824, 825, 914, 915, 2354, 2355, 2360, 2361, 832, 833,
281 834, 835, 836, 837, 838, 839, 840, 841, 900, 901, 2370, 2371, 904,
282 905, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 916, 917,
283 2386, 2387, 920, 921, 864, 865, 866, 867, 868, 869, 870, 871, 872,
284 873, 902, 903, 2402, 2403, 2440, 2441, 880, 881, 882, 883, 884, 885,
285 886, 887, 888, 889, 918, 919, 2418, 2419, 2456, 2457, 1024, 1025, 1026,
286 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1152, 1153, 2052, 2053, 2180,
287 2181,
288 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1168, 1169,
289 2068,
290 2069, 2196, 2197, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064,
291 1065,
292 1154, 1155, 2084, 2085, 2120, 2121, 1072, 1073, 1074, 1075, 1076, 1077,
293 1078,
294 1079, 1080, 1081, 1170, 1171, 2100, 2101, 2136, 2137, 1088, 1089, 1090,
295 1091,
296 1092, 1093, 1094, 1095, 1096, 1097, 1156, 1157, 2116, 2117, 1160, 1161,
297 1104,
298 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1172, 1173, 2132,
299 2133,
300 1176, 1177, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129,
301 1158,
302 1159, 2148, 2149, 2184, 2185, 1136, 1137, 1138, 1139, 1140, 1141, 1142,
303 1143,
304 1144, 1145, 1174, 1175, 2164, 2165, 2200, 2201, 1280, 1281, 1282, 1283,
305 1284,
306 1285, 1286, 1287, 1288, 1289, 1408, 1409, 2308, 2309, 2436, 2437, 1296,
307 1297,
308 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1424, 1425, 2324, 2325,
309 2452,
310 2453, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1410,
311 1411,
312 2340, 2341, 2376, 2377, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335,
313 1336,
314 1337, 1426, 1427, 2356, 2357, 2392, 2393, 1344, 1345, 1346, 1347, 1348,
315 1349,
316 1350, 1351, 1352, 1353, 1412, 1413, 2372, 2373, 1416, 1417, 1360, 1361,
317 1362,
318 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1428, 1429, 2388, 2389, 1432,
319 1433,
320 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1414, 1415,
321 2404,
322 2405, 2440, 2441, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400,
323 1401,
324 1430, 1431, 2420, 2421, 2456, 2457, 1536, 1537, 1538, 1539, 1540, 1541,
325 1542,
326 1543, 1544, 1545, 1664, 1665, 2054, 2055, 2182, 2183, 1552, 1553, 1554,
327 1555,
328 1556, 1557, 1558, 1559, 1560, 1561, 1680, 1681, 2070, 2071, 2198, 2199,
329 1568,
330 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1666, 1667, 2086,
331 2087,
332 2152, 2153, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593,
333 1682,
334 1683, 2102, 2103, 2168, 2169, 1600, 1601, 1602, 1603, 1604, 1605, 1606,
335 1607,
336 1608, 1609, 1668, 1669, 2118, 2119, 1672, 1673, 1616, 1617, 1618, 1619,
337 1620,
338 1621, 1622, 1623, 1624, 1625, 1684, 1685, 2134, 2135, 1688, 1689, 1632,
339 1633,
340 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1670, 1671, 2150, 2151,
341 2184,
342 2185, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1686,
343 1687,
344 2166, 2167, 2200, 2201, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799,
345 1800,
346 1801, 1920, 1921, 2310, 2311, 2438, 2439, 1808, 1809, 1810, 1811, 1812,
347 1813,
348 1814, 1815, 1816, 1817, 1936, 1937, 2326, 2327, 2454, 2455, 1824, 1825,
349 1826,
350 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1922, 1923, 2342, 2343, 2408,
351 2409,
352 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1938, 1939,
353 2358,
354 2359, 2424, 2425, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864,
355 1865,
356 1924, 1925, 2374, 2375, 1928, 1929, 1872, 1873, 1874, 1875, 1876, 1877,
357 1878,
358 1879, 1880, 1881, 1940, 1941, 2390, 2391, 1944, 1945, 1888, 1889, 1890,
359 1891,
360 1892, 1893, 1894, 1895, 1896, 1897, 1926, 1927, 2406, 2407, 2440, 2441,
361 1904,
362 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1942, 1943, 2422,
363 2423,
364 2456, 2457
366 #endif
368 #if DEC_BIN2DPD==1
370 const uint16_t BIN2DPD[1000] = { 0, 1, 2, 3, 4, 5, 6, 7,
371 8, 9, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 32,
372 33, 34, 35, 36, 37, 38, 39, 40, 41, 48, 49, 50, 51,
373 52, 53, 54, 55, 56, 57, 64, 65, 66, 67, 68, 69, 70,
374 71, 72, 73, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
375 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 112, 113, 114,
376 115, 116, 117, 118, 119, 120, 121, 10, 11, 42, 43, 74, 75,
377 106, 107, 78, 79, 26, 27, 58, 59, 90, 91, 122, 123, 94,
378 95, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 144, 145,
379 146, 147, 148, 149, 150, 151, 152, 153, 160, 161, 162, 163, 164,
380 165, 166, 167, 168, 169, 176, 177, 178, 179, 180, 181, 182, 183,
381 184, 185, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 208,
382 209, 210, 211, 212, 213, 214, 215, 216, 217, 224, 225, 226, 227,
383 228, 229, 230, 231, 232, 233, 240, 241, 242, 243, 244, 245, 246,
384 247, 248, 249, 138, 139, 170, 171, 202, 203, 234, 235, 206, 207,
385 154, 155, 186, 187, 218, 219, 250, 251, 222, 223, 256, 257, 258,
386 259, 260, 261, 262, 263, 264, 265, 272, 273, 274, 275, 276, 277,
387 278, 279, 280, 281, 288, 289, 290, 291, 292, 293, 294, 295, 296,
388 297, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 320, 321,
389 322, 323, 324, 325, 326, 327, 328, 329, 336, 337, 338, 339, 340,
390 341, 342, 343, 344, 345, 352, 353, 354, 355, 356, 357, 358, 359,
391 360, 361, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 266,
392 267, 298, 299, 330, 331, 362, 363, 334, 335, 282, 283, 314, 315,
393 346, 347, 378, 379, 350, 351, 384, 385, 386, 387, 388, 389, 390,
394 391, 392, 393, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409,
395 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 432, 433, 434,
396 435, 436, 437, 438, 439, 440, 441, 448, 449, 450, 451, 452, 453,
397 454, 455, 456, 457, 464, 465, 466, 467, 468, 469, 470, 471, 472,
398 473, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 496, 497,
399 498, 499, 500, 501, 502, 503, 504, 505, 394, 395, 426, 427, 458,
400 459, 490, 491, 462, 463, 410, 411, 442, 443, 474, 475, 506, 507,
401 478, 479, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 528,
402 529, 530, 531, 532, 533, 534, 535, 536, 537, 544, 545, 546, 547,
403 548, 549, 550, 551, 552, 553, 560, 561, 562, 563, 564, 565, 566,
404 567, 568, 569, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585,
405 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 608, 609, 610,
406 611, 612, 613, 614, 615, 616, 617, 624, 625, 626, 627, 628, 629,
407 630, 631, 632, 633, 522, 523, 554, 555, 586, 587, 618, 619, 590,
408 591, 538, 539, 570, 571, 602, 603, 634, 635, 606, 607, 640, 641,
409 642, 643, 644, 645, 646, 647, 648, 649, 656, 657, 658, 659, 660,
410 661, 662, 663, 664, 665, 672, 673, 674, 675, 676, 677, 678, 679,
411 680, 681, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 704,
412 705, 706, 707, 708, 709, 710, 711, 712, 713, 720, 721, 722, 723,
413 724, 725, 726, 727, 728, 729, 736, 737, 738, 739, 740, 741, 742,
414 743, 744, 745, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761,
415 650, 651, 682, 683, 714, 715, 746, 747, 718, 719, 666, 667, 698,
416 699, 730, 731, 762, 763, 734, 735, 768, 769, 770, 771, 772, 773,
417 774, 775, 776, 777, 784, 785, 786, 787, 788, 789, 790, 791, 792,
418 793, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 816, 817,
419 818, 819, 820, 821, 822, 823, 824, 825, 832, 833, 834, 835, 836,
420 837, 838, 839, 840, 841, 848, 849, 850, 851, 852, 853, 854, 855,
421 856, 857, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 880,
422 881, 882, 883, 884, 885, 886, 887, 888, 889, 778, 779, 810, 811,
423 842, 843, 874, 875, 846, 847, 794, 795, 826, 827, 858, 859, 890,
424 891, 862, 863, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905,
425 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 928, 929, 930,
426 931, 932, 933, 934, 935, 936, 937, 944, 945, 946, 947, 948, 949,
427 950, 951, 952, 953, 960, 961, 962, 963, 964, 965, 966, 967, 968,
428 969, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 992, 993,
429 994, 995, 996, 997, 998, 999, 1000, 1001, 1008, 1009, 1010, 1011, 1012,
430 1013, 1014, 1015, 1016, 1017, 906, 907, 938, 939, 970, 971, 1002, 1003,
431 974, 975, 922, 923, 954, 955, 986, 987, 1018, 1019, 990, 991, 12,
432 13, 268, 269, 524, 525, 780, 781, 46, 47, 28, 29, 284, 285,
433 540, 541, 796, 797, 62, 63, 44, 45, 300, 301, 556, 557, 812,
434 813, 302, 303, 60, 61, 316, 317, 572, 573, 828, 829, 318, 319,
435 76, 77, 332, 333, 588, 589, 844, 845, 558, 559, 92, 93, 348,
436 349, 604, 605, 860, 861, 574, 575, 108, 109, 364, 365, 620, 621,
437 876, 877, 814, 815, 124, 125, 380, 381, 636, 637, 892, 893, 830,
438 831, 14, 15, 270, 271, 526, 527, 782, 783, 110, 111, 30, 31,
439 286, 287, 542, 543, 798, 799, 126, 127, 140, 141, 396, 397, 652,
440 653, 908, 909, 174, 175, 156, 157, 412, 413, 668, 669, 924, 925,
441 190, 191, 172, 173, 428, 429, 684, 685, 940, 941, 430, 431, 188,
442 189, 444, 445, 700, 701, 956, 957, 446, 447, 204, 205, 460, 461,
443 716, 717, 972, 973, 686, 687, 220, 221, 476, 477, 732, 733, 988,
444 989, 702, 703, 236, 237, 492, 493, 748, 749, 1004, 1005, 942, 943,
445 252, 253, 508, 509, 764, 765, 1020, 1021, 958, 959, 142, 143, 398,
446 399, 654, 655, 910, 911, 238, 239, 158, 159, 414, 415, 670, 671,
447 926, 927, 254, 255
449 #endif
451 #if DEC_DPD2BIN==1
453 const uint16_t DPD2BIN[1024] = { 0, 1, 2, 3, 4, 5, 6, 7,
454 8, 9, 80, 81, 800, 801, 880, 881, 10, 11, 12, 13, 14,
455 15, 16, 17, 18, 19, 90, 91, 810, 811, 890, 891, 20, 21,
456 22, 23, 24, 25, 26, 27, 28, 29, 82, 83, 820, 821, 808,
457 809, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 92, 93,
458 830, 831, 818, 819, 40, 41, 42, 43, 44, 45, 46, 47, 48,
459 49, 84, 85, 840, 841, 88, 89, 50, 51, 52, 53, 54, 55,
460 56, 57, 58, 59, 94, 95, 850, 851, 98, 99, 60, 61, 62,
461 63, 64, 65, 66, 67, 68, 69, 86, 87, 860, 861, 888, 889,
462 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 96, 97, 870,
463 871, 898, 899, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
464 180, 181, 900, 901, 980, 981, 110, 111, 112, 113, 114, 115, 116,
465 117, 118, 119, 190, 191, 910, 911, 990, 991, 120, 121, 122, 123,
466 124, 125, 126, 127, 128, 129, 182, 183, 920, 921, 908, 909, 130,
467 131, 132, 133, 134, 135, 136, 137, 138, 139, 192, 193, 930, 931,
468 918, 919, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 184,
469 185, 940, 941, 188, 189, 150, 151, 152, 153, 154, 155, 156, 157,
470 158, 159, 194, 195, 950, 951, 198, 199, 160, 161, 162, 163, 164,
471 165, 166, 167, 168, 169, 186, 187, 960, 961, 988, 989, 170, 171,
472 172, 173, 174, 175, 176, 177, 178, 179, 196, 197, 970, 971, 998,
473 999, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 280, 281,
474 802, 803, 882, 883, 210, 211, 212, 213, 214, 215, 216, 217, 218,
475 219, 290, 291, 812, 813, 892, 893, 220, 221, 222, 223, 224, 225,
476 226, 227, 228, 229, 282, 283, 822, 823, 828, 829, 230, 231, 232,
477 233, 234, 235, 236, 237, 238, 239, 292, 293, 832, 833, 838, 839,
478 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 284, 285, 842,
479 843, 288, 289, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
480 294, 295, 852, 853, 298, 299, 260, 261, 262, 263, 264, 265, 266,
481 267, 268, 269, 286, 287, 862, 863, 888, 889, 270, 271, 272, 273,
482 274, 275, 276, 277, 278, 279, 296, 297, 872, 873, 898, 899, 300,
483 301, 302, 303, 304, 305, 306, 307, 308, 309, 380, 381, 902, 903,
484 982, 983, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 390,
485 391, 912, 913, 992, 993, 320, 321, 322, 323, 324, 325, 326, 327,
486 328, 329, 382, 383, 922, 923, 928, 929, 330, 331, 332, 333, 334,
487 335, 336, 337, 338, 339, 392, 393, 932, 933, 938, 939, 340, 341,
488 342, 343, 344, 345, 346, 347, 348, 349, 384, 385, 942, 943, 388,
489 389, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 394, 395,
490 952, 953, 398, 399, 360, 361, 362, 363, 364, 365, 366, 367, 368,
491 369, 386, 387, 962, 963, 988, 989, 370, 371, 372, 373, 374, 375,
492 376, 377, 378, 379, 396, 397, 972, 973, 998, 999, 400, 401, 402,
493 403, 404, 405, 406, 407, 408, 409, 480, 481, 804, 805, 884, 885,
494 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 490, 491, 814,
495 815, 894, 895, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429,
496 482, 483, 824, 825, 848, 849, 430, 431, 432, 433, 434, 435, 436,
497 437, 438, 439, 492, 493, 834, 835, 858, 859, 440, 441, 442, 443,
498 444, 445, 446, 447, 448, 449, 484, 485, 844, 845, 488, 489, 450,
499 451, 452, 453, 454, 455, 456, 457, 458, 459, 494, 495, 854, 855,
500 498, 499, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 486,
501 487, 864, 865, 888, 889, 470, 471, 472, 473, 474, 475, 476, 477,
502 478, 479, 496, 497, 874, 875, 898, 899, 500, 501, 502, 503, 504,
503 505, 506, 507, 508, 509, 580, 581, 904, 905, 984, 985, 510, 511,
504 512, 513, 514, 515, 516, 517, 518, 519, 590, 591, 914, 915, 994,
505 995, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 582, 583,
506 924, 925, 948, 949, 530, 531, 532, 533, 534, 535, 536, 537, 538,
507 539, 592, 593, 934, 935, 958, 959, 540, 541, 542, 543, 544, 545,
508 546, 547, 548, 549, 584, 585, 944, 945, 588, 589, 550, 551, 552,
509 553, 554, 555, 556, 557, 558, 559, 594, 595, 954, 955, 598, 599,
510 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 586, 587, 964,
511 965, 988, 989, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579,
512 596, 597, 974, 975, 998, 999, 600, 601, 602, 603, 604, 605, 606,
513 607, 608, 609, 680, 681, 806, 807, 886, 887, 610, 611, 612, 613,
514 614, 615, 616, 617, 618, 619, 690, 691, 816, 817, 896, 897, 620,
515 621, 622, 623, 624, 625, 626, 627, 628, 629, 682, 683, 826, 827,
516 868, 869, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 692,
517 693, 836, 837, 878, 879, 640, 641, 642, 643, 644, 645, 646, 647,
518 648, 649, 684, 685, 846, 847, 688, 689, 650, 651, 652, 653, 654,
519 655, 656, 657, 658, 659, 694, 695, 856, 857, 698, 699, 660, 661,
520 662, 663, 664, 665, 666, 667, 668, 669, 686, 687, 866, 867, 888,
521 889, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 696, 697,
522 876, 877, 898, 899, 700, 701, 702, 703, 704, 705, 706, 707, 708,
523 709, 780, 781, 906, 907, 986, 987, 710, 711, 712, 713, 714, 715,
524 716, 717, 718, 719, 790, 791, 916, 917, 996, 997, 720, 721, 722,
525 723, 724, 725, 726, 727, 728, 729, 782, 783, 926, 927, 968, 969,
526 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 792, 793, 936,
527 937, 978, 979, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749,
528 784, 785, 946, 947, 788, 789, 750, 751, 752, 753, 754, 755, 756,
529 757, 758, 759, 794, 795, 956, 957, 798, 799, 760, 761, 762, 763,
530 764, 765, 766, 767, 768, 769, 786, 787, 966, 967, 988, 989, 770,
531 771, 772, 773, 774, 775, 776, 777, 778, 779, 796, 797, 976, 977,
532 998, 999
534 #endif