1 static char rcsid[] = "$Id: bitpack64-access.c 199469 2016-10-23 03:49:07Z twu $";
2 #ifdef HAVE_CONFIG_H
3 #include <config.h>
4 #endif
5 
6 #include "bitpack64-access.h"
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 
11 #ifdef WORDS_BIGENDIAN
12 #include "bigendian.h"
13 #define CONVERT(x) Bigendian_convert_uint(x)
14 #else
15 #define CONVERT(x) x
16 #endif
17 
18 
19 #ifdef DEBUG
20 #define debug(x) x
21 #else
22 #define debug(x)
23 #endif
24 
25 
26 #define BLOCKSIZE 64
27 
28 /* Vertical access is slightly more efficient than horizontal */
29 
30 #ifdef HORIZONTAL
31 #define WORD_INCR 1		/* 1 for horizontal; 4 for vertical */
32 #else
33 #define WORD_INCR 4
34 #endif
35 
36 
37 static UINT4
access_00(const UINT4 * in)38 access_00 (const UINT4 *in) {
39   return 0U;
40 }
41 
42 
43 
44 static UINT4
access_02_00(const UINT4 * in)45 access_02_00 (const UINT4 *in) {
46   return ( CONVERT(*in) >>  0  )   % (1U << 2 ) ;
47 }
48 
49 static UINT4
access_02_01(const UINT4 * in)50 access_02_01 (const UINT4 *in) {
51   return ( CONVERT(*in) >>  2  )   % (1U << 2 ) ;
52 }
53 
54 static UINT4
access_02_02(const UINT4 * in)55 access_02_02 (const UINT4 *in) {
56   return ( CONVERT(*in) >>  4  )   % (1U << 2 ) ;
57 }
58 
59 static UINT4
access_02_03(const UINT4 * in)60 access_02_03 (const UINT4 *in) {
61   return ( CONVERT(*in) >>  6  )   % (1U << 2 ) ;
62 }
63 
64 static UINT4
access_02_04(const UINT4 * in)65 access_02_04 (const UINT4 *in) {
66   return ( CONVERT(*in) >>  8  )   % (1U << 2 ) ;
67 }
68 
69 static UINT4
access_02_05(const UINT4 * in)70 access_02_05 (const UINT4 *in) {
71   return ( CONVERT(*in) >>  10  )   % (1U << 2 ) ;
72 }
73 
74 static UINT4
access_02_06(const UINT4 * in)75 access_02_06 (const UINT4 *in) {
76   return ( CONVERT(*in) >>  12  )   % (1U << 2 ) ;
77 }
78 
79 static UINT4
access_02_07(const UINT4 * in)80 access_02_07 (const UINT4 *in) {
81   return ( CONVERT(*in) >>  14  )   % (1U << 2 ) ;
82 }
83 
84 static UINT4
access_02_08(const UINT4 * in)85 access_02_08 (const UINT4 *in) {
86   return ( CONVERT(*in) >>  16  )   % (1U << 2 ) ;
87 }
88 
89 static UINT4
access_02_09(const UINT4 * in)90 access_02_09 (const UINT4 *in) {
91   return ( CONVERT(*in) >>  18  )   % (1U << 2 ) ;
92 }
93 
94 static UINT4
access_02_10(const UINT4 * in)95 access_02_10 (const UINT4 *in) {
96   return ( CONVERT(*in) >>  20  )   % (1U << 2 ) ;
97 }
98 
99 static UINT4
access_02_11(const UINT4 * in)100 access_02_11 (const UINT4 *in) {
101   return ( CONVERT(*in) >>  22  )   % (1U << 2 ) ;
102 }
103 
104 static UINT4
access_02_12(const UINT4 * in)105 access_02_12 (const UINT4 *in) {
106   return ( CONVERT(*in) >>  24  )   % (1U << 2 ) ;
107 }
108 
109 static UINT4
access_02_13(const UINT4 * in)110 access_02_13 (const UINT4 *in) {
111   return ( CONVERT(*in) >>  26  )   % (1U << 2 ) ;
112 }
113 
114 static UINT4
access_02_14(const UINT4 * in)115 access_02_14 (const UINT4 *in) {
116   return ( CONVERT(*in) >>  28  )   % (1U << 2 ) ;
117 }
118 
119 static UINT4
access_02_15(const UINT4 * in)120 access_02_15 (const UINT4 *in) {
121   return ( CONVERT(*in) >>  30  )   % (1U << 2 ) ;
122 }
123 
124 
125 
126 static UINT4
access_04_00(const UINT4 * in)127 access_04_00 (const UINT4 *in) {
128   return ( CONVERT(*in) >> 0 )   % (1U << 4 ) ;
129 }
130 
131 static UINT4
access_04_01(const UINT4 * in)132 access_04_01 (const UINT4 *in) {
133   return ( CONVERT(*in) >> 4 )   % (1U << 4 ) ;
134 }
135 
136 static UINT4
access_04_02(const UINT4 * in)137 access_04_02 (const UINT4 *in) {
138   return ( CONVERT(*in) >> 8 )   % (1U << 4 ) ;
139 }
140 
141 static UINT4
access_04_03(const UINT4 * in)142 access_04_03 (const UINT4 *in) {
143   return ( CONVERT(*in) >> 12 )   % (1U << 4 ) ;
144 }
145 
146 static UINT4
access_04_04(const UINT4 * in)147 access_04_04 (const UINT4 *in) {
148   return ( CONVERT(*in) >> 16 )   % (1U << 4 ) ;
149 }
150 
151 static UINT4
access_04_05(const UINT4 * in)152 access_04_05 (const UINT4 *in) {
153   return ( CONVERT(*in) >> 20 )   % (1U << 4 ) ;
154 }
155 
156 static UINT4
access_04_06(const UINT4 * in)157 access_04_06 (const UINT4 *in) {
158   return ( CONVERT(*in) >> 24 )   % (1U << 4 ) ;
159 }
160 
161 static UINT4
access_04_07(const UINT4 * in)162 access_04_07 (const UINT4 *in) {
163   return ( CONVERT(*in) >> 28 )   % (1U << 4 ) ;
164 }
165 
166 static UINT4
access_04_08(const UINT4 * in)167 access_04_08 (const UINT4 *in) {
168   in += 1 * WORD_INCR;
169   return ( CONVERT(*in) >> 0 )   % (1U << 4 ) ;
170 }
171 
172 static UINT4
access_04_09(const UINT4 * in)173 access_04_09 (const UINT4 *in) {
174   in += 1 * WORD_INCR;
175   return ( CONVERT(*in) >> 4 )   % (1U << 4 ) ;
176 }
177 
178 static UINT4
access_04_10(const UINT4 * in)179 access_04_10 (const UINT4 *in) {
180   in += 1 * WORD_INCR;
181   return ( CONVERT(*in) >> 8 )   % (1U << 4 ) ;
182 }
183 
184 static UINT4
access_04_11(const UINT4 * in)185 access_04_11 (const UINT4 *in) {
186   in += 1 * WORD_INCR;
187   return ( CONVERT(*in) >> 12 )   % (1U << 4 ) ;
188 }
189 
190 static UINT4
access_04_12(const UINT4 * in)191 access_04_12 (const UINT4 *in) {
192   in += 1 * WORD_INCR;
193   return ( CONVERT(*in) >> 16 )   % (1U << 4 ) ;
194 }
195 
196 static UINT4
access_04_13(const UINT4 * in)197 access_04_13 (const UINT4 *in) {
198   in += 1 * WORD_INCR;
199   return ( CONVERT(*in) >> 20 )   % (1U << 4 ) ;
200 }
201 
202 static UINT4
access_04_14(const UINT4 * in)203 access_04_14 (const UINT4 *in) {
204   in += 1 * WORD_INCR;
205   return ( CONVERT(*in) >> 24 )   % (1U << 4 ) ;
206 }
207 
208 static UINT4
access_04_15(const UINT4 * in)209 access_04_15 (const UINT4 *in) {
210   in += 1 * WORD_INCR;
211   return ( CONVERT(*in) >> 28 )   % (1U << 4 ) ;
212 }
213 
214 
215 static UINT4
access_06_00(const UINT4 * in)216 access_06_00 (const UINT4 *in) {
217   return ( CONVERT(*in) >>  0  )   % (1U << 6 ) ;
218 }
219 
220 static UINT4
access_06_01(const UINT4 * in)221 access_06_01 (const UINT4 *in) {
222   return ( CONVERT(*in) >>  6  )   % (1U << 6 ) ;
223 }
224 
225 static UINT4
access_06_02(const UINT4 * in)226 access_06_02 (const UINT4 *in) {
227   return ( CONVERT(*in) >>  12  )   % (1U << 6 ) ;
228 }
229 
230 static UINT4
access_06_03(const UINT4 * in)231 access_06_03 (const UINT4 *in) {
232   return ( CONVERT(*in) >>  18  )   % (1U << 6 ) ;
233 }
234 
235 static UINT4
access_06_04(const UINT4 * in)236 access_06_04 (const UINT4 *in) {
237   return ( CONVERT(*in) >>  24  )   % (1U << 6 ) ;
238 }
239 
240 static UINT4
access_06_05(const UINT4 * in)241 access_06_05 (const UINT4 *in) {
242   UINT4 out;
243 
244   out = ( CONVERT(*in) >>  30  )   % (1U << 6 ) ;
245   in += 1 * WORD_INCR;
246   out |= (CONVERT(*in) % (1U<< 4 ))<<( 6 - 4 );
247   return out;
248 }
249 
250 static UINT4
access_06_06(const UINT4 * in)251 access_06_06 (const UINT4 *in) {
252   in += 1 * WORD_INCR;
253   return ( CONVERT(*in) >>  4  )   % (1U << 6 ) ;
254 }
255 
256 static UINT4
access_06_07(const UINT4 * in)257 access_06_07 (const UINT4 *in) {
258   in += 1 * WORD_INCR;
259   return ( CONVERT(*in) >>  10  )   % (1U << 6 ) ;
260 }
261 
262 static UINT4
access_06_08(const UINT4 * in)263 access_06_08 (const UINT4 *in) {
264   in += 1 * WORD_INCR;
265   return ( CONVERT(*in) >>  16  )   % (1U << 6 ) ;
266 }
267 
268 static UINT4
access_06_09(const UINT4 * in)269 access_06_09 (const UINT4 *in) {
270   in += 1 * WORD_INCR;
271   return ( CONVERT(*in) >>  22  )   % (1U << 6 ) ;
272 }
273 
274 static UINT4
access_06_10(const UINT4 * in)275 access_06_10 (const UINT4 *in) {
276   UINT4 out;
277 
278   in += 1 * WORD_INCR;
279   out = ( CONVERT(*in) >>  28  )   % (1U << 6 ) ;
280   in += 1 * WORD_INCR;
281   out |= (CONVERT(*in) % (1U<< 2 ))<<( 6 - 2 );
282   return out;
283 }
284 
285 static UINT4
access_06_11(const UINT4 * in)286 access_06_11 (const UINT4 *in) {
287   in += 2 * WORD_INCR;
288   return ( CONVERT(*in) >>  2  )   % (1U << 6 ) ;
289 }
290 
291 static UINT4
access_06_12(const UINT4 * in)292 access_06_12 (const UINT4 *in) {
293   in += 2 * WORD_INCR;
294   return ( CONVERT(*in) >>  8  )   % (1U << 6 ) ;
295 }
296 
297 static UINT4
access_06_13(const UINT4 * in)298 access_06_13 (const UINT4 *in) {
299   in += 2 * WORD_INCR;
300   return ( CONVERT(*in) >>  14  )   % (1U << 6 ) ;
301 }
302 
303 static UINT4
access_06_14(const UINT4 * in)304 access_06_14 (const UINT4 *in) {
305   in += 2 * WORD_INCR;
306   return ( CONVERT(*in) >>  20  )   % (1U << 6 ) ;
307 }
308 
309 static UINT4
access_06_15(const UINT4 * in)310 access_06_15 (const UINT4 *in) {
311   in += 2 * WORD_INCR;
312   return ( CONVERT(*in) >>  26  )   % (1U << 6 ) ;
313 }
314 
315 
316 static UINT4
access_08_00(const UINT4 * in)317 access_08_00 (const UINT4 *in) {
318   return ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
319 }
320 
321 static UINT4
access_08_01(const UINT4 * in)322 access_08_01 (const UINT4 *in) {
323   return ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
324 }
325 
326 static UINT4
access_08_02(const UINT4 * in)327 access_08_02 (const UINT4 *in) {
328   return ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
329 }
330 
331 static UINT4
access_08_03(const UINT4 * in)332 access_08_03 (const UINT4 *in) {
333   return ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
334 }
335 
336 static UINT4
access_08_04(const UINT4 * in)337 access_08_04 (const UINT4 *in) {
338   in += 1 * WORD_INCR;
339   return ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
340 }
341 
342 static UINT4
access_08_05(const UINT4 * in)343 access_08_05 (const UINT4 *in) {
344   in += 1 * WORD_INCR;
345   return ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
346 }
347 
348 static UINT4
access_08_06(const UINT4 * in)349 access_08_06 (const UINT4 *in) {
350   in += 1 * WORD_INCR;
351   return ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
352 }
353 
354 static UINT4
access_08_07(const UINT4 * in)355 access_08_07 (const UINT4 *in) {
356   in += 1 * WORD_INCR;
357   return ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
358 }
359 
360 static UINT4
access_08_08(const UINT4 * in)361 access_08_08 (const UINT4 *in) {
362   in += 2 * WORD_INCR;
363   return ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
364 }
365 
366 static UINT4
access_08_09(const UINT4 * in)367 access_08_09 (const UINT4 *in) {
368   in += 2 * WORD_INCR;
369   return ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
370 }
371 
372 static UINT4
access_08_10(const UINT4 * in)373 access_08_10 (const UINT4 *in) {
374   in += 2 * WORD_INCR;
375   return ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
376 }
377 
378 static UINT4
access_08_11(const UINT4 * in)379 access_08_11 (const UINT4 *in) {
380   in += 2 * WORD_INCR;
381   return ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
382 }
383 
384 static UINT4
access_08_12(const UINT4 * in)385 access_08_12 (const UINT4 *in) {
386   in += 3 * WORD_INCR;
387   return ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
388 }
389 
390 static UINT4
access_08_13(const UINT4 * in)391 access_08_13 (const UINT4 *in) {
392   in += 3 * WORD_INCR;
393   return ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
394 }
395 
396 static UINT4
access_08_14(const UINT4 * in)397 access_08_14 (const UINT4 *in) {
398   in += 3 * WORD_INCR;
399   return ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
400 }
401 
402 static UINT4
access_08_15(const UINT4 * in)403 access_08_15 (const UINT4 *in) {
404   in += 3 * WORD_INCR;
405   return ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
406 }
407 
408 
409 static UINT4
access_10_00(const UINT4 * in)410 access_10_00 (const UINT4 *in) {
411   return ( CONVERT(*in) >>  0  )   % (1U << 10 ) ;
412 }
413 
414 static UINT4
access_10_01(const UINT4 * in)415 access_10_01 (const UINT4 *in) {
416   return ( CONVERT(*in) >>  10  )   % (1U << 10 ) ;
417 }
418 
419 static UINT4
access_10_02(const UINT4 * in)420 access_10_02 (const UINT4 *in) {
421   return ( CONVERT(*in) >>  20  )   % (1U << 10 ) ;
422 }
423 
424 static UINT4
access_10_03(const UINT4 * in)425 access_10_03 (const UINT4 *in) {
426   UINT4 out;
427 
428   out = ( CONVERT(*in) >>  30  )   % (1U << 10 ) ;
429   in += 1 * WORD_INCR;
430   out |= (CONVERT(*in) % (1U<< 8 ))<<( 10 - 8 );
431   return out;
432 }
433 
434 static UINT4
access_10_04(const UINT4 * in)435 access_10_04 (const UINT4 *in) {
436   in += 1 * WORD_INCR;
437   return ( CONVERT(*in) >>  8  )   % (1U << 10 ) ;
438 }
439 
440 static UINT4
access_10_05(const UINT4 * in)441 access_10_05 (const UINT4 *in) {
442   in += 1 * WORD_INCR;
443   return ( CONVERT(*in) >>  18  )   % (1U << 10 ) ;
444 }
445 
446 static UINT4
access_10_06(const UINT4 * in)447 access_10_06 (const UINT4 *in) {
448   UINT4 out;
449 
450   in += 1 * WORD_INCR;
451   out = ( CONVERT(*in) >>  28  )   % (1U << 10 ) ;
452   in += 1 * WORD_INCR;
453   out |= (CONVERT(*in) % (1U<< 6 ))<<( 10 - 6 );
454   return out;
455 }
456 
457 static UINT4
access_10_07(const UINT4 * in)458 access_10_07 (const UINT4 *in) {
459   in += 2 * WORD_INCR;
460   return ( CONVERT(*in) >>  6  )   % (1U << 10 ) ;
461 }
462 
463 static UINT4
access_10_08(const UINT4 * in)464 access_10_08 (const UINT4 *in) {
465   in += 2 * WORD_INCR;
466   return ( CONVERT(*in) >>  16  )   % (1U << 10 ) ;
467 }
468 
469 static UINT4
access_10_09(const UINT4 * in)470 access_10_09 (const UINT4 *in) {
471   UINT4 out;
472 
473   in += 2 * WORD_INCR;
474   out = ( CONVERT(*in) >>  26  )   % (1U << 10 ) ;
475   in += 1 * WORD_INCR;
476   out |= (CONVERT(*in) % (1U<< 4 ))<<( 10 - 4 );
477   return out;
478 }
479 
480 static UINT4
access_10_10(const UINT4 * in)481 access_10_10 (const UINT4 *in) {
482   in += 3 * WORD_INCR;
483   return ( CONVERT(*in) >>  4  )   % (1U << 10 ) ;
484 }
485 
486 static UINT4
access_10_11(const UINT4 * in)487 access_10_11 (const UINT4 *in) {
488   in += 3 * WORD_INCR;
489   return ( CONVERT(*in) >>  14  )   % (1U << 10 ) ;
490 }
491 
492 static UINT4
access_10_12(const UINT4 * in)493 access_10_12 (const UINT4 *in) {
494   UINT4 out;
495 
496   in += 3 * WORD_INCR;
497   out = ( CONVERT(*in) >>  24  )   % (1U << 10 ) ;
498   in += 1 * WORD_INCR;
499   out |= (CONVERT(*in) % (1U<< 2 ))<<( 10 - 2 );
500   return out;
501 }
502 
503 static UINT4
access_10_13(const UINT4 * in)504 access_10_13 (const UINT4 *in) {
505   in += 4 * WORD_INCR;
506   return ( CONVERT(*in) >>  2  )   % (1U << 10 ) ;
507 }
508 
509 static UINT4
access_10_14(const UINT4 * in)510 access_10_14 (const UINT4 *in) {
511   in += 4 * WORD_INCR;
512   return ( CONVERT(*in) >>  12  )   % (1U << 10 ) ;
513 }
514 
515 static UINT4
access_10_15(const UINT4 * in)516 access_10_15 (const UINT4 *in) {
517   in += 4 * WORD_INCR;
518   return ( CONVERT(*in) >>  22  )   % (1U << 10 ) ;
519 }
520 
521 
522 static UINT4
access_12_00(const UINT4 * in)523 access_12_00 (const UINT4 *in) {
524   return ( CONVERT(*in) >>  0  )   % (1U << 12 ) ;
525 }
526 
527 static UINT4
access_12_01(const UINT4 * in)528 access_12_01 (const UINT4 *in) {
529   return ( CONVERT(*in) >>  12  )   % (1U << 12 ) ;
530 }
531 
532 static UINT4
access_12_02(const UINT4 * in)533 access_12_02 (const UINT4 *in) {
534   UINT4 out;
535 
536   out = ( CONVERT(*in) >>  24  )   % (1U << 12 ) ;
537   in += 1 * WORD_INCR;
538   out |= (CONVERT(*in) % (1U<< 4 ))<<( 12 - 4 );
539   return out;
540 }
541 
542 static UINT4
access_12_03(const UINT4 * in)543 access_12_03 (const UINT4 *in) {
544   in += 1 * WORD_INCR;
545   return ( CONVERT(*in) >>  4  )   % (1U << 12 ) ;
546 }
547 
548 static UINT4
access_12_04(const UINT4 * in)549 access_12_04 (const UINT4 *in) {
550   in += 1 * WORD_INCR;
551   return ( CONVERT(*in) >>  16  )   % (1U << 12 ) ;
552 }
553 
554 static UINT4
access_12_05(const UINT4 * in)555 access_12_05 (const UINT4 *in) {
556   UINT4 out;
557 
558   in += 1 * WORD_INCR;
559   out = ( CONVERT(*in) >>  28  )   % (1U << 12 ) ;
560   in += 1 * WORD_INCR;
561   out |= (CONVERT(*in) % (1U<< 8 ))<<( 12 - 8 );
562   return out;
563 }
564 
565 static UINT4
access_12_06(const UINT4 * in)566 access_12_06 (const UINT4 *in) {
567   in += 2 * WORD_INCR;
568   return ( CONVERT(*in) >>  8  )   % (1U << 12 ) ;
569 }
570 
571 static UINT4
access_12_07(const UINT4 * in)572 access_12_07 (const UINT4 *in) {
573   in += 2 * WORD_INCR;
574   return ( CONVERT(*in) >>  20  )   % (1U << 12 ) ;
575 }
576 
577 static UINT4
access_12_08(const UINT4 * in)578 access_12_08 (const UINT4 *in) {
579   in += 3 * WORD_INCR;
580   return ( CONVERT(*in) >>  0  )   % (1U << 12 ) ;
581 }
582 
583 static UINT4
access_12_09(const UINT4 * in)584 access_12_09 (const UINT4 *in) {
585   in += 3 * WORD_INCR;
586   return ( CONVERT(*in) >>  12  )   % (1U << 12 ) ;
587 }
588 
589 static UINT4
access_12_10(const UINT4 * in)590 access_12_10 (const UINT4 *in) {
591   UINT4 out;
592 
593   in += 3 * WORD_INCR;
594   out = ( CONVERT(*in) >>  24  )   % (1U << 12 ) ;
595   in += 1 * WORD_INCR;
596   out |= (CONVERT(*in) % (1U<< 4 ))<<( 12 - 4 );
597   return out;
598 }
599 
600 static UINT4
access_12_11(const UINT4 * in)601 access_12_11 (const UINT4 *in) {
602   in += 4 * WORD_INCR;
603   return ( CONVERT(*in) >>  4  )   % (1U << 12 ) ;
604 }
605 
606 static UINT4
access_12_12(const UINT4 * in)607 access_12_12 (const UINT4 *in) {
608   in += 4 * WORD_INCR;
609   return ( CONVERT(*in) >>  16  )   % (1U << 12 ) ;
610 }
611 
612 static UINT4
access_12_13(const UINT4 * in)613 access_12_13 (const UINT4 *in) {
614   UINT4 out;
615 
616   in += 4 * WORD_INCR;
617   out = ( CONVERT(*in) >>  28  )   % (1U << 12 ) ;
618   in += 1 * WORD_INCR;
619   out |= (CONVERT(*in) % (1U<< 8 ))<<( 12 - 8 );
620   return out;
621 }
622 
623 static UINT4
access_12_14(const UINT4 * in)624 access_12_14 (const UINT4 *in) {
625   in += 5 * WORD_INCR;
626   return ( CONVERT(*in) >>  8  )   % (1U << 12 ) ;
627 }
628 
629 static UINT4
access_12_15(const UINT4 * in)630 access_12_15 (const UINT4 *in) {
631   in += 5 * WORD_INCR;
632   return ( CONVERT(*in) >>  20  )   % (1U << 12 ) ;
633 }
634 
635 
636 static UINT4
access_14_00(const UINT4 * in)637 access_14_00 (const UINT4 *in) {
638   return ( CONVERT(*in) >>  0  )   % (1U << 14 ) ;
639 }
640 
641 static UINT4
access_14_01(const UINT4 * in)642 access_14_01 (const UINT4 *in) {
643   return ( CONVERT(*in) >>  14  )   % (1U << 14 ) ;
644 }
645 
646 static UINT4
access_14_02(const UINT4 * in)647 access_14_02 (const UINT4 *in) {
648   UINT4 out;
649 
650   out = ( CONVERT(*in) >>  28  )   % (1U << 14 ) ;
651   in += 1 * WORD_INCR;
652   out |= (CONVERT(*in) % (1U<< 10 ))<<( 14 - 10 );
653   return out;
654 }
655 
656 static UINT4
access_14_03(const UINT4 * in)657 access_14_03 (const UINT4 *in) {
658   in += 1 * WORD_INCR;
659   return ( CONVERT(*in) >>  10  )   % (1U << 14 ) ;
660 }
661 
662 static UINT4
access_14_04(const UINT4 * in)663 access_14_04 (const UINT4 *in) {
664   UINT4 out;
665 
666   in += 1 * WORD_INCR;
667   out = ( CONVERT(*in) >>  24  )   % (1U << 14 ) ;
668   in += 1 * WORD_INCR;
669   out |= (CONVERT(*in) % (1U<< 6 ))<<( 14 - 6 );
670   return out;
671 }
672 
673 static UINT4
access_14_05(const UINT4 * in)674 access_14_05 (const UINT4 *in) {
675   in += 2 * WORD_INCR;
676   return ( CONVERT(*in) >>  6  )   % (1U << 14 ) ;
677 }
678 
679 static UINT4
access_14_06(const UINT4 * in)680 access_14_06 (const UINT4 *in) {
681   UINT4 out;
682 
683   in += 2 * WORD_INCR;
684   out = ( CONVERT(*in) >>  20  )   % (1U << 14 ) ;
685   in += 1 * WORD_INCR;
686   out |= (CONVERT(*in) % (1U<< 2 ))<<( 14 - 2 );
687   return out;
688 }
689 
690 static UINT4
access_14_07(const UINT4 * in)691 access_14_07 (const UINT4 *in) {
692   in += 3 * WORD_INCR;
693   return ( CONVERT(*in) >>  2  )   % (1U << 14 ) ;
694 }
695 
696 static UINT4
access_14_08(const UINT4 * in)697 access_14_08 (const UINT4 *in) {
698   in += 3 * WORD_INCR;
699   return ( CONVERT(*in) >>  16  )   % (1U << 14 ) ;
700 }
701 
702 static UINT4
access_14_09(const UINT4 * in)703 access_14_09 (const UINT4 *in) {
704   UINT4 out;
705 
706   in += 3 * WORD_INCR;
707   out = ( CONVERT(*in) >>  30  )   % (1U << 14 ) ;
708   in += 1 * WORD_INCR;
709   out |= (CONVERT(*in) % (1U<< 12 ))<<( 14 - 12 );
710   return out;
711 }
712 
713 static UINT4
access_14_10(const UINT4 * in)714 access_14_10 (const UINT4 *in) {
715   in += 4 * WORD_INCR;
716   return ( CONVERT(*in) >>  12  )   % (1U << 14 ) ;
717 }
718 
719 static UINT4
access_14_11(const UINT4 * in)720 access_14_11 (const UINT4 *in) {
721   UINT4 out;
722 
723   in += 4 * WORD_INCR;
724   out = ( CONVERT(*in) >>  26  )   % (1U << 14 ) ;
725   in += 1 * WORD_INCR;
726   out |= (CONVERT(*in) % (1U<< 8 ))<<( 14 - 8 );
727   return out;
728 }
729 
730 static UINT4
access_14_12(const UINT4 * in)731 access_14_12 (const UINT4 *in) {
732   in += 5 * WORD_INCR;
733   return ( CONVERT(*in) >>  8  )   % (1U << 14 ) ;
734 }
735 
736 static UINT4
access_14_13(const UINT4 * in)737 access_14_13 (const UINT4 *in) {
738   UINT4 out;
739 
740   in += 5 * WORD_INCR;
741   out = ( CONVERT(*in) >>  22  )   % (1U << 14 ) ;
742   in += 1 * WORD_INCR;
743   out |= (CONVERT(*in) % (1U<< 4 ))<<( 14 - 4 );
744   return out;
745 }
746 
747 static UINT4
access_14_14(const UINT4 * in)748 access_14_14 (const UINT4 *in) {
749   in += 6 * WORD_INCR;
750   return ( CONVERT(*in) >>  4  )   % (1U << 14 ) ;
751 }
752 
753 static UINT4
access_14_15(const UINT4 * in)754 access_14_15 (const UINT4 *in) {
755   in += 6 * WORD_INCR;
756   return ( CONVERT(*in) >>  18  )   % (1U << 14 ) ;
757 }
758 
759 
760 static UINT4
access_16_00(const UINT4 * in)761 access_16_00 (const UINT4 *in) {
762   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
763 }
764 
765 static UINT4
access_16_01(const UINT4 * in)766 access_16_01 (const UINT4 *in) {
767   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
768 }
769 
770 static UINT4
access_16_02(const UINT4 * in)771 access_16_02 (const UINT4 *in) {
772   in += 1 * WORD_INCR;
773   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
774 }
775 
776 static UINT4
access_16_03(const UINT4 * in)777 access_16_03 (const UINT4 *in) {
778   in += 1 * WORD_INCR;
779   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
780 }
781 
782 static UINT4
access_16_04(const UINT4 * in)783 access_16_04 (const UINT4 *in) {
784   in += 2 * WORD_INCR;
785   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
786 }
787 
788 static UINT4
access_16_05(const UINT4 * in)789 access_16_05 (const UINT4 *in) {
790   in += 2 * WORD_INCR;
791   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
792 }
793 
794 static UINT4
access_16_06(const UINT4 * in)795 access_16_06 (const UINT4 *in) {
796   in += 3 * WORD_INCR;
797   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
798 }
799 
800 static UINT4
access_16_07(const UINT4 * in)801 access_16_07 (const UINT4 *in) {
802   in += 3 * WORD_INCR;
803   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
804 }
805 
806 static UINT4
access_16_08(const UINT4 * in)807 access_16_08 (const UINT4 *in) {
808   in += 4 * WORD_INCR;
809   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
810 }
811 
812 static UINT4
access_16_09(const UINT4 * in)813 access_16_09 (const UINT4 *in) {
814   in += 4 * WORD_INCR;
815   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
816 }
817 
818 static UINT4
access_16_10(const UINT4 * in)819 access_16_10 (const UINT4 *in) {
820   in += 5 * WORD_INCR;
821   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
822 }
823 
824 static UINT4
access_16_11(const UINT4 * in)825 access_16_11 (const UINT4 *in) {
826   in += 5 * WORD_INCR;
827   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
828 }
829 
830 static UINT4
access_16_12(const UINT4 * in)831 access_16_12 (const UINT4 *in) {
832   in += 6 * WORD_INCR;
833   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
834 }
835 
836 static UINT4
access_16_13(const UINT4 * in)837 access_16_13 (const UINT4 *in) {
838   in += 6 * WORD_INCR;
839   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
840 }
841 
842 static UINT4
access_16_14(const UINT4 * in)843 access_16_14 (const UINT4 *in) {
844   in += 7 * WORD_INCR;
845   return ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
846 }
847 
848 static UINT4
access_16_15(const UINT4 * in)849 access_16_15 (const UINT4 *in) {
850   in += 7 * WORD_INCR;
851   return ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
852 }
853 
854 
855 static UINT4
access_18_00(const UINT4 * in)856 access_18_00 (const UINT4 *in) {
857   return ( CONVERT(*in) >>  0  )   % (1U << 18 ) ;
858 }
859 
860 static UINT4
access_18_01(const UINT4 * in)861 access_18_01 (const UINT4 *in) {
862   UINT4 out;
863 
864   out = ( CONVERT(*in) >>  18  )   % (1U << 18 ) ;
865   in += 1 * WORD_INCR;
866   out |= (CONVERT(*in) % (1U<< 4 ))<<( 18 - 4 );
867   return out;
868 }
869 
870 static UINT4
access_18_02(const UINT4 * in)871 access_18_02 (const UINT4 *in) {
872   in += 1 * WORD_INCR;
873   return ( CONVERT(*in) >>  4  )   % (1U << 18 ) ;
874 }
875 
876 static UINT4
access_18_03(const UINT4 * in)877 access_18_03 (const UINT4 *in) {
878   UINT4 out;
879 
880   in += 1 * WORD_INCR;
881   out = ( CONVERT(*in) >>  22  )   % (1U << 18 ) ;
882   in += 1 * WORD_INCR;
883   out |= (CONVERT(*in) % (1U<< 8 ))<<( 18 - 8 );
884   return out;
885 }
886 
887 static UINT4
access_18_04(const UINT4 * in)888 access_18_04 (const UINT4 *in) {
889   in += 2 * WORD_INCR;
890   return ( CONVERT(*in) >>  8  )   % (1U << 18 ) ;
891 }
892 
893 static UINT4
access_18_05(const UINT4 * in)894 access_18_05 (const UINT4 *in) {
895   UINT4 out;
896 
897   in += 2 * WORD_INCR;
898   out = ( CONVERT(*in) >>  26  )   % (1U << 18 ) ;
899   in += 1 * WORD_INCR;
900   out |= (CONVERT(*in) % (1U<< 12 ))<<( 18 - 12 );
901   return out;
902 }
903 
904 static UINT4
access_18_06(const UINT4 * in)905 access_18_06 (const UINT4 *in) {
906   in += 3 * WORD_INCR;
907   return ( CONVERT(*in) >>  12  )   % (1U << 18 ) ;
908 }
909 
910 static UINT4
access_18_07(const UINT4 * in)911 access_18_07 (const UINT4 *in) {
912   UINT4 out;
913 
914   in += 3 * WORD_INCR;
915   out = ( CONVERT(*in) >>  30  )   % (1U << 18 ) ;
916   in += 1 * WORD_INCR;
917   out |= (CONVERT(*in) % (1U<< 16 ))<<( 18 - 16 );
918   return out;
919 }
920 
921 static UINT4
access_18_08(const UINT4 * in)922 access_18_08 (const UINT4 *in) {
923   UINT4 out;
924 
925   in += 4 * WORD_INCR;
926   out = ( CONVERT(*in) >>  16  )   % (1U << 18 ) ;
927   in += 1 * WORD_INCR;
928   out |= (CONVERT(*in) % (1U<< 2 ))<<( 18 - 2 );
929   return out;
930 }
931 
932 static UINT4
access_18_09(const UINT4 * in)933 access_18_09 (const UINT4 *in) {
934   in += 5 * WORD_INCR;
935   return ( CONVERT(*in) >>  2  )   % (1U << 18 ) ;
936 }
937 
938 static UINT4
access_18_10(const UINT4 * in)939 access_18_10 (const UINT4 *in) {
940   UINT4 out;
941 
942   in += 5 * WORD_INCR;
943   out = ( CONVERT(*in) >>  20  )   % (1U << 18 ) ;
944   in += 1 * WORD_INCR;
945   out |= (CONVERT(*in) % (1U<< 6 ))<<( 18 - 6 );
946   return out;
947 }
948 
949 static UINT4
access_18_11(const UINT4 * in)950 access_18_11 (const UINT4 *in) {
951   in += 6 * WORD_INCR;
952   return ( CONVERT(*in) >>  6  )   % (1U << 18 ) ;
953 }
954 
955 static UINT4
access_18_12(const UINT4 * in)956 access_18_12 (const UINT4 *in) {
957   UINT4 out;
958 
959   in += 6 * WORD_INCR;
960   out = ( CONVERT(*in) >>  24  )   % (1U << 18 ) ;
961   in += 1 * WORD_INCR;
962   out |= (CONVERT(*in) % (1U<< 10 ))<<( 18 - 10 );
963   return out;
964 }
965 
966 static UINT4
access_18_13(const UINT4 * in)967 access_18_13 (const UINT4 *in) {
968   in += 7 * WORD_INCR;
969   return ( CONVERT(*in) >>  10  )   % (1U << 18 ) ;
970 }
971 
972 static UINT4
access_18_14(const UINT4 * in)973 access_18_14 (const UINT4 *in) {
974   UINT4 out;
975 
976   in += 7 * WORD_INCR;
977   out = ( CONVERT(*in) >>  28  )   % (1U << 18 ) ;
978   in += 1 * WORD_INCR;
979   out |= (CONVERT(*in) % (1U<< 14 ))<<( 18 - 14 );
980   return out;
981 }
982 
983 static UINT4
access_18_15(const UINT4 * in)984 access_18_15 (const UINT4 *in) {
985   in += 8 * WORD_INCR;
986   return ( CONVERT(*in) >>  14  )   % (1U << 18 ) ;
987 }
988 
989 
990 static UINT4
access_20_00(const UINT4 * in)991 access_20_00 (const UINT4 *in) {
992   return ( CONVERT(*in) >>  0  )   % (1U << 20 ) ;
993 }
994 
995 static UINT4
access_20_01(const UINT4 * in)996 access_20_01 (const UINT4 *in) {
997   UINT4 out;
998 
999   out = ( CONVERT(*in) >>  20  )   % (1U << 20 ) ;
1000   in += 1 * WORD_INCR;
1001   out |= (CONVERT(*in) % (1U<< 8 ))<<( 20 - 8 );
1002   return out;
1003 }
1004 
1005 static UINT4
access_20_02(const UINT4 * in)1006 access_20_02 (const UINT4 *in) {
1007   in += 1 * WORD_INCR;
1008   return ( CONVERT(*in) >>  8  )   % (1U << 20 ) ;
1009 }
1010 
1011 static UINT4
access_20_03(const UINT4 * in)1012 access_20_03 (const UINT4 *in) {
1013   UINT4 out;
1014 
1015   in += 1 * WORD_INCR;
1016   out = ( CONVERT(*in) >>  28  )   % (1U << 20 ) ;
1017   in += 1 * WORD_INCR;
1018   out |= (CONVERT(*in) % (1U<< 16 ))<<( 20 - 16 );
1019   return out;
1020 }
1021 
1022 static UINT4
access_20_04(const UINT4 * in)1023 access_20_04 (const UINT4 *in) {
1024   UINT4 out;
1025 
1026   in += 2 * WORD_INCR;
1027   out = ( CONVERT(*in) >>  16  )   % (1U << 20 ) ;
1028   in += 1 * WORD_INCR;
1029   out |= (CONVERT(*in) % (1U<< 4 ))<<( 20 - 4 );
1030   return out;
1031 }
1032 
1033 static UINT4
access_20_05(const UINT4 * in)1034 access_20_05 (const UINT4 *in) {
1035   in += 3 * WORD_INCR;
1036   return ( CONVERT(*in) >>  4  )   % (1U << 20 ) ;
1037 }
1038 
1039 static UINT4
access_20_06(const UINT4 * in)1040 access_20_06 (const UINT4 *in) {
1041   UINT4 out;
1042 
1043   in += 3 * WORD_INCR;
1044   out = ( CONVERT(*in) >>  24  )   % (1U << 20 ) ;
1045   in += 1 * WORD_INCR;
1046   out |= (CONVERT(*in) % (1U<< 12 ))<<( 20 - 12 );
1047   return out;
1048 }
1049 
1050 static UINT4
access_20_07(const UINT4 * in)1051 access_20_07 (const UINT4 *in) {
1052   in += 4 * WORD_INCR;
1053   return ( CONVERT(*in) >>  12  )   % (1U << 20 ) ;
1054 }
1055 
1056 static UINT4
access_20_08(const UINT4 * in)1057 access_20_08 (const UINT4 *in) {
1058   in += 5 * WORD_INCR;
1059   return ( CONVERT(*in) >>  0  )   % (1U << 20 ) ;
1060 }
1061 
1062 static UINT4
access_20_09(const UINT4 * in)1063 access_20_09 (const UINT4 *in) {
1064   UINT4 out;
1065 
1066   in += 5 * WORD_INCR;
1067   out = ( CONVERT(*in) >>  20  )   % (1U << 20 ) ;
1068   in += 1 * WORD_INCR;
1069   out |= (CONVERT(*in) % (1U<< 8 ))<<( 20 - 8 );
1070   return out;
1071 }
1072 
1073 static UINT4
access_20_10(const UINT4 * in)1074 access_20_10 (const UINT4 *in) {
1075   in += 6 * WORD_INCR;
1076   return ( CONVERT(*in) >>  8  )   % (1U << 20 ) ;
1077 }
1078 
1079 static UINT4
access_20_11(const UINT4 * in)1080 access_20_11 (const UINT4 *in) {
1081   UINT4 out;
1082 
1083   in += 6 * WORD_INCR;
1084   out = ( CONVERT(*in) >>  28  )   % (1U << 20 ) ;
1085   in += 1 * WORD_INCR;
1086   out |= (CONVERT(*in) % (1U<< 16 ))<<( 20 - 16 );
1087   return out;
1088 }
1089 
1090 static UINT4
access_20_12(const UINT4 * in)1091 access_20_12 (const UINT4 *in) {
1092   UINT4 out;
1093 
1094   in += 7 * WORD_INCR;
1095   out = ( CONVERT(*in) >>  16  )   % (1U << 20 ) ;
1096   in += 1 * WORD_INCR;
1097   out |= (CONVERT(*in) % (1U<< 4 ))<<( 20 - 4 );
1098   return out;
1099 }
1100 
1101 static UINT4
access_20_13(const UINT4 * in)1102 access_20_13 (const UINT4 *in) {
1103   in += 8 * WORD_INCR;
1104   return ( CONVERT(*in) >>  4  )   % (1U << 20 ) ;
1105 }
1106 
1107 static UINT4
access_20_14(const UINT4 * in)1108 access_20_14 (const UINT4 *in) {
1109   UINT4 out;
1110 
1111   in += 8 * WORD_INCR;
1112   out = ( CONVERT(*in) >>  24  )   % (1U << 20 ) ;
1113   in += 1 * WORD_INCR;
1114   out |= (CONVERT(*in) % (1U<< 12 ))<<( 20 - 12 );
1115   return out;
1116 }
1117 
1118 static UINT4
access_20_15(const UINT4 * in)1119 access_20_15 (const UINT4 *in) {
1120   in += 9 * WORD_INCR;
1121   return ( CONVERT(*in) >>  12  )   % (1U << 20 ) ;
1122 }
1123 
1124 
1125 static UINT4
access_22_00(const UINT4 * in)1126 access_22_00 (const UINT4 *in) {
1127   return ( CONVERT(*in) >>  0  )   % (1U << 22 ) ;
1128 }
1129 
1130 static UINT4
access_22_01(const UINT4 * in)1131 access_22_01 (const UINT4 *in) {
1132   UINT4 out;
1133 
1134   out = ( CONVERT(*in) >>  22  )   % (1U << 22 ) ;
1135   in += 1 * WORD_INCR;
1136   out |= (CONVERT(*in) % (1U<< 12 ))<<( 22 - 12 );
1137   return out;
1138 }
1139 
1140 static UINT4
access_22_02(const UINT4 * in)1141 access_22_02 (const UINT4 *in) {
1142   UINT4 out;
1143 
1144   in += 1 * WORD_INCR;
1145   out = ( CONVERT(*in) >>  12  )   % (1U << 22 ) ;
1146   in += 1 * WORD_INCR;
1147   out |= (CONVERT(*in) % (1U<< 2 ))<<( 22 - 2 );
1148   return out;
1149 }
1150 
1151 static UINT4
access_22_03(const UINT4 * in)1152 access_22_03 (const UINT4 *in) {
1153   in += 2 * WORD_INCR;
1154   return ( CONVERT(*in) >>  2  )   % (1U << 22 ) ;
1155 }
1156 
1157 static UINT4
access_22_04(const UINT4 * in)1158 access_22_04 (const UINT4 *in) {
1159   UINT4 out;
1160 
1161   in += 2 * WORD_INCR;
1162   out = ( CONVERT(*in) >>  24  )   % (1U << 22 ) ;
1163   in += 1 * WORD_INCR;
1164   out |= (CONVERT(*in) % (1U<< 14 ))<<( 22 - 14 );
1165   return out;
1166 }
1167 
1168 static UINT4
access_22_05(const UINT4 * in)1169 access_22_05 (const UINT4 *in) {
1170   UINT4 out;
1171 
1172   in += 3 * WORD_INCR;
1173   out = ( CONVERT(*in) >>  14  )   % (1U << 22 ) ;
1174   in += 1 * WORD_INCR;
1175   out |= (CONVERT(*in) % (1U<< 4 ))<<( 22 - 4 );
1176   return out;
1177 }
1178 
1179 static UINT4
access_22_06(const UINT4 * in)1180 access_22_06 (const UINT4 *in) {
1181   in += 4 * WORD_INCR;
1182   return ( CONVERT(*in) >>  4  )   % (1U << 22 ) ;
1183 }
1184 
1185 static UINT4
access_22_07(const UINT4 * in)1186 access_22_07 (const UINT4 *in) {
1187   UINT4 out;
1188 
1189   in += 4 * WORD_INCR;
1190   out = ( CONVERT(*in) >>  26  )   % (1U << 22 ) ;
1191   in += 1 * WORD_INCR;
1192   out |= (CONVERT(*in) % (1U<< 16 ))<<( 22 - 16 );
1193   return out;
1194 }
1195 
1196 static UINT4
access_22_08(const UINT4 * in)1197 access_22_08 (const UINT4 *in) {
1198   UINT4 out;
1199 
1200   in += 5 * WORD_INCR;
1201   out = ( CONVERT(*in) >>  16  )   % (1U << 22 ) ;
1202   in += 1 * WORD_INCR;
1203   out |= (CONVERT(*in) % (1U<< 6 ))<<( 22 - 6 );
1204   return out;
1205 }
1206 
1207 static UINT4
access_22_09(const UINT4 * in)1208 access_22_09 (const UINT4 *in) {
1209   in += 6 * WORD_INCR;
1210   return ( CONVERT(*in) >>  6  )   % (1U << 22 ) ;
1211 }
1212 
1213 static UINT4
access_22_10(const UINT4 * in)1214 access_22_10 (const UINT4 *in) {
1215   UINT4 out;
1216 
1217   in += 6 * WORD_INCR;
1218   out = ( CONVERT(*in) >>  28  )   % (1U << 22 ) ;
1219   in += 1 * WORD_INCR;
1220   out |= (CONVERT(*in) % (1U<< 18 ))<<( 22 - 18 );
1221   return out;
1222 }
1223 
1224 static UINT4
access_22_11(const UINT4 * in)1225 access_22_11 (const UINT4 *in) {
1226   UINT4 out;
1227 
1228   in += 7 * WORD_INCR;
1229   out = ( CONVERT(*in) >>  18  )   % (1U << 22 ) ;
1230   in += 1 * WORD_INCR;
1231   out |= (CONVERT(*in) % (1U<< 8 ))<<( 22 - 8 );
1232   return out;
1233 }
1234 
1235 static UINT4
access_22_12(const UINT4 * in)1236 access_22_12 (const UINT4 *in) {
1237   in += 8 * WORD_INCR;
1238   return ( CONVERT(*in) >>  8  )   % (1U << 22 ) ;
1239 }
1240 
1241 static UINT4
access_22_13(const UINT4 * in)1242 access_22_13 (const UINT4 *in) {
1243   UINT4 out;
1244 
1245   in += 8 * WORD_INCR;
1246   out = ( CONVERT(*in) >>  30  )   % (1U << 22 ) ;
1247   in += 1 * WORD_INCR;
1248   out |= (CONVERT(*in) % (1U<< 20 ))<<( 22 - 20 );
1249   return out;
1250 }
1251 
1252 static UINT4
access_22_14(const UINT4 * in)1253 access_22_14 (const UINT4 *in) {
1254   UINT4 out;
1255 
1256   in += 9 * WORD_INCR;
1257   out = ( CONVERT(*in) >>  20  )   % (1U << 22 ) ;
1258   in += 1 * WORD_INCR;
1259   out |= (CONVERT(*in) % (1U<< 10 ))<<( 22 - 10 );
1260   return out;
1261 }
1262 
1263 static UINT4
access_22_15(const UINT4 * in)1264 access_22_15 (const UINT4 *in) {
1265   in += 10 * WORD_INCR;
1266   return ( CONVERT(*in) >>  10  )   % (1U << 22 ) ;
1267 }
1268 
1269 
1270 
1271 static UINT4
access_24_00(const UINT4 * in)1272 access_24_00 (const UINT4 *in) {
1273   return ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
1274 }
1275 
1276 static UINT4
access_24_01(const UINT4 * in)1277 access_24_01 (const UINT4 *in) {
1278   UINT4 out;
1279 
1280   out = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
1281   in += 1 * WORD_INCR;
1282   out |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
1283   return out;
1284 }
1285 
1286 static UINT4
access_24_02(const UINT4 * in)1287 access_24_02 (const UINT4 *in) {
1288   UINT4 out;
1289 
1290   in += 1 * WORD_INCR;
1291   out = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
1292   in += 1 * WORD_INCR;
1293   out |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
1294   return out;
1295 }
1296 
1297 static UINT4
access_24_03(const UINT4 * in)1298 access_24_03 (const UINT4 *in) {
1299   in += 2 * WORD_INCR;
1300   return ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
1301 }
1302 
1303 static UINT4
access_24_04(const UINT4 * in)1304 access_24_04 (const UINT4 *in) {
1305   in += 3 * WORD_INCR;
1306   return ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
1307 }
1308 
1309 static UINT4
access_24_05(const UINT4 * in)1310 access_24_05 (const UINT4 *in) {
1311   UINT4 out;
1312 
1313   in += 3 * WORD_INCR;
1314   out = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
1315   in += 1 * WORD_INCR;
1316   out |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
1317   return out;
1318 }
1319 
1320 static UINT4
access_24_06(const UINT4 * in)1321 access_24_06 (const UINT4 *in) {
1322   UINT4 out;
1323 
1324   in += 4 * WORD_INCR;
1325   out = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
1326   in += 1 * WORD_INCR;
1327   out |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
1328   return out;
1329 }
1330 
1331 static UINT4
access_24_07(const UINT4 * in)1332 access_24_07 (const UINT4 *in) {
1333   in += 5 * WORD_INCR;
1334   return ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
1335 }
1336 
1337 static UINT4
access_24_08(const UINT4 * in)1338 access_24_08 (const UINT4 *in) {
1339   in += 6 * WORD_INCR;
1340   return ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
1341 }
1342 
1343 static UINT4
access_24_09(const UINT4 * in)1344 access_24_09 (const UINT4 *in) {
1345   UINT4 out;
1346 
1347   in += 6 * WORD_INCR;
1348   out = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
1349   in += 1 * WORD_INCR;
1350   out |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
1351   return out;
1352 }
1353 
1354 static UINT4
access_24_10(const UINT4 * in)1355 access_24_10 (const UINT4 *in) {
1356   UINT4 out;
1357 
1358   in += 7 * WORD_INCR;
1359   out = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
1360   in += 1 * WORD_INCR;
1361   out |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
1362   return out;
1363 }
1364 
1365 static UINT4
access_24_11(const UINT4 * in)1366 access_24_11 (const UINT4 *in) {
1367   in += 8 * WORD_INCR;
1368   return ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
1369 }
1370 
1371 static UINT4
access_24_12(const UINT4 * in)1372 access_24_12 (const UINT4 *in) {
1373   in += 9 * WORD_INCR;
1374   return ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
1375 }
1376 
1377 static UINT4
access_24_13(const UINT4 * in)1378 access_24_13 (const UINT4 *in) {
1379   UINT4 out;
1380 
1381   in += 9 * WORD_INCR;
1382   out = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
1383   in += 1 * WORD_INCR;
1384   out |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
1385   return out;
1386 }
1387 
1388 static UINT4
access_24_14(const UINT4 * in)1389 access_24_14 (const UINT4 *in) {
1390   UINT4 out;
1391 
1392   in += 10 * WORD_INCR;
1393   out = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
1394   in += 1 * WORD_INCR;
1395   out |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
1396   return out;
1397 }
1398 
1399 static UINT4
access_24_15(const UINT4 * in)1400 access_24_15 (const UINT4 *in) {
1401   in += 11 * WORD_INCR;
1402   return ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
1403 }
1404 
1405 
1406 
1407 static UINT4
access_26_00(const UINT4 * in)1408 access_26_00 (const UINT4 *in) {
1409   return ( CONVERT(*in) >>  0  )   % (1U << 26 ) ;
1410 }
1411 
1412 static UINT4
access_26_01(const UINT4 * in)1413 access_26_01 (const UINT4 *in) {
1414   UINT4 out;
1415 
1416   out = ( CONVERT(*in) >>  26  )   % (1U << 26 ) ;
1417   in += 1 * WORD_INCR;
1418   out |= (CONVERT(*in) % (1U<< 20 ))<<( 26 - 20 );
1419   return out;
1420 }
1421 
1422 static UINT4
access_26_02(const UINT4 * in)1423 access_26_02 (const UINT4 *in) {
1424   UINT4 out;
1425 
1426   in += 1 * WORD_INCR;
1427   out = ( CONVERT(*in) >>  20  )   % (1U << 26 ) ;
1428   in += 1 * WORD_INCR;
1429   out |= (CONVERT(*in) % (1U<< 14 ))<<( 26 - 14 );
1430   return out;
1431 }
1432 
1433 static UINT4
access_26_03(const UINT4 * in)1434 access_26_03 (const UINT4 *in) {
1435   UINT4 out;
1436 
1437   in += 2 * WORD_INCR;
1438   out = ( CONVERT(*in) >>  14  )   % (1U << 26 ) ;
1439   in += 1 * WORD_INCR;
1440   out |= (CONVERT(*in) % (1U<< 8 ))<<( 26 - 8 );
1441   return out;
1442 }
1443 
1444 static UINT4
access_26_04(const UINT4 * in)1445 access_26_04 (const UINT4 *in) {
1446   UINT4 out;
1447 
1448   in += 3 * WORD_INCR;
1449   out = ( CONVERT(*in) >>  8  )   % (1U << 26 ) ;
1450   in += 1 * WORD_INCR;
1451   out |= (CONVERT(*in) % (1U<< 2 ))<<( 26 - 2 );
1452   return out;
1453 }
1454 
1455 static UINT4
access_26_05(const UINT4 * in)1456 access_26_05 (const UINT4 *in) {
1457   in += 4 * WORD_INCR;
1458   return ( CONVERT(*in) >>  2  )   % (1U << 26 ) ;
1459 }
1460 
1461 static UINT4
access_26_06(const UINT4 * in)1462 access_26_06 (const UINT4 *in) {
1463   UINT4 out;
1464 
1465   in += 4 * WORD_INCR;
1466   out = ( CONVERT(*in) >>  28  )   % (1U << 26 ) ;
1467   in += 1 * WORD_INCR;
1468   out |= (CONVERT(*in) % (1U<< 22 ))<<( 26 - 22 );
1469   return out;
1470 }
1471 
1472 static UINT4
access_26_07(const UINT4 * in)1473 access_26_07 (const UINT4 *in) {
1474   UINT4 out;
1475 
1476   in += 5 * WORD_INCR;
1477   out = ( CONVERT(*in) >>  22  )   % (1U << 26 ) ;
1478   in += 1 * WORD_INCR;
1479   out |= (CONVERT(*in) % (1U<< 16 ))<<( 26 - 16 );
1480   return out;
1481 }
1482 
1483 static UINT4
access_26_08(const UINT4 * in)1484 access_26_08 (const UINT4 *in) {
1485   UINT4 out;
1486 
1487   in += 6 * WORD_INCR;
1488   out = ( CONVERT(*in) >>  16  )   % (1U << 26 ) ;
1489   in += 1 * WORD_INCR;
1490   out |= (CONVERT(*in) % (1U<< 10 ))<<( 26 - 10 );
1491   return out;
1492 }
1493 
1494 static UINT4
access_26_09(const UINT4 * in)1495 access_26_09 (const UINT4 *in) {
1496   UINT4 out;
1497 
1498   in += 7 * WORD_INCR;
1499   out = ( CONVERT(*in) >>  10  )   % (1U << 26 ) ;
1500   in += 1 * WORD_INCR;
1501   out |= (CONVERT(*in) % (1U<< 4 ))<<( 26 - 4 );
1502   return out;
1503 }
1504 
1505 static UINT4
access_26_10(const UINT4 * in)1506 access_26_10 (const UINT4 *in) {
1507   in += 8 * WORD_INCR;
1508   return ( CONVERT(*in) >>  4  )   % (1U << 26 ) ;
1509 }
1510 
1511 static UINT4
access_26_11(const UINT4 * in)1512 access_26_11 (const UINT4 *in) {
1513   UINT4 out;
1514 
1515   in += 8 * WORD_INCR;
1516   out = ( CONVERT(*in) >>  30  )   % (1U << 26 ) ;
1517   in += 1 * WORD_INCR;
1518   out |= (CONVERT(*in) % (1U<< 24 ))<<( 26 - 24 );
1519   return out;
1520 }
1521 
1522 static UINT4
access_26_12(const UINT4 * in)1523 access_26_12 (const UINT4 *in) {
1524   UINT4 out;
1525 
1526   in += 9 * WORD_INCR;
1527   out = ( CONVERT(*in) >>  24  )   % (1U << 26 ) ;
1528   in += 1 * WORD_INCR;
1529   out |= (CONVERT(*in) % (1U<< 18 ))<<( 26 - 18 );
1530   return out;
1531 }
1532 
1533 static UINT4
access_26_13(const UINT4 * in)1534 access_26_13 (const UINT4 *in) {
1535   UINT4 out;
1536 
1537   in += 10 * WORD_INCR;
1538   out = ( CONVERT(*in) >>  18  )   % (1U << 26 ) ;
1539   in += 1 * WORD_INCR;
1540   out |= (CONVERT(*in) % (1U<< 12 ))<<( 26 - 12 );
1541   return out;
1542 }
1543 
1544 static UINT4
access_26_14(const UINT4 * in)1545 access_26_14 (const UINT4 *in) {
1546   UINT4 out;
1547 
1548   in += 11 * WORD_INCR;
1549   out = ( CONVERT(*in) >>  12  )   % (1U << 26 ) ;
1550   in += 1 * WORD_INCR;
1551   out |= (CONVERT(*in) % (1U<< 6 ))<<( 26 - 6 );
1552   return out;
1553 }
1554 
1555 static UINT4
access_26_15(const UINT4 * in)1556 access_26_15 (const UINT4 *in) {
1557   in += 12 * WORD_INCR;
1558   return ( CONVERT(*in) >>  6  )   % (1U << 26 ) ;
1559 }
1560 
1561 
1562 static UINT4
access_28_00(const UINT4 * in)1563 access_28_00 (const UINT4 *in) {
1564   return ( CONVERT(*in) >>  0  )   % (1U << 28 ) ;
1565 }
1566 
1567 static UINT4
access_28_01(const UINT4 * in)1568 access_28_01 (const UINT4 *in) {
1569   UINT4 out;
1570 
1571   out = ( CONVERT(*in) >>  28  )   % (1U << 28 ) ;
1572   in += 1 * WORD_INCR;
1573   out |= (CONVERT(*in) % (1U<< 24 ))<<( 28 - 24 );
1574   return out;
1575 }
1576 
1577 static UINT4
access_28_02(const UINT4 * in)1578 access_28_02 (const UINT4 *in) {
1579   UINT4 out;
1580 
1581   in += 1 * WORD_INCR;
1582   out = ( CONVERT(*in) >>  24  )   % (1U << 28 ) ;
1583   in += 1 * WORD_INCR;
1584   out |= (CONVERT(*in) % (1U<< 20 ))<<( 28 - 20 );
1585   return out;
1586 }
1587 
1588 static UINT4
access_28_03(const UINT4 * in)1589 access_28_03 (const UINT4 *in) {
1590   UINT4 out;
1591 
1592   in += 2 * WORD_INCR;
1593   out = ( CONVERT(*in) >>  20  )   % (1U << 28 ) ;
1594   in += 1 * WORD_INCR;
1595   out |= (CONVERT(*in) % (1U<< 16 ))<<( 28 - 16 );
1596   return out;
1597 }
1598 
1599 static UINT4
access_28_04(const UINT4 * in)1600 access_28_04 (const UINT4 *in) {
1601   UINT4 out;
1602 
1603   in += 3 * WORD_INCR;
1604   out = ( CONVERT(*in) >>  16  )   % (1U << 28 ) ;
1605   in += 1 * WORD_INCR;
1606   out |= (CONVERT(*in) % (1U<< 12 ))<<( 28 - 12 );
1607   return out;
1608 }
1609 
1610 static UINT4
access_28_05(const UINT4 * in)1611 access_28_05 (const UINT4 *in) {
1612   UINT4 out;
1613 
1614   in += 4 * WORD_INCR;
1615   out = ( CONVERT(*in) >>  12  )   % (1U << 28 ) ;
1616   in += 1 * WORD_INCR;
1617   out |= (CONVERT(*in) % (1U<< 8 ))<<( 28 - 8 );
1618   return out;
1619 }
1620 
1621 static UINT4
access_28_06(const UINT4 * in)1622 access_28_06 (const UINT4 *in) {
1623   UINT4 out;
1624 
1625   in += 5 * WORD_INCR;
1626   out = ( CONVERT(*in) >>  8  )   % (1U << 28 ) ;
1627   in += 1 * WORD_INCR;
1628   out |= (CONVERT(*in) % (1U<< 4 ))<<( 28 - 4 );
1629   return out;
1630 }
1631 
1632 static UINT4
access_28_07(const UINT4 * in)1633 access_28_07 (const UINT4 *in) {
1634   in += 6 * WORD_INCR;
1635   return ( CONVERT(*in) >>  4  )   % (1U << 28 ) ;
1636 }
1637 
1638 static UINT4
access_28_08(const UINT4 * in)1639 access_28_08 (const UINT4 *in) {
1640   in += 7 * WORD_INCR;
1641   return ( CONVERT(*in) >>  0  )   % (1U << 28 ) ;
1642 }
1643 
1644 static UINT4
access_28_09(const UINT4 * in)1645 access_28_09 (const UINT4 *in) {
1646   UINT4 out;
1647 
1648   in += 7 * WORD_INCR;
1649   out = ( CONVERT(*in) >>  28  )   % (1U << 28 ) ;
1650   in += 1 * WORD_INCR;
1651   out |= (CONVERT(*in) % (1U<< 24 ))<<( 28 - 24 );
1652   return out;
1653 }
1654 
1655 static UINT4
access_28_10(const UINT4 * in)1656 access_28_10 (const UINT4 *in) {
1657   UINT4 out;
1658 
1659   in += 8 * WORD_INCR;
1660   out = ( CONVERT(*in) >>  24  )   % (1U << 28 ) ;
1661   in += 1 * WORD_INCR;
1662   out |= (CONVERT(*in) % (1U<< 20 ))<<( 28 - 20 );
1663   return out;
1664 }
1665 
1666 static UINT4
access_28_11(const UINT4 * in)1667 access_28_11 (const UINT4 *in) {
1668   UINT4 out;
1669 
1670   in += 9 * WORD_INCR;
1671   out = ( CONVERT(*in) >>  20  )   % (1U << 28 ) ;
1672   in += 1 * WORD_INCR;
1673   out |= (CONVERT(*in) % (1U<< 16 ))<<( 28 - 16 );
1674   return out;
1675 }
1676 
1677 static UINT4
access_28_12(const UINT4 * in)1678 access_28_12 (const UINT4 *in) {
1679   UINT4 out;
1680 
1681   in += 10 * WORD_INCR;
1682   out = ( CONVERT(*in) >>  16  )   % (1U << 28 ) ;
1683   in += 1 * WORD_INCR;
1684   out |= (CONVERT(*in) % (1U<< 12 ))<<( 28 - 12 );
1685   return out;
1686 }
1687 
1688 static UINT4
access_28_13(const UINT4 * in)1689 access_28_13 (const UINT4 *in) {
1690   UINT4 out;
1691 
1692   in += 11 * WORD_INCR;
1693   out = ( CONVERT(*in) >>  12  )   % (1U << 28 ) ;
1694   in += 1 * WORD_INCR;
1695   out |= (CONVERT(*in) % (1U<< 8 ))<<( 28 - 8 );
1696   return out;
1697 }
1698 
1699 static UINT4
access_28_14(const UINT4 * in)1700 access_28_14 (const UINT4 *in) {
1701   UINT4 out;
1702 
1703   in += 12 * WORD_INCR;
1704   out = ( CONVERT(*in) >>  8  )   % (1U << 28 ) ;
1705   in += 1 * WORD_INCR;
1706   out |= (CONVERT(*in) % (1U<< 4 ))<<( 28 - 4 );
1707   return out;
1708 }
1709 
1710 static UINT4
access_28_15(const UINT4 * in)1711 access_28_15 (const UINT4 *in) {
1712   in += 13 * WORD_INCR;
1713   return ( CONVERT(*in) >>  4  )   % (1U << 28 ) ;
1714 }
1715 
1716 
1717 static UINT4
access_30_00(const UINT4 * in)1718 access_30_00 (const UINT4 *in) {
1719   return ( CONVERT(*in) >>  0  )   % (1U << 30 ) ;
1720 }
1721 
1722 static UINT4
access_30_01(const UINT4 * in)1723 access_30_01 (const UINT4 *in) {
1724   UINT4 out;
1725 
1726   out = ( CONVERT(*in) >>  30  )   % (1U << 30 ) ;
1727   in += 1 * WORD_INCR;
1728   out |= (CONVERT(*in) % (1U<< 28 ))<<( 30 - 28 );
1729   return out;
1730 }
1731 
1732 static UINT4
access_30_02(const UINT4 * in)1733 access_30_02 (const UINT4 *in) {
1734   UINT4 out;
1735 
1736   in += 1 * WORD_INCR;
1737   out = ( CONVERT(*in) >>  28  )   % (1U << 30 ) ;
1738   in += 1 * WORD_INCR;
1739   out |= (CONVERT(*in) % (1U<< 26 ))<<( 30 - 26 );
1740   return out;
1741 }
1742 
1743 static UINT4
access_30_03(const UINT4 * in)1744 access_30_03 (const UINT4 *in) {
1745   UINT4 out;
1746 
1747   in += 2 * WORD_INCR;
1748   out = ( CONVERT(*in) >>  26  )   % (1U << 30 ) ;
1749   in += 1 * WORD_INCR;
1750   out |= (CONVERT(*in) % (1U<< 24 ))<<( 30 - 24 );
1751   return out;
1752 }
1753 
1754 static UINT4
access_30_04(const UINT4 * in)1755 access_30_04 (const UINT4 *in) {
1756   UINT4 out;
1757 
1758   in += 3 * WORD_INCR;
1759   out = ( CONVERT(*in) >>  24  )   % (1U << 30 ) ;
1760   in += 1 * WORD_INCR;
1761   out |= (CONVERT(*in) % (1U<< 22 ))<<( 30 - 22 );
1762   return out;
1763 }
1764 
1765 static UINT4
access_30_05(const UINT4 * in)1766 access_30_05 (const UINT4 *in) {
1767   UINT4 out;
1768 
1769   in += 4 * WORD_INCR;
1770   out = ( CONVERT(*in) >>  22  )   % (1U << 30 ) ;
1771   in += 1 * WORD_INCR;
1772   out |= (CONVERT(*in) % (1U<< 20 ))<<( 30 - 20 );
1773   return out;
1774 }
1775 
1776 static UINT4
access_30_06(const UINT4 * in)1777 access_30_06 (const UINT4 *in) {
1778   UINT4 out;
1779 
1780   in += 5 * WORD_INCR;
1781   out = ( CONVERT(*in) >>  20  )   % (1U << 30 ) ;
1782   in += 1 * WORD_INCR;
1783   out |= (CONVERT(*in) % (1U<< 18 ))<<( 30 - 18 );
1784   return out;
1785 }
1786 
1787 static UINT4
access_30_07(const UINT4 * in)1788 access_30_07 (const UINT4 *in) {
1789   UINT4 out;
1790 
1791   in += 6 * WORD_INCR;
1792   out = ( CONVERT(*in) >>  18  )   % (1U << 30 ) ;
1793   in += 1 * WORD_INCR;
1794   out |= (CONVERT(*in) % (1U<< 16 ))<<( 30 - 16 );
1795   return out;
1796 }
1797 
1798 static UINT4
access_30_08(const UINT4 * in)1799 access_30_08 (const UINT4 *in) {
1800   UINT4 out;
1801 
1802   in += 7 * WORD_INCR;
1803   out = ( CONVERT(*in) >>  16  )   % (1U << 30 ) ;
1804   in += 1 * WORD_INCR;
1805   out |= (CONVERT(*in) % (1U<< 14 ))<<( 30 - 14 );
1806   return out;
1807 }
1808 
1809 static UINT4
access_30_09(const UINT4 * in)1810 access_30_09 (const UINT4 *in) {
1811   UINT4 out;
1812 
1813   in += 8 * WORD_INCR;
1814   out = ( CONVERT(*in) >>  14  )   % (1U << 30 ) ;
1815   in += 1 * WORD_INCR;
1816   out |= (CONVERT(*in) % (1U<< 12 ))<<( 30 - 12 );
1817   return out;
1818 }
1819 
1820 static UINT4
access_30_10(const UINT4 * in)1821 access_30_10 (const UINT4 *in) {
1822   UINT4 out;
1823 
1824   in += 9 * WORD_INCR;
1825   out = ( CONVERT(*in) >>  12  )   % (1U << 30 ) ;
1826   in += 1 * WORD_INCR;
1827   out |= (CONVERT(*in) % (1U<< 10 ))<<( 30 - 10 );
1828   return out;
1829 }
1830 
1831 static UINT4
access_30_11(const UINT4 * in)1832 access_30_11 (const UINT4 *in) {
1833   UINT4 out;
1834 
1835   in += 10 * WORD_INCR;
1836   out = ( CONVERT(*in) >>  10  )   % (1U << 30 ) ;
1837   in += 1 * WORD_INCR;
1838   out |= (CONVERT(*in) % (1U<< 8 ))<<( 30 - 8 );
1839   return out;
1840 }
1841 
1842 static UINT4
access_30_12(const UINT4 * in)1843 access_30_12 (const UINT4 *in) {
1844   UINT4 out;
1845 
1846   in += 11 * WORD_INCR;
1847   out = ( CONVERT(*in) >>  8  )   % (1U << 30 ) ;
1848   in += 1 * WORD_INCR;
1849   out |= (CONVERT(*in) % (1U<< 6 ))<<( 30 - 6 );
1850   return out;
1851 }
1852 
1853 static UINT4
access_30_13(const UINT4 * in)1854 access_30_13 (const UINT4 *in) {
1855   UINT4 out;
1856 
1857   in += 12 * WORD_INCR;
1858   out = ( CONVERT(*in) >>  6  )   % (1U << 30 ) ;
1859   in += 1 * WORD_INCR;
1860   out |= (CONVERT(*in) % (1U<< 4 ))<<( 30 - 4 );
1861   return out;
1862 }
1863 
1864 static UINT4
access_30_14(const UINT4 * in)1865 access_30_14 (const UINT4 *in) {
1866   UINT4 out;
1867 
1868   in += 13 * WORD_INCR;
1869   out = ( CONVERT(*in) >>  4  )   % (1U << 30 ) ;
1870   in += 1 * WORD_INCR;
1871   out |= (CONVERT(*in) % (1U<< 2 ))<<( 30 - 2 );
1872   return out;
1873 }
1874 
1875 static UINT4
access_30_15(const UINT4 * in)1876 access_30_15 (const UINT4 *in) {
1877   in += 14 * WORD_INCR;
1878   return ( CONVERT(*in) >>  2  )   % (1U << 30 ) ;
1879 }
1880 
1881 
1882 static UINT4
access_32_00(const UINT4 * in)1883 access_32_00 (const UINT4 *in) {
1884   return CONVERT(*in);
1885 }
1886 
1887 static UINT4
access_32_01(const UINT4 * in)1888 access_32_01 (const UINT4 *in) {
1889   in += 1 * WORD_INCR;
1890   return CONVERT(*in);
1891 }
1892 
1893 static UINT4
access_32_02(const UINT4 * in)1894 access_32_02 (const UINT4 *in) {
1895   in += 2 * WORD_INCR;
1896   return CONVERT(*in);
1897 }
1898 
1899 static UINT4
access_32_03(const UINT4 * in)1900 access_32_03 (const UINT4 *in) {
1901   in += 3 * WORD_INCR;
1902   return CONVERT(*in);
1903 }
1904 
1905 static UINT4
access_32_04(const UINT4 * in)1906 access_32_04 (const UINT4 *in) {
1907   in += 4 * WORD_INCR;
1908   return CONVERT(*in);
1909 }
1910 
1911 static UINT4
access_32_05(const UINT4 * in)1912 access_32_05 (const UINT4 *in) {
1913   in += 5 * WORD_INCR;
1914   return CONVERT(*in);
1915 }
1916 
1917 static UINT4
access_32_06(const UINT4 * in)1918 access_32_06 (const UINT4 *in) {
1919   in += 6 * WORD_INCR;
1920   return CONVERT(*in);
1921 }
1922 
1923 static UINT4
access_32_07(const UINT4 * in)1924 access_32_07 (const UINT4 *in) {
1925   in += 7 * WORD_INCR;
1926   return CONVERT(*in);
1927 }
1928 
1929 static UINT4
access_32_08(const UINT4 * in)1930 access_32_08 (const UINT4 *in) {
1931   in += 8 * WORD_INCR;
1932   return CONVERT(*in);
1933 }
1934 
1935 static UINT4
access_32_09(const UINT4 * in)1936 access_32_09 (const UINT4 *in) {
1937   in += 9 * WORD_INCR;
1938   return CONVERT(*in);
1939 }
1940 
1941 static UINT4
access_32_10(const UINT4 * in)1942 access_32_10 (const UINT4 *in) {
1943   in += 10 * WORD_INCR;
1944   return CONVERT(*in);
1945 }
1946 
1947 static UINT4
access_32_11(const UINT4 * in)1948 access_32_11 (const UINT4 *in) {
1949   in += 11 * WORD_INCR;
1950   return CONVERT(*in);
1951 }
1952 
1953 static UINT4
access_32_12(const UINT4 * in)1954 access_32_12 (const UINT4 *in) {
1955   in += 12 * WORD_INCR;
1956   return CONVERT(*in);
1957 }
1958 
1959 static UINT4
access_32_13(const UINT4 * in)1960 access_32_13 (const UINT4 *in) {
1961   in += 13 * WORD_INCR;
1962   return CONVERT(*in);
1963 }
1964 
1965 static UINT4
access_32_14(const UINT4 * in)1966 access_32_14 (const UINT4 *in) {
1967   in += 14 * WORD_INCR;
1968   return CONVERT(*in);
1969 }
1970 
1971 static UINT4
access_32_15(const UINT4 * in)1972 access_32_15 (const UINT4 *in) {
1973   in += 15 * WORD_INCR;
1974   return CONVERT(*in);
1975 }
1976 
1977 
1978 
1979 typedef UINT4 (*Accessor_T) (const UINT4 *);
1980 
1981 static Accessor_T accessor_table[272] =
1982   {access_00, access_00, access_00, access_00,
1983    access_00, access_00, access_00, access_00,
1984    access_00, access_00, access_00, access_00,
1985    access_00, access_00, access_00, access_00,
1986 
1987    access_02_00, access_02_01, access_02_02, access_02_03,
1988    access_02_04, access_02_05, access_02_06, access_02_07,
1989    access_02_08, access_02_09, access_02_10, access_02_11,
1990    access_02_12, access_02_13, access_02_14, access_02_15,
1991 
1992    access_04_00, access_04_01, access_04_02, access_04_03,
1993    access_04_04, access_04_05, access_04_06, access_04_07,
1994    access_04_08, access_04_09, access_04_10, access_04_11,
1995    access_04_12, access_04_13, access_04_14, access_04_15,
1996 
1997    access_06_00, access_06_01, access_06_02, access_06_03,
1998    access_06_04, access_06_05, access_06_06, access_06_07,
1999    access_06_08, access_06_09, access_06_10, access_06_11,
2000    access_06_12, access_06_13, access_06_14, access_06_15,
2001 
2002    access_08_00, access_08_01, access_08_02, access_08_03,
2003    access_08_04, access_08_05, access_08_06, access_08_07,
2004    access_08_08, access_08_09, access_08_10, access_08_11,
2005    access_08_12, access_08_13, access_08_14, access_08_15,
2006 
2007    access_10_00, access_10_01, access_10_02, access_10_03,
2008    access_10_04, access_10_05, access_10_06, access_10_07,
2009    access_10_08, access_10_09, access_10_10, access_10_11,
2010    access_10_12, access_10_13, access_10_14, access_10_15,
2011 
2012    access_12_00, access_12_01, access_12_02, access_12_03,
2013    access_12_04, access_12_05, access_12_06, access_12_07,
2014    access_12_08, access_12_09, access_12_10, access_12_11,
2015    access_12_12, access_12_13, access_12_14, access_12_15,
2016 
2017    access_14_00, access_14_01, access_14_02, access_14_03,
2018    access_14_04, access_14_05, access_14_06, access_14_07,
2019    access_14_08, access_14_09, access_14_10, access_14_11,
2020    access_14_12, access_14_13, access_14_14, access_14_15,
2021 
2022    access_16_00, access_16_01, access_16_02, access_16_03,
2023    access_16_04, access_16_05, access_16_06, access_16_07,
2024    access_16_08, access_16_09, access_16_10, access_16_11,
2025    access_16_12, access_16_13, access_16_14, access_16_15,
2026 
2027    access_18_00, access_18_01, access_18_02, access_18_03,
2028    access_18_04, access_18_05, access_18_06, access_18_07,
2029    access_18_08, access_18_09, access_18_10, access_18_11,
2030    access_18_12, access_18_13, access_18_14, access_18_15,
2031 
2032    access_20_00, access_20_01, access_20_02, access_20_03,
2033    access_20_04, access_20_05, access_20_06, access_20_07,
2034    access_20_08, access_20_09, access_20_10, access_20_11,
2035    access_20_12, access_20_13, access_20_14, access_20_15,
2036 
2037    access_22_00, access_22_01, access_22_02, access_22_03,
2038    access_22_04, access_22_05, access_22_06, access_22_07,
2039    access_22_08, access_22_09, access_22_10, access_22_11,
2040    access_22_12, access_22_13, access_22_14, access_22_15,
2041 
2042    access_24_00, access_24_01, access_24_02, access_24_03,
2043    access_24_04, access_24_05, access_24_06, access_24_07,
2044    access_24_08, access_24_09, access_24_10, access_24_11,
2045    access_24_12, access_24_13, access_24_14, access_24_15,
2046 
2047    access_26_00, access_26_01, access_26_02, access_26_03,
2048    access_26_04, access_26_05, access_26_06, access_26_07,
2049    access_26_08, access_26_09, access_26_10, access_26_11,
2050    access_26_12, access_26_13, access_26_14, access_26_15,
2051 
2052    access_28_00, access_28_01, access_28_02, access_28_03,
2053    access_28_04, access_28_05, access_28_06, access_28_07,
2054    access_28_08, access_28_09, access_28_10, access_28_11,
2055    access_28_12, access_28_13, access_28_14, access_28_15,
2056 
2057    access_30_00, access_30_01, access_30_02, access_30_03,
2058    access_30_04, access_30_05, access_30_06, access_30_07,
2059    access_30_08, access_30_09, access_30_10, access_30_11,
2060    access_30_12, access_30_13, access_30_14, access_30_15,
2061 
2062    access_32_00, access_32_01, access_32_02, access_32_03,
2063    access_32_04, access_32_05, access_32_06, access_32_07,
2064    access_32_08, access_32_09, access_32_10, access_32_11,
2065    access_32_12, access_32_13, access_32_14, access_32_15,
2066   };
2067 
2068 
2069 
2070 #define DIRECT_METAINFO_SIZE 1
2071 
2072 #ifdef HORIZONTAL
2073 
2074 UINT4
Bitpack64_access(Oligospace_T oligo,UINT4 * ptrs,UINT4 * comp)2075 Bitpack64_access (Oligospace_T oligo, UINT4 *ptrs, UINT4 *comp) {
2076   UINT4 *info, start4;
2077   UINT8 start8;
2078   int nwritten, remainder;
2079   UINT4 *bitpack;
2080   int index, row;
2081 #ifdef DEBUG
2082   int packsize, i;
2083 #endif
2084 
2085   info = &(ptrs[oligo/BLOCKSIZE * DIRECT_METAINFO_SIZE]);
2086 
2087 #ifdef WORDS_BIGENDIAN
2088   start4 = Bigendian_convert_uint(info[0]); /* In 128-bit registers */
2089   start8 = 4 * (UINT8) start4;		    /* In 32-bit words */
2090   bitpack = (UINT4 *) &(comp[start8]);
2091   nwritten = Bigendian_convert_uint(info[1]) - start4;	/* In 128-bit registers */
2092 #else
2093   start4 = info[0];	/* In 128-bit registers */
2094   start8 = 4 * (UINT8) start4;	/* In 32-bit words */
2095   bitpack = (UINT4 *) &(comp[start8]);
2096   nwritten = info[1] - start4;
2097 #endif
2098 
2099   remainder = oligo % BLOCKSIZE;
2100   index = nwritten*16 + remainder % 16;
2101   row = (remainder / 16) * (packsize / 2);   /* Complexity of this calculation makes horizontal format slower */
2102 
2103 #ifdef DEBUG
2104   packsize = nwritten*2;
2105   printf("Entered Bitpack64_access with oligo %u, packsize %d, remainder %d, row %d, index %d\n",
2106 	 oligo,packsize,remainder,row,index);
2107   printf("bitpack:\n");
2108   for (i = 0; i < nwritten*4; i += 4) {
2109     printf("%08X %08X %08X %08X\n",bitpack[i],bitpack[i+1],bitpack[i+2],bitpack[i+3]);
2110   }
2111   printf("\n");
2112 #endif
2113 
2114   return (accessor_table[index])(&(bitpack[row]));
2115 }
2116 
2117 #else
2118 
2119 UINT4
Bitpack64_access(Oligospace_T oligo,UINT4 * ptrs,UINT4 * comp)2120 Bitpack64_access (Oligospace_T oligo, UINT4 *ptrs, UINT4 *comp) {
2121   UINT4 *info, start4;
2122   UINT8 start8;
2123   int nwritten, remainder;
2124   UINT4 *bitpack;
2125   int index, column;
2126 #ifdef DEBUG
2127   int packsize, i;
2128 #endif
2129 
2130   info = &(ptrs[oligo/BLOCKSIZE * DIRECT_METAINFO_SIZE]);
2131 
2132 #ifdef WORDS_BIGENDIAN
2133   start4 = Bigendian_convert_uint(info[0]); /* In 128-bit registers */
2134   start8 = 4 * (UINT8) start4;		    /* In 32-bit words */
2135   bitpack = (UINT4 *) &(comp[start8]);
2136   nwritten = Bigendian_convert_uint(info[1]) - start4;
2137 #else
2138   start4 = info[0];		/* In 128-bit registers */
2139   start8 = 4 * (UINT8) start4;	/* In 32-bit words */
2140   bitpack = (UINT4 *) &(comp[start8]);
2141   nwritten = info[1] - start4;
2142 #endif
2143 
2144   remainder = oligo % BLOCKSIZE;
2145   index = nwritten*16 + remainder/4;
2146   column = remainder % 4;
2147 
2148 #ifdef DEBUG
2149   packsize = nwritten*2;
2150   printf("Entered Bitpack64_access with oligo %u, packsize %d, remainder %d, column %d, index %d\n",
2151 	 oligo,packsize,remainder,column,index);
2152   printf("bitpack:\n");
2153   for (i = 0; i < nwritten*4; i += 4) {
2154     printf("%08X %08X %08X %08X\n",bitpack[i],bitpack[i+1],bitpack[i+2],bitpack[i+3]);
2155   }
2156   printf("\n");
2157 #endif
2158 
2159   return (accessor_table[index])(&(bitpack[column]));
2160 }
2161 
2162 UINT4
Bitpack64_access_bitpack(Oligospace_T oligo,int packsize,UINT4 * bitpack)2163 Bitpack64_access_bitpack (Oligospace_T oligo, int packsize, UINT4 *bitpack) {
2164   int nregisters, remainder;	/* nregisters is same as nwritten */
2165   int index, column;
2166 
2167   nregisters = packsize / 2;
2168   remainder = oligo % BLOCKSIZE;
2169   index = nregisters*16 + remainder/4;
2170   column = remainder % 4;
2171 
2172   return (accessor_table[index])(&(bitpack[column]));
2173 }
2174 
2175 static UINT4 threshold[17] =
2176   {/*0*/0U, /*2*/3U, /*4*/15U, /*6*/63U,
2177    /*8*/255U, /*10*/1023U, /*12*/4095U, /*14*/16383U,
2178    /*16*/65535U, /*18*/262143U, /*20*/1048575U, /*22*/4194303U,
2179    /*24*/16777215U, /*26*/67108863U, /*28*/268435455U, /*30*/1073741823U,
2180    /*32*/4294967295U};
2181 
2182 
2183 bool
Bitpack64_access_filledp(Oligospace_T oligo,int packsize,UINT4 * bitpack)2184 Bitpack64_access_filledp (Oligospace_T oligo, int packsize, UINT4 *bitpack) {
2185   int nregisters, remainder;	/* nregisters is same as nwritten */
2186   int index, column;
2187   UINT4 value;
2188 
2189   nregisters = packsize / 2;
2190   remainder = oligo % BLOCKSIZE;
2191   index = nregisters*16 + remainder/4;
2192   column = remainder % 4;
2193 
2194   value = (accessor_table[index])(&(bitpack[column]));
2195   if (value == threshold[nregisters]) {
2196     return true;
2197   } else {
2198     return false;
2199   }
2200 }
2201 
2202 int
Bitpack64_access_new_packsize(Oligospace_T oligo,int old_packsize,UINT4 * bitpack,int increment)2203 Bitpack64_access_new_packsize (Oligospace_T oligo, int old_packsize, UINT4 *bitpack, int increment) {
2204   int new_packsize;
2205   int nregisters, remainder;	/* nregisters is same as nwritten */
2206   int index, column;
2207   UINT4 value;
2208   Blocksize_T firstbit;
2209 #ifdef HAVE_BUILTIN_CLZ
2210 #elif defined(HAVE_ASM_BSR)
2211   int msb;
2212 #endif
2213 
2214 
2215   nregisters = old_packsize / 2;
2216   remainder = oligo % BLOCKSIZE;
2217   index = nregisters*16 + remainder/4;
2218   column = remainder % 4;
2219 
2220   value = (accessor_table[index])(&(bitpack[column]));
2221   value += increment;
2222 
2223   if (value == 0) {
2224     new_packsize = 0;
2225   } else {
2226 #ifdef HAVE_BUILTIN_CLZ
2227     firstbit = __builtin_clz(value);
2228     new_packsize = 32 - firstbit;
2229 #elif defined(HAVE_ASM_BSR)
2230     asm("bsr %1,%0" : "=r"(msb) : "r"(value));
2231     new_packsize = msb + 1;
2232 #else
2233     firstbit = ((value >> 16) ? clz_table[value >> 16] : 16 + clz_table[value]);
2234     new_packsize = 32 - firstbit;
2235 #endif
2236   }
2237 
2238   new_packsize = (new_packsize + 1) & ~1; /* Converts packsizes to the next multiple of 2 */
2239   if (new_packsize > old_packsize) {
2240     return new_packsize;
2241   } else {
2242     return old_packsize;
2243   }
2244 }
2245 
2246 
2247 
2248 #endif
2249 
2250 
2251 
2252 static void
extract_00(UINT4 * out,const UINT4 * in)2253 extract_00 (UINT4 *out, const UINT4 *in) {
2254   /* 00 */
2255   out[0] = 0;
2256 
2257   /* 01 */
2258   out[4] = 0;
2259 
2260   /* 02 */
2261   out[8] = 0;
2262 
2263   /* 03 */
2264   out[12] = 0;
2265 
2266   /* 04 */
2267   out[16] = 0;
2268 
2269   /* 05 */
2270   out[20] = 0;
2271 
2272   /* 06 */
2273   out[24] = 0;
2274 
2275   /* 07 */
2276   out[28] = 0;
2277 
2278   /* 08 */
2279   out[32] = 0;
2280 
2281   /* 09 */
2282   out[36] = 0;
2283 
2284   /* 10 */
2285   out[40] = 0;
2286 
2287   /* 11 */
2288   out[44] = 0;
2289 
2290   /* 12 */
2291   out[48] = 0;
2292 
2293   /* 13 */
2294   out[52] = 0;
2295 
2296   /* 14 */
2297   out[56] = 0;
2298 
2299   /* 15 */
2300   out[60] = 0;
2301 
2302   return;
2303 }
2304 
2305 static void
extract_02(UINT4 * out,const UINT4 * in)2306 extract_02 (UINT4 *out, const UINT4 *in) {
2307   /* 00 */
2308   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 2 ) ;
2309 
2310   /* 01 */
2311   out[4] = ( CONVERT(*in) >>  2  )   % (1U << 2 ) ;
2312 
2313   /* 02 */
2314   out[8] = ( CONVERT(*in) >>  4  )   % (1U << 2 ) ;
2315 
2316   /* 03 */
2317   out[12] = ( CONVERT(*in) >>  6  )   % (1U << 2 ) ;
2318 
2319   /* 04 */
2320   out[16] = ( CONVERT(*in) >>  8  )   % (1U << 2 ) ;
2321 
2322   /* 05 */
2323   out[20] = ( CONVERT(*in) >>  10  )   % (1U << 2 ) ;
2324 
2325   /* 06 */
2326   out[24] = ( CONVERT(*in) >>  12  )   % (1U << 2 ) ;
2327 
2328   /* 07 */
2329   out[28] = ( CONVERT(*in) >>  14  )   % (1U << 2 ) ;
2330 
2331   /* 08 */
2332   out[32] = ( CONVERT(*in) >>  16  )   % (1U << 2 ) ;
2333 
2334   /* 09 */
2335   out[36] = ( CONVERT(*in) >>  18  )   % (1U << 2 ) ;
2336 
2337   /* 10 */
2338   out[40] = ( CONVERT(*in) >>  20  )   % (1U << 2 ) ;
2339 
2340   /* 11 */
2341   out[44] = ( CONVERT(*in) >>  22  )   % (1U << 2 ) ;
2342 
2343   /* 12 */
2344   out[48] = ( CONVERT(*in) >>  24  )   % (1U << 2 ) ;
2345 
2346   /* 13 */
2347   out[52] = ( CONVERT(*in) >>  26  )   % (1U << 2 ) ;
2348 
2349   /* 14 */
2350   out[56] = ( CONVERT(*in) >>  28  )   % (1U << 2 ) ;
2351 
2352   /* 15 */
2353   out[60] = ( CONVERT(*in) >>  30  )   % (1U << 2 ) ;
2354 
2355   return;
2356 }
2357 
2358 static void
extract_04(UINT4 * out,const UINT4 * in)2359 extract_04 (UINT4 *out, const UINT4 *in) {
2360 
2361   /* 00 */
2362   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 4 ) ;
2363 
2364   /* 01 */
2365   out[4] = ( CONVERT(*in) >>  4  )   % (1U << 4 ) ;
2366 
2367   /* 02 */
2368   out[8] = ( CONVERT(*in) >>  8  )   % (1U << 4 ) ;
2369 
2370   /* 03 */
2371   out[12] = ( CONVERT(*in) >>  12  )   % (1U << 4 ) ;
2372 
2373   /* 04 */
2374   out[16] = ( CONVERT(*in) >>  16 )   % (1U << 4 ) ;
2375 
2376   /* 05 */
2377   out[20] = ( CONVERT(*in) >>  20  )   % (1U << 4 ) ;
2378 
2379   /* 06 */
2380   out[24] = ( CONVERT(*in) >>  24  )   % (1U << 4 ) ;
2381 
2382   /* 07 */
2383   out[28] = ( CONVERT(*in) >>  28  )   % (1U << 4 ) ;
2384 
2385   /* 08 */
2386   in += WORD_INCR;
2387   out[32] = ( CONVERT(*in) >>  0  )   % (1U << 4 ) ;
2388 
2389   /* 09 */
2390   out[36] = ( CONVERT(*in) >>  4  )   % (1U << 4 ) ;
2391 
2392   /* 10 */
2393   out[40] = ( CONVERT(*in) >>  8  )   % (1U << 4 ) ;
2394 
2395   /* 11 */
2396   out[44] = ( CONVERT(*in) >>  12  )   % (1U << 4 ) ;
2397 
2398   /* 12 */
2399   out[48] = ( CONVERT(*in) >>  16  )   % (1U << 4 ) ;
2400 
2401   /* 13 */
2402   out[52] = ( CONVERT(*in) >>  20  )   % (1U << 4 ) ;
2403 
2404   /* 14 */
2405   out[56] = ( CONVERT(*in) >>  24  )   % (1U << 4 ) ;
2406 
2407   /* 15 */
2408   out[60] = ( CONVERT(*in) >>  28  )   % (1U << 4 ) ;
2409 
2410   return;
2411 }
2412 
2413 
2414 static void
extract_06(UINT4 * out,const UINT4 * in)2415 extract_06 (UINT4 *out, const UINT4 *in) {
2416   UINT4 value;
2417 
2418   /* 00 */
2419   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 6 ) ;
2420 
2421   /* 01 */
2422   out[4] = ( CONVERT(*in) >>  6  )   % (1U << 6 ) ;
2423 
2424   /* 02 */
2425   out[8] = ( CONVERT(*in) >>  12  )   % (1U << 6 ) ;
2426 
2427   /* 03 */
2428   out[12] = ( CONVERT(*in) >>  18  )   % (1U << 6 ) ;
2429 
2430   /* 04 */
2431   out[16] = ( CONVERT(*in) >>  24  )   % (1U << 6 ) ;
2432 
2433   /* 05 */
2434   value = ( CONVERT(*in) >>  30  )   % (1U << 6 ) ;
2435   in += WORD_INCR;
2436   value |= (CONVERT(*in) % (1U<< 4 ))<<( 6 - 4 );
2437   out[20] = value;
2438 
2439   /* 06 */
2440   out[24] = ( CONVERT(*in) >>  4  )   % (1U << 6 ) ;
2441 
2442   /* 07 */
2443   out[28] = ( CONVERT(*in) >>  10  )   % (1U << 6 ) ;
2444 
2445   /* 08 */
2446   out[32] = ( CONVERT(*in) >>  16  )   % (1U << 6 ) ;
2447 
2448   /* 09 */
2449   out[36] = ( CONVERT(*in) >>  22  )   % (1U << 6 ) ;
2450 
2451   /* 10 */
2452   value = ( CONVERT(*in) >>  28  )   % (1U << 6 ) ;
2453   in += WORD_INCR;
2454   value |= (CONVERT(*in) % (1U<< 2 ))<<( 6 - 2 );
2455   out[40] = value;
2456 
2457   /* 11 */
2458   out[44] = ( CONVERT(*in) >>  2  )   % (1U << 6 ) ;
2459 
2460   /* 12 */
2461   out[48] = ( CONVERT(*in) >>  8  )   % (1U << 6 ) ;
2462 
2463   /* 13 */
2464   out[52] = ( CONVERT(*in) >>  14  )   % (1U << 6 ) ;
2465 
2466   /* 14 */
2467   out[56] = ( CONVERT(*in) >>  20  )   % (1U << 6 ) ;
2468 
2469   /* 15 */
2470   out[60] = ( CONVERT(*in) >>  26  )   % (1U << 6 ) ;
2471 
2472   return;
2473 }
2474 
2475 
2476 static void
extract_08(UINT4 * out,const UINT4 * in)2477 extract_08 (UINT4 *out, const UINT4 *in) {
2478 
2479   /* 00 */
2480   out[0] = ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
2481 
2482   /* 01 */
2483   out[4] = ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
2484 
2485   /* 02 */
2486   out[8] = ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
2487 
2488   /* 03 */
2489   out[12] = ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
2490 
2491   /* 04 */
2492   in += WORD_INCR;
2493   out[16] = ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
2494 
2495   /* 05 */
2496   out[20] = ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
2497 
2498   /* 06 */
2499   out[24] = ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
2500 
2501   /* 07 */
2502   out[28] = ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
2503 
2504   /* 08 */
2505   in += WORD_INCR;
2506   out[32] = ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
2507 
2508   /* 09 */
2509   out[36] = ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
2510 
2511   /* 10 */
2512   out[40] = ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
2513 
2514   /* 11 */
2515   out[44] = ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
2516 
2517   /* 12 */
2518   in += WORD_INCR;
2519   out[48] = ( CONVERT(*in) >> 0 )   % (1U << 8 ) ;
2520 
2521   /* 13 */
2522   out[52] = ( CONVERT(*in) >> 8 )   % (1U << 8 ) ;
2523 
2524   /* 14 */
2525   out[56] = ( CONVERT(*in) >> 16 )   % (1U << 8 ) ;
2526 
2527   /* 15 */
2528   out[60] = ( CONVERT(*in) >> 24 )   % (1U << 8 ) ;
2529 
2530   return;
2531 }
2532 
2533 static void
extract_10(UINT4 * out,const UINT4 * in)2534 extract_10 (UINT4 *out, const UINT4 *in) {
2535   UINT4 value;
2536 
2537   /* 00 */
2538   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 10 ) ;
2539 
2540   /* 01 */
2541   out[4] = ( CONVERT(*in) >>  10  )   % (1U << 10 ) ;
2542 
2543   /* 02 */
2544   out[8] = ( CONVERT(*in) >>  20  )   % (1U << 10 ) ;
2545 
2546   /* 03 */
2547   value = ( CONVERT(*in) >>  30  )   % (1U << 10 ) ;
2548   in += WORD_INCR;
2549   value |= (CONVERT(*in) % (1U<< 8 ))<<( 10 - 8 );
2550   out[12] = value;
2551 
2552   /* 04 */
2553   out[16] = ( CONVERT(*in) >>  8  )   % (1U << 10 ) ;
2554 
2555   /* 05 */
2556   out[20] = ( CONVERT(*in) >>  18  )   % (1U << 10 ) ;
2557 
2558   /* 06 */
2559   value = ( CONVERT(*in) >>  28  )   % (1U << 10 ) ;
2560   in += WORD_INCR;
2561   value |= (CONVERT(*in) % (1U<< 6 ))<<( 10 - 6 );
2562   out[24] = value;
2563 
2564   /* 07 */
2565   out[28] = ( CONVERT(*in) >>  6  )   % (1U << 10 ) ;
2566 
2567   /* 08 */
2568   out[32] = ( CONVERT(*in) >>  16  )   % (1U << 10 ) ;
2569 
2570   /* 09 */
2571   value = ( CONVERT(*in) >>  26  )   % (1U << 10 ) ;
2572   in += WORD_INCR;
2573   value |= (CONVERT(*in) % (1U<< 4 ))<<( 10 - 4 );
2574   out[36] = value;
2575 
2576   /* 10 */
2577   out[40] = ( CONVERT(*in) >>  4  )   % (1U << 10 ) ;
2578 
2579   /* 11 */
2580   out[44] = ( CONVERT(*in) >>  14  )   % (1U << 10 ) ;
2581 
2582   /* 12 */
2583   value = ( CONVERT(*in) >>  24  )   % (1U << 10 ) ;
2584   in += WORD_INCR;
2585   value |= (CONVERT(*in) % (1U<< 2 ))<<( 10 - 2 );
2586   out[48] = value;
2587 
2588   /* 13 */
2589   out[52] = ( CONVERT(*in) >>  2  )   % (1U << 10 ) ;
2590 
2591   /* 14 */
2592   out[56] = ( CONVERT(*in) >>  12  )   % (1U << 10 ) ;
2593 
2594   /* 15 */
2595   out[60] = ( CONVERT(*in) >>  22  )   % (1U << 10 ) ;
2596 
2597   return;
2598 }
2599 
2600 static void
extract_12(UINT4 * out,const UINT4 * in)2601 extract_12 (UINT4 *out, const UINT4 *in) {
2602   UINT4 value;
2603 
2604   /* 00 */
2605   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 12 ) ;
2606 
2607   /* 01 */
2608   out[4] = ( CONVERT(*in) >>  12  )   % (1U << 12 ) ;
2609 
2610   /* 02 */
2611   value = ( CONVERT(*in) >>  24  )   % (1U << 12 ) ;
2612   in += WORD_INCR;
2613   value |= (CONVERT(*in) % (1U<< 4 ))<<( 12 - 4 );
2614   out[8] = value;
2615 
2616   /* 03 */
2617   out[12] = ( CONVERT(*in) >>  4  )   % (1U << 12 ) ;
2618 
2619   /* 04 */
2620   out[16] = ( CONVERT(*in) >>  16  )   % (1U << 12 ) ;
2621 
2622   /* 05 */
2623   value = ( CONVERT(*in) >>  28  )   % (1U << 12 ) ;
2624   in += WORD_INCR;
2625   value |= (CONVERT(*in) % (1U<< 8 ))<<( 12 - 8 );
2626   out[20] = value;
2627 
2628   /* 06 */
2629   out[24] = ( CONVERT(*in) >>  8  )   % (1U << 12 ) ;
2630 
2631   /* 07 */
2632   out[28] = ( CONVERT(*in) >>  20  )   % (1U << 12 ) ;
2633 
2634   /* 08 */
2635   in += WORD_INCR;
2636   out[32] = ( CONVERT(*in) >>  0  )   % (1U << 12 ) ;
2637 
2638   /* 09 */
2639   out[36] = ( CONVERT(*in) >>  12  )   % (1U << 12 ) ;
2640 
2641   /* 10 */
2642   value = ( CONVERT(*in) >>  24  )   % (1U << 12 ) ;
2643   in += WORD_INCR;
2644   value |= (CONVERT(*in) % (1U<< 4 ))<<( 12 - 4 );
2645   out[40] = value;
2646 
2647   /* 11 */
2648   out[44] = ( CONVERT(*in) >>  4  )   % (1U << 12 ) ;
2649 
2650   /* 12 */
2651   out[48] = ( CONVERT(*in) >>  16  )   % (1U << 12 ) ;
2652 
2653   /* 13 */
2654   value = ( CONVERT(*in) >>  28  )   % (1U << 12 ) ;
2655   in += WORD_INCR;
2656   value |= (CONVERT(*in) % (1U<< 8 ))<<( 12 - 8 );
2657   out[52] = value;
2658 
2659   /* 14 */
2660   out[56] = ( CONVERT(*in) >>  8  )   % (1U << 12 ) ;
2661 
2662   /* 15 */
2663   out[60] = ( CONVERT(*in) >>  20  )   % (1U << 12 ) ;
2664 
2665   return;
2666 }
2667 
2668 
2669 static void
extract_14(UINT4 * out,const UINT4 * in)2670 extract_14 (UINT4 *out, const UINT4 *in) {
2671   UINT4 value;
2672 
2673   /* 00 */
2674   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 14 ) ;
2675 
2676   /* 01 */
2677   out[4] = ( CONVERT(*in) >>  14  )   % (1U << 14 ) ;
2678 
2679   /* 02 */
2680   value = ( CONVERT(*in) >>  28  )   % (1U << 14 ) ;
2681   in += WORD_INCR;
2682   value |= (CONVERT(*in) % (1U<< 10 ))<<( 14 - 10 );
2683   out[8] = value;
2684 
2685   /* 03 */
2686   out[12] = ( CONVERT(*in) >>  10  )   % (1U << 14 ) ;
2687 
2688   /* 04 */
2689   value = ( CONVERT(*in) >>  24  )   % (1U << 14 ) ;
2690   in += WORD_INCR;
2691   value |= (CONVERT(*in) % (1U<< 6 ))<<( 14 - 6 );
2692   out[16] = value;
2693 
2694   /* 05 */
2695   out[20] = ( CONVERT(*in) >>  6  )   % (1U << 14 ) ;
2696 
2697   /* 06 */
2698   value = ( CONVERT(*in) >>  20  )   % (1U << 14 ) ;
2699   in += WORD_INCR;
2700   value |= (CONVERT(*in) % (1U<< 2 ))<<( 14 - 2 );
2701   out[24] = value;
2702 
2703   /* 07 */
2704   out[28] = ( CONVERT(*in) >>  2  )   % (1U << 14 ) ;
2705 
2706   /* 08 */
2707   out[32] = ( CONVERT(*in) >>  16  )   % (1U << 14 ) ;
2708 
2709   /* 09 */
2710   value = ( CONVERT(*in) >>  30  )   % (1U << 14 ) ;
2711   in += WORD_INCR;
2712   value |= (CONVERT(*in) % (1U<< 12 ))<<( 14 - 12 );
2713   out[36] = value;
2714 
2715   /* 10 */
2716   out[40] = ( CONVERT(*in) >>  12  )   % (1U << 14 ) ;
2717 
2718   /* 11 */
2719   value = ( CONVERT(*in) >>  26  )   % (1U << 14 ) ;
2720   in += WORD_INCR;
2721   value |= (CONVERT(*in) % (1U<< 8 ))<<( 14 - 8 );
2722   out[44] = value;
2723 
2724   /* 12 */
2725   out[48] = ( CONVERT(*in) >>  8  )   % (1U << 14 ) ;
2726 
2727   /* 13 */
2728   value = ( CONVERT(*in) >>  22  )   % (1U << 14 ) ;
2729   in += WORD_INCR;
2730   value |= (CONVERT(*in) % (1U<< 4 ))<<( 14 - 4 );
2731   out[52] = value;
2732 
2733   /* 14 */
2734   out[56] = ( CONVERT(*in) >>  4  )   % (1U << 14 ) ;
2735 
2736   /* 15 */
2737   out[60] = ( CONVERT(*in) >>  18  )   % (1U << 14 ) ;
2738 
2739   return;
2740 }
2741 
2742 static void
extract_16(UINT4 * out,const UINT4 * in)2743 extract_16 (UINT4 *out, const UINT4 *in) {
2744 
2745   /* 00 */
2746   out[0] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2747 
2748   /* 01 */
2749   out[4] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2750 
2751   /* 02 */
2752   in += WORD_INCR;
2753   out[8] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2754 
2755   /* 03 */
2756   out[12] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2757 
2758   /* 04 */
2759   in += WORD_INCR;
2760   out[16] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2761 
2762   /* 05 */
2763   out[20] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2764 
2765   /* 06 */
2766   in += WORD_INCR;
2767   out[24] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2768 
2769   /* 07 */
2770   out[28] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2771 
2772   /* 08 */
2773   in += WORD_INCR;
2774   out[32] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2775 
2776   /* 09 */
2777   out[36] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2778 
2779   /* 10 */
2780   in += WORD_INCR;
2781   out[40] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2782 
2783   /* 11 */
2784   out[44] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2785 
2786   /* 12 */
2787   in += WORD_INCR;
2788   out[48] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2789 
2790   /* 13 */
2791   out[52] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2792 
2793   /* 14 */
2794   in += WORD_INCR;
2795   out[56] = ( CONVERT(*in) >> 0 )   % (1U << 16 ) ;
2796 
2797   /* 15 */
2798   out[60] = ( CONVERT(*in) >> 16 )   % (1U << 16 ) ;
2799 
2800   return;
2801 }
2802 
2803 
2804 static void
extract_18(UINT4 * out,const UINT4 * in)2805 extract_18 (UINT4 *out, const UINT4 *in) {
2806   UINT4 value;
2807 
2808   /* 00 */
2809   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 18 ) ;
2810 
2811   /* 01 */
2812   value = ( CONVERT(*in) >>  18  )   % (1U << 18 ) ;
2813   in += WORD_INCR;
2814   value |= (CONVERT(*in) % (1U<< 4 ))<<( 18 - 4 );
2815   out[4] = value;
2816 
2817   /* 02 */
2818   out[8] = ( CONVERT(*in) >>  4  )   % (1U << 18 ) ;
2819 
2820   /* 03 */
2821   value = ( CONVERT(*in) >>  22  )   % (1U << 18 ) ;
2822   in += WORD_INCR;
2823   value |= (CONVERT(*in) % (1U<< 8 ))<<( 18 - 8 );
2824   out[12] = value;
2825 
2826   /* 04 */
2827   out[16] = ( CONVERT(*in) >>  8  )   % (1U << 18 ) ;
2828 
2829   /* 05 */
2830   value = ( CONVERT(*in) >>  26  )   % (1U << 18 ) ;
2831   in += WORD_INCR;
2832   value |= (CONVERT(*in) % (1U<< 12 ))<<( 18 - 12 );
2833   out[20] = value;
2834 
2835   /* 06 */
2836   out[24] = ( CONVERT(*in) >>  12  )   % (1U << 18 ) ;
2837 
2838   /* 07 */
2839   value = ( CONVERT(*in) >>  30  )   % (1U << 18 ) ;
2840   in += WORD_INCR;
2841   value |= (CONVERT(*in) % (1U<< 16 ))<<( 18 - 16 );
2842   out[28] = value;
2843 
2844   /* 08 */
2845   value = ( CONVERT(*in) >>  16  )   % (1U << 18 ) ;
2846   in += WORD_INCR;
2847   value |= (CONVERT(*in) % (1U<< 2 ))<<( 18 - 2 );
2848   out[32] = value;
2849 
2850   /* 09 */
2851   out[36] = ( CONVERT(*in) >>  2  )   % (1U << 18 ) ;
2852 
2853   /* 10 */
2854   value = ( CONVERT(*in) >>  20  )   % (1U << 18 ) ;
2855   in += WORD_INCR;
2856   value |= (CONVERT(*in) % (1U<< 6 ))<<( 18 - 6 );
2857   out[40] = value;
2858 
2859   /* 11 */
2860   out[44] = ( CONVERT(*in) >>  6  )   % (1U << 18 ) ;
2861 
2862   /* 12 */
2863   value = ( CONVERT(*in) >>  24  )   % (1U << 18 ) ;
2864   in += WORD_INCR;
2865   value |= (CONVERT(*in) % (1U<< 10 ))<<( 18 - 10 );
2866   out[48] = value;
2867 
2868   /* 13 */
2869   out[52] = ( CONVERT(*in) >>  10  )   % (1U << 18 ) ;
2870 
2871   /* 14 */
2872   value = ( CONVERT(*in) >>  28  )   % (1U << 18 ) ;
2873   in += WORD_INCR;
2874   value |= (CONVERT(*in) % (1U<< 14 ))<<( 18 - 14 );
2875   out[56] = value;
2876 
2877   /* 15 */
2878   out[60] = ( CONVERT(*in) >>  14  )   % (1U << 18 ) ;
2879 
2880   return;
2881 }
2882 
2883 static void
extract_20(UINT4 * out,const UINT4 * in)2884 extract_20 (UINT4 *out, const UINT4 *in) {
2885   UINT4 value;
2886 
2887   /* 00 */
2888   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 20 ) ;
2889 
2890   /* 01 */
2891   value = ( CONVERT(*in) >>  20  )   % (1U << 20 ) ;
2892   in += WORD_INCR;
2893   value |= (CONVERT(*in) % (1U<< 8 ))<<( 20 - 8 );
2894   out[4] = value;
2895 
2896   /* 02 */
2897   out[8] = ( CONVERT(*in) >>  8  )   % (1U << 20 ) ;
2898 
2899   /* 03 */
2900   value = ( CONVERT(*in) >>  28  )   % (1U << 20 ) ;
2901   in += WORD_INCR;
2902   value |= (CONVERT(*in) % (1U<< 16 ))<<( 20 - 16 );
2903   out[12] = value;
2904 
2905   /* 04 */
2906   value = ( CONVERT(*in) >>  16  )   % (1U << 20 ) ;
2907   in += WORD_INCR;
2908   value |= (CONVERT(*in) % (1U<< 4 ))<<( 20 - 4 );
2909   out[16] = value;
2910 
2911   /* 05 */
2912   out[20] = ( CONVERT(*in) >>  4  )   % (1U << 20 ) ;
2913 
2914   /* 06 */
2915   value = ( CONVERT(*in) >>  24  )   % (1U << 20 ) ;
2916   in += WORD_INCR;
2917   value |= (CONVERT(*in) % (1U<< 12 ))<<( 20 - 12 );
2918   out[24] = value;
2919 
2920   /* 07 */
2921   out[28] = ( CONVERT(*in) >>  12  )   % (1U << 20 ) ;
2922 
2923   /* 08 */
2924   in += WORD_INCR;
2925   out[32] = ( CONVERT(*in) >>  0  )   % (1U << 20 ) ;
2926 
2927   /* 09 */
2928   value = ( CONVERT(*in) >>  20  )   % (1U << 20 ) ;
2929   in += WORD_INCR;
2930   value |= (CONVERT(*in) % (1U<< 8 ))<<( 20 - 8 );
2931   out[36] = value;
2932 
2933   /* 10 */
2934   out[40] = ( CONVERT(*in) >>  8  )   % (1U << 20 ) ;
2935 
2936   /* 11 */
2937   value = ( CONVERT(*in) >>  28  )   % (1U << 20 ) ;
2938   in += WORD_INCR;
2939   value |= (CONVERT(*in) % (1U<< 16 ))<<( 20 - 16 );
2940   out[44] = value;
2941 
2942   /* 12 */
2943   value = ( CONVERT(*in) >>  16  )   % (1U << 20 ) ;
2944   in += WORD_INCR;
2945   value |= (CONVERT(*in) % (1U<< 4 ))<<( 20 - 4 );
2946   out[48] = value;
2947 
2948   /* 13 */
2949   out[52] = ( CONVERT(*in) >>  4  )   % (1U << 20 ) ;
2950 
2951   /* 14 */
2952   value = ( CONVERT(*in) >>  24  )   % (1U << 20 ) ;
2953   in += WORD_INCR;
2954   value |= (CONVERT(*in) % (1U<< 12 ))<<( 20 - 12 );
2955   out[56] = value;
2956 
2957   /* 15 */
2958   out[60] = ( CONVERT(*in) >>  12  )   % (1U << 20 ) ;
2959 
2960   return;
2961 }
2962 
2963 static void
extract_22(UINT4 * out,const UINT4 * in)2964 extract_22 (UINT4 *out, const UINT4 *in) {
2965   UINT4 value;
2966 
2967   /* 00 */
2968   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 22 ) ;
2969 
2970   /* 01 */
2971   value = ( CONVERT(*in) >>  22  )   % (1U << 22 ) ;
2972   in += WORD_INCR;
2973   value |= (CONVERT(*in) % (1U<< 12 ))<<( 22 - 12 );
2974   out[4] = value;
2975 
2976   /* 02 */
2977   value = ( CONVERT(*in) >>  12  )   % (1U << 22 ) ;
2978   in += WORD_INCR;
2979   value |= (CONVERT(*in) % (1U<< 2 ))<<( 22 - 2 );
2980   out[8] = value;
2981 
2982   /* 03 */
2983   out[12] = ( CONVERT(*in) >>  2  )   % (1U << 22 ) ;
2984 
2985   /* 04 */
2986   value = ( CONVERT(*in) >>  24  )   % (1U << 22 ) ;
2987   in += WORD_INCR;
2988   value |= (CONVERT(*in) % (1U<< 14 ))<<( 22 - 14 );
2989   out[16] = value;
2990 
2991   /* 05 */
2992   value = ( CONVERT(*in) >>  14  )   % (1U << 22 ) ;
2993   in += WORD_INCR;
2994   value |= (CONVERT(*in) % (1U<< 4 ))<<( 22 - 4 );
2995   out[20] = value;
2996 
2997   /* 06 */
2998   out[24] = value = ( CONVERT(*in) >>  4  )   % (1U << 22 ) ;
2999 
3000   /* 07 */
3001   value = ( CONVERT(*in) >>  26  )   % (1U << 22 ) ;
3002   in += WORD_INCR;
3003   value |= (CONVERT(*in) % (1U<< 16 ))<<( 22 - 16 );
3004   out[28] = value;
3005 
3006   /* 08 */
3007   value = ( CONVERT(*in) >>  16  )   % (1U << 22 ) ;
3008   in += WORD_INCR;
3009   value |= (CONVERT(*in) % (1U<< 6 ))<<( 22 - 6 );
3010   out[32] = value;
3011 
3012   /* 09 */
3013   out[36] = ( CONVERT(*in) >>  6  )   % (1U << 22 ) ;
3014 
3015   /* 10 */
3016   value = ( CONVERT(*in) >>  28  )   % (1U << 22 ) ;
3017   in += WORD_INCR;
3018   value |= (CONVERT(*in) % (1U<< 18 ))<<( 22 - 18 );
3019   out[40] = value;
3020 
3021   /* 11 */
3022   value = ( CONVERT(*in) >>  18  )   % (1U << 22 ) ;
3023   in += WORD_INCR;
3024   value |= (CONVERT(*in) % (1U<< 8 ))<<( 22 - 8 );
3025   out[44] = value;
3026 
3027   /* 12 */
3028   out[48] = ( CONVERT(*in) >>  8  )   % (1U << 22 ) ;
3029 
3030   /* 13 */
3031   value = ( CONVERT(*in) >>  30  )   % (1U << 22 ) ;
3032   in += WORD_INCR;
3033   value |= (CONVERT(*in) % (1U<< 20 ))<<( 22 - 20 );
3034   out[52] = value;
3035 
3036   /* 14 */
3037   value = ( CONVERT(*in) >>  20  )   % (1U << 22 ) ;
3038   in += WORD_INCR;
3039   value |= (CONVERT(*in) % (1U<< 10 ))<<( 22 - 10 );
3040   out[56] = value;
3041 
3042   /* 15 */
3043   out[60] = ( CONVERT(*in) >>  10  )   % (1U << 22 ) ;
3044 
3045   return;
3046 }
3047 
3048 static void
extract_24(UINT4 * out,const UINT4 * in)3049 extract_24 (UINT4 *out, const UINT4 *in) {
3050   UINT4 value;
3051 
3052   /* 00 */
3053   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
3054 
3055   /* 01 */
3056   value = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
3057   in += WORD_INCR;
3058   value |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
3059   out[4] = value;
3060 
3061   /* 02 */
3062   value = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
3063   in += WORD_INCR;
3064   value |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
3065   out[8] = value;
3066 
3067   /* 03 */
3068   out[12] = ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
3069 
3070   /* 04 */
3071   in += WORD_INCR;
3072   out[16] = ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
3073 
3074   /* 05 */
3075   value = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
3076   in += WORD_INCR;
3077   value |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
3078   out[20] = value;
3079 
3080   /* 06 */
3081   value = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
3082   in += WORD_INCR;
3083   value |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
3084   out[24] = value;
3085 
3086   /* 07 */
3087   out[28] = ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
3088 
3089   /* 08 */
3090   in += WORD_INCR;
3091   out[32] = ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
3092 
3093   /* 09 */
3094   value = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
3095   in += WORD_INCR;
3096   value |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
3097   out[36] = value;
3098 
3099   /* 10 */
3100   value = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
3101   in += WORD_INCR;
3102   value |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
3103   out[40] = value;
3104 
3105   /* 11 */
3106   out[44] = ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
3107 
3108   /* 12 */
3109   in += WORD_INCR;
3110   out[48] = ( CONVERT(*in) >>  0  )   % (1U << 24 ) ;
3111 
3112   /* 13 */
3113   value = ( CONVERT(*in) >>  24  )   % (1U << 24 ) ;
3114   in += WORD_INCR;
3115   value |= (CONVERT(*in) % (1U<< 16 ))<<( 24 - 16 );
3116   out[52] = value;
3117 
3118   /* 14 */
3119   value = ( CONVERT(*in) >>  16  )   % (1U << 24 ) ;
3120   in += WORD_INCR;
3121   value |= (CONVERT(*in) % (1U<< 8 ))<<( 24 - 8 );
3122   out[56] = value;
3123 
3124   /* 15 */
3125   out[60] = ( CONVERT(*in) >>  8  )   % (1U << 24 ) ;
3126 
3127   return;
3128 }
3129 
3130 static void
extract_26(UINT4 * out,const UINT4 * in)3131 extract_26 (UINT4 *out, const UINT4 *in) {
3132   UINT4 value;
3133 
3134   /* 00 */
3135   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 26 ) ;
3136 
3137   /* 01 */
3138   value = ( CONVERT(*in) >>  26  )   % (1U << 26 ) ;
3139   in += WORD_INCR;
3140   value |= (CONVERT(*in) % (1U<< 20 ))<<( 26 - 20 );
3141   out[4] = value;
3142 
3143   /* 02 */
3144   value = ( CONVERT(*in) >>  20  )   % (1U << 26 ) ;
3145   in += WORD_INCR;
3146   value |= (CONVERT(*in) % (1U<< 14 ))<<( 26 - 14 );
3147   out[8] = value;
3148 
3149   /* 03 */
3150   value = ( CONVERT(*in) >>  14  )   % (1U << 26 ) ;
3151   in += WORD_INCR;
3152   value |= (CONVERT(*in) % (1U<< 8 ))<<( 26 - 8 );
3153   out[12] = value;
3154 
3155   /* 04 */
3156   value = ( CONVERT(*in) >>  8  )   % (1U << 26 ) ;
3157   in += WORD_INCR;
3158   value |= (CONVERT(*in) % (1U<< 2 ))<<( 26 - 2 );
3159   out[16] = value;
3160 
3161   /* 05 */
3162   out[20] = ( CONVERT(*in) >>  2  )   % (1U << 26 ) ;
3163 
3164   /* 06 */
3165   value = ( CONVERT(*in) >>  28  )   % (1U << 26 ) ;
3166   in += WORD_INCR;
3167   value |= (CONVERT(*in) % (1U<< 22 ))<<( 26 - 22 );
3168   out[24] = value;
3169 
3170   /* 07 */
3171   value = ( CONVERT(*in) >>  22  )   % (1U << 26 ) ;
3172   in += WORD_INCR;
3173   value |= (CONVERT(*in) % (1U<< 16 ))<<( 26 - 16 );
3174   out[28] = value;
3175 
3176   /* 08 */
3177   value = ( CONVERT(*in) >>  16  )   % (1U << 26 ) ;
3178   in += WORD_INCR;
3179   value |= (CONVERT(*in) % (1U<< 10 ))<<( 26 - 10 );
3180   out[32] = value;
3181 
3182   /* 09 */
3183   value = ( CONVERT(*in) >>  10  )   % (1U << 26 ) ;
3184   in += WORD_INCR;
3185   value |= (CONVERT(*in) % (1U<< 4 ))<<( 26 - 4 );
3186   out[36] = value;
3187 
3188   /* 10 */
3189   out[40] = ( CONVERT(*in) >>  4  )   % (1U << 26 ) ;
3190 
3191   /* 11 */
3192   value = ( CONVERT(*in) >>  30  )   % (1U << 26 ) ;
3193   in += WORD_INCR;
3194   value |= (CONVERT(*in) % (1U<< 24 ))<<( 26 - 24 );
3195   out[44] = value;
3196 
3197   /* 12 */
3198   value = ( CONVERT(*in) >>  24  )   % (1U << 26 ) ;
3199   in += WORD_INCR;
3200   value |= (CONVERT(*in) % (1U<< 18 ))<<( 26 - 18 );
3201   out[48] = value;
3202 
3203   /* 13 */
3204   value = ( CONVERT(*in) >>  18  )   % (1U << 26 ) ;
3205   in += WORD_INCR;
3206   value |= (CONVERT(*in) % (1U<< 12 ))<<( 26 - 12 );
3207   out[52] = value;
3208 
3209   /* 14 */
3210   value = ( CONVERT(*in) >>  12  )   % (1U << 26 ) ;
3211   in += WORD_INCR;
3212   value |= (CONVERT(*in) % (1U<< 6 ))<<( 26 - 6 );
3213   out[56] = value;
3214 
3215   /* 15 */
3216   out[60] = ( CONVERT(*in) >>  6  )   % (1U << 26 ) ;
3217 
3218   return;
3219 }
3220 
3221 static void
extract_28(UINT4 * out,const UINT4 * in)3222 extract_28 (UINT4 *out, const UINT4 *in) {
3223   UINT4 value;
3224 
3225   /* 00 */
3226   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 28 ) ;
3227 
3228   /* 01 */
3229   value = ( CONVERT(*in) >>  28  )   % (1U << 28 ) ;
3230   in += WORD_INCR;
3231   value |= (CONVERT(*in) % (1U<< 24 ))<<( 28 - 24 );
3232   out[4] = value;
3233 
3234   /* 02 */
3235   value = ( CONVERT(*in) >>  24  )   % (1U << 28 ) ;
3236   in += WORD_INCR;
3237   value |= (CONVERT(*in) % (1U<< 20 ))<<( 28 - 20 );
3238   out[8] = value;
3239 
3240   /* 03 */
3241   value = ( CONVERT(*in) >>  20  )   % (1U << 28 ) ;
3242   in += WORD_INCR;
3243   value |= (CONVERT(*in) % (1U<< 16 ))<<( 28 - 16 );
3244   out[12] = value;
3245 
3246   /* 04 */
3247   value = ( CONVERT(*in) >>  16  )   % (1U << 28 ) ;
3248   in += WORD_INCR;
3249   value |= (CONVERT(*in) % (1U<< 12 ))<<( 28 - 12 );
3250   out[16] = value;
3251 
3252   /* 05 */
3253   value = ( CONVERT(*in) >>  12  )   % (1U << 28 ) ;
3254   in += WORD_INCR;
3255   value |= (CONVERT(*in) % (1U<< 8 ))<<( 28 - 8 );
3256   out[20] = value;
3257 
3258   /* 06 */
3259   value = ( CONVERT(*in) >>  8  )   % (1U << 28 ) ;
3260   in += WORD_INCR;
3261   value |= (CONVERT(*in) % (1U<< 4 ))<<( 28 - 4 );
3262   out[24] = value;
3263 
3264   /* 07 */
3265   out[28] = ( CONVERT(*in) >>  4  )   % (1U << 28 ) ;
3266 
3267   /* 08 */
3268   in += WORD_INCR;
3269   out[32] = ( CONVERT(*in) >>  0  )   % (1U << 28 ) ;
3270 
3271   /* 09 */
3272   value = ( CONVERT(*in) >>  28  )   % (1U << 28 ) ;
3273   in += WORD_INCR;
3274   value |= (CONVERT(*in) % (1U<< 24 ))<<( 28 - 24 );
3275   out[36] = value;
3276 
3277   /* 10 */
3278   value = ( CONVERT(*in) >>  24  )   % (1U << 28 ) ;
3279   in += WORD_INCR;
3280   value |= (CONVERT(*in) % (1U<< 20 ))<<( 28 - 20 );
3281   out[40] = value;
3282 
3283   /* 11 */
3284   value = ( CONVERT(*in) >>  20  )   % (1U << 28 ) ;
3285   in += WORD_INCR;
3286   value |= (CONVERT(*in) % (1U<< 16 ))<<( 28 - 16 );
3287   out[44] = value;
3288 
3289   /* 12 */
3290   value = ( CONVERT(*in) >>  16  )   % (1U << 28 ) ;
3291   in += WORD_INCR;
3292   value |= (CONVERT(*in) % (1U<< 12 ))<<( 28 - 12 );
3293   out[48] = value;
3294 
3295   /* 13 */
3296   value = ( CONVERT(*in) >>  12  )   % (1U << 28 ) ;
3297   in += WORD_INCR;
3298   value |= (CONVERT(*in) % (1U<< 8 ))<<( 28 - 8 );
3299   out[52] = value;
3300 
3301   /* 14 */
3302   value = ( CONVERT(*in) >>  8  )   % (1U << 28 ) ;
3303   in += WORD_INCR;
3304   value |= (CONVERT(*in) % (1U<< 4 ))<<( 28 - 4 );
3305   out[56] = value;
3306 
3307   /* 15 */
3308   out[60] = ( CONVERT(*in) >>  4  )   % (1U << 28 ) ;
3309 
3310   return;
3311 }
3312 
3313 
3314 static void
extract_30(UINT4 * out,const UINT4 * in)3315 extract_30 (UINT4 *out, const UINT4 *in) {
3316   UINT4 value;
3317 
3318   /* 00 */
3319   out[0] = ( CONVERT(*in) >>  0  )   % (1U << 30 ) ;
3320 
3321   /* 01 */
3322   value = ( CONVERT(*in) >>  30  )   % (1U << 30 ) ;
3323   in += WORD_INCR;
3324   value |= (CONVERT(*in) % (1U<< 28 ))<<( 30 - 28 );
3325   out[4] = value;
3326 
3327   /* 02 */
3328   value = ( CONVERT(*in) >>  28  )   % (1U << 30 ) ;
3329   in += WORD_INCR;
3330   value |= (CONVERT(*in) % (1U<< 26 ))<<( 30 - 26 );
3331   out[8] = value;
3332 
3333   /* 03 */
3334   value = ( CONVERT(*in) >>  26  )   % (1U << 30 ) ;
3335   in += WORD_INCR;
3336   value |= (CONVERT(*in) % (1U<< 24 ))<<( 30 - 24 );
3337   out[12] = value;
3338 
3339   /* 04 */
3340   value = ( CONVERT(*in) >>  24  )   % (1U << 30 ) ;
3341   in += WORD_INCR;
3342   value |= (CONVERT(*in) % (1U<< 22 ))<<( 30 - 22 );
3343   out[16] = value;
3344 
3345   /* 05 */
3346   value = ( CONVERT(*in) >>  22  )   % (1U << 30 ) ;
3347   in += WORD_INCR;
3348   value |= (CONVERT(*in) % (1U<< 20 ))<<( 30 - 20 );
3349   out[20] = value;
3350 
3351   /* 06 */
3352   value = ( CONVERT(*in) >>  20  )   % (1U << 30 ) ;
3353   in += WORD_INCR;
3354   value |= (CONVERT(*in) % (1U<< 18 ))<<( 30 - 18 );
3355   out[24] = value;
3356 
3357   /* 07 */
3358   value = ( CONVERT(*in) >>  18  )   % (1U << 30 ) ;
3359   in += WORD_INCR;
3360   value |= (CONVERT(*in) % (1U<< 16 ))<<( 30 - 16 );
3361   out[28] = value;
3362 
3363   /* 08 */
3364   value = ( CONVERT(*in) >>  16  )   % (1U << 30 ) ;
3365   in += WORD_INCR;
3366   value |= (CONVERT(*in) % (1U<< 14 ))<<( 30 - 14 );
3367   out[32] = value;
3368 
3369   /* 09 */
3370   value = ( CONVERT(*in) >>  14  )   % (1U << 30 ) ;
3371   in += WORD_INCR;
3372   value |= (CONVERT(*in) % (1U<< 12 ))<<( 30 - 12 );
3373   out[36] = value;
3374 
3375   /* 10 */
3376   value = ( CONVERT(*in) >>  12  )   % (1U << 30 ) ;
3377   in += WORD_INCR;
3378   value |= (CONVERT(*in) % (1U<< 10 ))<<( 30 - 10 );
3379   out[40] = value;
3380 
3381   /* 11 */
3382   value = ( CONVERT(*in) >>  10  )   % (1U << 30 ) ;
3383   in += WORD_INCR;
3384   value |= (CONVERT(*in) % (1U<< 8 ))<<( 30 - 8 );
3385   out[44] = value;
3386 
3387   /* 12 */
3388   value = ( CONVERT(*in) >>  8  )   % (1U << 30 ) ;
3389   in += WORD_INCR;
3390   value |= (CONVERT(*in) % (1U<< 6 ))<<( 30 - 6 );
3391   out[48] = value;
3392 
3393   /* 13 */
3394   value = ( CONVERT(*in) >>  6  )   % (1U << 30 ) ;
3395   in += WORD_INCR;
3396   value |= (CONVERT(*in) % (1U<< 4 ))<<( 30 - 4 );
3397   out[52] = value;
3398 
3399   /* 14 */
3400   value = ( CONVERT(*in) >>  4  )   % (1U << 30 ) ;
3401   in += WORD_INCR;
3402   value |= (CONVERT(*in) % (1U<< 2 ))<<( 30 - 2 );
3403   /* in += WORD_INCR; was out += WORD_INCR, but don't want either */
3404   out[56] = value;
3405 
3406   /* 15 */
3407   out[60] = ( CONVERT(*in) >>  2  )   % (1U << 30 ) ;
3408 
3409   return;
3410 }
3411 
3412 
3413 static void
extract_32(UINT4 * out,const UINT4 * in)3414 extract_32 (UINT4 *out, const UINT4 *in) {
3415 
3416   /* 00 */
3417   out[0] = CONVERT(*in);
3418 
3419   /* 01 */
3420   in += WORD_INCR;
3421   out[4] = CONVERT(*in);
3422 
3423   /* 02 */
3424   in += WORD_INCR;
3425   out[8] = CONVERT(*in);
3426 
3427   /* 03 */
3428   in += WORD_INCR;
3429   out[12] = CONVERT(*in);
3430 
3431   /* 04 */
3432   in += WORD_INCR;
3433   out[16] = CONVERT(*in);
3434 
3435   /* 05 */
3436   in += WORD_INCR;
3437   out[20] = CONVERT(*in);
3438 
3439   /* 06 */
3440   in += WORD_INCR;
3441   out[24] = CONVERT(*in);
3442 
3443   /* 07 */
3444   in += WORD_INCR;
3445   out[28] = CONVERT(*in);
3446 
3447   /* 08 */
3448   in += WORD_INCR;
3449   out[32] = CONVERT(*in);
3450 
3451   /* 09 */
3452   in += WORD_INCR;
3453   out[36] = CONVERT(*in);
3454 
3455   /* 10 */
3456   in += WORD_INCR;
3457   out[40] = CONVERT(*in);
3458 
3459   /* 11 */
3460   in += WORD_INCR;
3461   out[44] = CONVERT(*in);
3462 
3463   /* 12 */
3464   in += WORD_INCR;
3465   out[48] = CONVERT(*in);
3466 
3467   /* 13 */
3468   in += WORD_INCR;
3469   out[52] = CONVERT(*in);
3470 
3471   /* 14 */
3472   in += WORD_INCR;
3473   out[56] = CONVERT(*in);
3474 
3475   /* 15 */
3476   in += WORD_INCR;
3477   out[60] = CONVERT(*in);
3478 
3479   return;
3480 }
3481 
3482 
3483 typedef void (*Extractor_T) (UINT4 *, const UINT4 *);
3484 
3485 static Extractor_T extractor_table[17] =
3486   {extract_00, extract_02, extract_04, extract_06,
3487    extract_08, extract_10, extract_12, extract_14,
3488    extract_16, extract_18, extract_20, extract_22,
3489    extract_24, extract_26, extract_28, extract_30,
3490    extract_32};
3491 
3492 void
Bitpack64_extract_bitpack(UINT4 * out,int packsize,UINT4 * bitpack)3493 Bitpack64_extract_bitpack (UINT4 *out, int packsize, UINT4 *bitpack) {
3494   int nregisters;
3495 
3496   nregisters = packsize / 2;
3497   (extractor_table[nregisters])(&(out[0]),&(bitpack[/*column*/0]));
3498   (extractor_table[nregisters])(&(out[1]),&(bitpack[/*column*/1]));
3499   (extractor_table[nregisters])(&(out[2]),&(bitpack[/*column*/2]));
3500   (extractor_table[nregisters])(&(out[3]),&(bitpack[/*column*/3]));
3501 
3502   return;
3503 }
3504