git subrepo pull --force deps/lightrec
[pcsx_rearmed.git] / deps / lightning / check / bit.tst
CommitLineData
79bfeef6
PC
1/* If the fallback clor, clzr, ctor and ctzr are used, it might be better
2 * to implement it as functions, as inlined it is almost as large as a
3 * function.
4 * Below is an example of how to do it.
5 */
6
7.data 4096
8str_clo:
9.c "clo"
10str_clz:
11.c "clz"
12str_cto:
13.c "cto"
14str_ctz:
15.c "ctz"
16print_fmt:
17#if __WORDSIZE == 64
18.c "%s (0x%016lx) %s = %d\n"
19#else
20.c "%s (0x%08lx) %s = %d\n"
21#endif
22ok:
23.c "ok\n"
24
25#define BIT2(OP, ARG, RES, R0, R1) \
26 movi %R1 ARG \
27 OP##r %R0 %R1 \
28 beqi OP##R0##R1##ARG %R0 RES \
29 calli @abort \
30OP##R0##R1##ARG:
31
32#define BIT1(OP, ARG, RES, V0, V1, V2, R0, R1, R2) \
33 BIT2(OP, ARG, RES, V0, V0) \
34 BIT2(OP, ARG, RES, V0, V1) \
35 BIT2(OP, ARG, RES, V0, V2) \
36 BIT2(OP, ARG, RES, V0, R0) \
37 BIT2(OP, ARG, RES, V0, R1) \
38 BIT2(OP, ARG, RES, V0, R2)
39
40#define BIT(OP, ARG, RES, V0, V1, V2, R0, R1, R2) \
41 BIT1(OP, ARG, RES, V1, V2, R0, R1, R2, V0) \
42 BIT1(OP, ARG, RES, V2, R0, R1, R2, V0, V1) \
43 BIT1(OP, ARG, RES, R0, R1, R2, V0, V1, V2) \
44 BIT1(OP, ARG, RES, R1, R2, V0, V1, V2, R0) \
45 BIT1(OP, ARG, RES, R2, V0, V1, V2, R0, R1)
46
47#define CLO(ARG, RES) \
48 BIT(clo, ARG, RES, v0, v1, v2, r0, r1, r2)
49#define CLZ(ARG, RES) \
50 BIT(clz, ARG, RES, v0, v1, v2, r0, r1, r2)
51#define CTO(ARG, RES) \
52 BIT(cto, ARG, RES, v0, v1, v2, r0, r1, r2)
53#define CTZ(ARG, RES) \
54 BIT(ctz, ARG, RES, v0, v1, v2, r0, r1, r2)
55
56.code
57 jmpi main
58/*
59 jit_uword_t cto(jit_uword_t r0) {
60 r0 = ~r0;
61 if (r0 == 0)
62 r0 = __WORDSIZE;
63 else
64 r0 = ctz(r0);
65 return r0;
66 }
67 */
68name cto
69cto:
70 prolog
71 arg $in
72 getarg %r0 $in
73 comr %r0 %r0
74 bnei do_cto %r0 0
75 movi %r0 __WORDSIZE
76 jmpi done_cto
77do_cto:
78 prepare
79 pushargr %r0
80 finishi ctz
81 retval %r0
82done_cto:
83 retr %r0
84 epilog
85
86/*
87 jit_uword_t clo(jit_uword_t r0) {
88 r0 = ~r0;
89 if (r0 == 0)
90 r0 = __WORDSIZE;
91 else
92 r0 = clz(r0);
93 return r0;
94 }
95 */
96name clo
97clo:
98 prolog
99 arg $in
100 getarg %r0 $in
101 comr %r0 %r0
102 bnei do_clo %r0 0
103 movi %r0 __WORDSIZE
104 jmpi done_clo
105do_clo:
106 prepare
107 pushargr %r0
108 finishi clz
109 retval %r0
110done_clo:
111 retr %r0
112 epilog
113
114/*
115 jit_uword_t clz(jit_word_t r1) {
116 jit_uword_t r0, r2;
117 if (r1 == 0)
118 r0 = __WORDSIZE;
119 else {
120 r0 = 0;
121 #if __WORDSIZE == 64
122 r2 = 0xffffffff00000000UL;
123 if (!(r1 & r2)) {
124 r1 <<= 32;
125 r0 += 32;
126 }
127 r2 <<= 16;
128 #else
129 r2 = 0xffff0000UL;
130 #endif
131 if (!(r1 & r2)) {
132 r1 <<= 16;
133 r0 += 16;
134 }
135 r2 <<= 8;
136 if (!(r1 & r2)) {
137 r1 <<= 8;
138 r0 += 8;
139 }
140 r2 <<= 4;
141 if (!(r1 & r2)) {
142 r1 <<= 4;
143 r0 += 4;
144 }
145 r2 <<= 2;
146 if (!(r1 & r2)) {
147 r1 <<= 2;
148 r0 += 2;
149 }
150 r2 <<= 1;
151 if (!(r1 & r2))
152 r0 += 1;
153 }
154 return r0;
155 }
156 */
157name clz
158clz:
159 prolog
160 arg $in
161 getarg %r1 $in
162 bnei lun %r1 0
163 reti __WORDSIZE
164lun:
165 movi %r0 0
166#if __WORDSIZE == 64
167 movi %r2 0xffffffff00000000
168 bmsr l32 %r1 %r2
169 lshi %r1 %r1 32
170 addi %r0 %r0 32
171l32:
172 lshi %r2 %r2 16
173#else
174 movi %r2 0xffff0000
175#endif
176 bmsr l16 %r1 %r2
177 lshi %r1 %r1 16
178 addi %r0 %r0 16
179l16:
180 lshi %r2 %r2 8
181 bmsr l8 %r1 %r2
182 lshi %r1 %r1 8
183 addi %r0 %r0 8
184l8:
185 lshi %r2 %r2 4
186 bmsr l4 %r1 %r2
187 lshi %r1 %r1 4
188 addi %r0 %r0 4
189l4:
190 lshi %r2 %r2 2
191 bmsr l2 %r1 %r2
192 lshi %r1 %r1 2
193 addi %r0 %r0 2
194l2:
195 lshi %r2 %r2 1
196 bmsr l1 %r1 %r2
197 addi %r0 %r0 1
198l1:
199 retr %r0
200 epilog
201
202/*
203 jit_uword_t ctz(jit_uword_t r1) {
204 jit_uword_t r0, r2;
205 if (r1 == 0)
206 r0 = __WORDSIZE;
207 else {
208 r0 = 0;
209 #if __WORDSIZE == 64
210 r2 = 0xffffffffUL;;
211 if (!(r1 & r2)) {
212 r1 >>= 32;
213 r0 += 32;
214 }
215 r2 >>= 16;
216 #else
217 r2 = 0xffffUL;;
218 #endif
219 if (!(r1 & r2)) {
220 r1 >>= 16;
221 r0 += 16;
222 }
223 r2 >>= 8;
224 if (!(r1 & r2)) {
225 r1 >>= 8;
226 r0 += 8;
227 }
228 r2 >>= 4;
229 if (!(r1 & r2)) {
230 r1 >>= 4;
231 r0 += 4;
232 }
233 r2 >>= 2;
234 if (!(r1 & r2)) {
235 r1 >>= 2;
236 r0 += 2;
237 }
238 r2 >>= 1;
239 if (!(r1 & r2))
240 r0 += 1;
241 }
242 return r0;
243 }
244*/
245name ctz
246ctz:
247 prolog
248 arg $in
249 getarg %r1 $in
250 bnei tun %r1 0
251 reti __WORDSIZE
252tun:
79bfeef6 253 movi %r0 0
ba86ff93 254#if __WORDSIZE == 64
79bfeef6
PC
255 movi %r2 0xffffffff
256 bmsr t32 %r1 %r2
257 rshi_u %r1 %r1 32
258 addi %r0 %r0 32
259t32:
260 rshi %r2 %r2 16
261#else
262 movi %r2 0xffff
263#endif
264 bmsr t16 %r1 %r2
265 rshi_u %r1 %r1 16
266 addi %r0 %r0 16
267t16:
268 rshi %r2 %r2 8
269 bmsr t8 %r1 %r2
270 rshi_u %r1 %r1 8
271 addi %r0 %r0 8
272t8:
273 rshi %r2 %r2 4
274 bmsr t4 %r1 %r2
275 rshi_u %r1 %r1 4
276 addi %r0 %r0 4
277t4:
278 rshi %r2 %r2 2
279 bmsr t2 %r1 %r2
280 rshi_u %r1 %r1 2
281 addi %r0 %r0 2
282t2:
283 rshi %r2 %r2 1
284 bmsr t1 %r1 %r2
285 addi %r0 %r0 1
286t1:
287 retr %r0
288 epilog
289
290/*
291 char *bitsprint(char *v0, jit_uword_t v1) {
292 jit_uword_t r0, r1;
293 memset(v0, '0', __WORDSIZE);
294 v0[__WORDSIZE] = 0;
295 for (r0 = 1L << (__WORDSIZE - 1), r1 = 0; r0; r0 >>= 1, ++r1) {
296 if (v1 & r0)
297 v0[r1] = '1';
298 }
299 return v0;
300 }
301 */
302name bitsprint
303bitsprint:
304 prolog
305 arg $buf
306 arg $val
307 getarg %v0 $buf
308 getarg %v1 $val
309 prepare
310 pushargr %v0
311 pushargi '0'
312 pushargi __WORDSIZE
313 finishi @memset
314 movi %r0 0
315 addi %r1 %v0 __WORDSIZE
316 str_c %r1 %r0
317 movi %r0 $(1 << (__WORDSIZE - 1))
318 movi %r1 0
319 movi %r2 '1'
320bitloop:
321 bmcr bitzero %v1 %r0
322 stxr_c %r1 %v0 %r2
323bitzero:
324 addi %r1 %r1 1
325 rshi_u %r0 %r0 1
326 bnei bitloop %r0 0
327 retr %v0
328 epilog
329
330/*
331 #if 0
332 int main(int argc, char *argv[]) {
333 jit_uword_t r0, v0, v1, v2;
334 char buf[80];
335 #if __WORDSIZE == 64
336 char *fmt = "%s (0x%016lx) %s = %d\n";
337 v0 = 0x8000000000000000UL;
338 v2 = 0xffffffffffffffffUL;
339 #else
340 char *fmt = "%s (0x%08lx) %s = %d\n";
341 v0 = 0x80000000UL;
342 v2 = 0xffffffffUL;
343 #endif
344 do {
345 v1 = v0 - 1;
346 r0 = clz(v0);
347 bitsprint(buf, v0);
348 printf(fmt, "clz", v0, buf, r0);
349 r0 = clo(v2);
350 bitsprint(buf, v2);
351 printf(fmt, "clo", v2, buf, r0);
352 r0 = ctz(v0);
353 bitsprint(buf, v0);
354 printf(fmt, "ctz", v0, buf, r0);
355 r0 = cto(v1);
356 bitsprint(buf, v1);
357 printf(fmt, "cto", v1, buf, r0);
358 v0 >>= 1;
359 v2 <<= 1;
360 } while ((jit_word_t)v1 > -1);
361 return 0;
362 }
363 #endif
364 */
365
366/* Make it "#if 1" for a "debug mode", that helps in regenerating tables,
367 * or temporary state while implementing optimized port specific versions. */
368#if 0
369#define CALL_FUNC 1
370 name main
371main:
372 prolog
373 allocai 80 $buf
374#if __WORDSIZE == 64
375 movi %v0 0x8000000000000000
376 movi %v2 0xffffffffffffffff
377#else
378 movi %v0 0x80000000
379 movi %v2 0xffffffff
380#endif
381loop:
382 subi %v1 %v0 1
383 addi %r1 %fp $buf
384 prepare
385 pushargr %r1
386 pushargr %v0
387 finishi bitsprint
388#if CALL_FUNC
389 prepare
390 pushargr %v0
391 finishi clz
392 retval %r0
393#else
394 clzr %r0 %v0
395#endif
396 addi %r1 %fp $buf
397 prepare
398 pushargi print_fmt
399 ellipsis
400 pushargi str_clz
401 pushargr %v0
402 pushargr %r1
403 pushargr %r0
404 finishi @printf
405 addi %r1 %fp $buf
406 prepare
407 pushargr %r1
408 pushargr %v2
409 finishi bitsprint
410#if CALL_FUNC
411 prepare
412 pushargr %v2
413 finishi clo
414 retval %r0
415#else
416 clor %r0 %v2
417#endif
418 addi %r1 %fp $buf
419 prepare
420 pushargi print_fmt
421 ellipsis
422 pushargi str_clo
423 pushargr %v2
424 pushargr %r1
425 pushargr %r0
426 finishi @printf
427 addi %r1 %fp $buf
428 prepare
429 pushargr %r1
430 pushargr %v0
431 finishi bitsprint
432#if CALL_FUNC
433 prepare
434 pushargr %v0
435 finishi ctz
436 retval %r0
437#else
438 ctzr %r0 %v0
439#endif
440 addi %r1 %fp $buf
441 prepare
442 pushargi print_fmt
443 ellipsis
444 pushargi str_ctz
445 pushargr %v0
446 pushargr %r1
447 pushargr %r0
448 finishi @printf
449 addi %r1 %fp $buf
450 prepare
451 pushargr %r1
452 pushargr %v1
453 finishi bitsprint
454#if CALL_FUNC
455 prepare
456 pushargr %v1
457 finishi cto
458 retval %r0
459#else
460 ctor %r0 %v1
461#endif
462 addi %r1 %fp $buf
463 prepare
464 pushargi print_fmt
465 ellipsis
466 pushargi str_cto
467 pushargr %v1
468 pushargr %r1
469 pushargr %r0
470 finishi @printf
471 rshi_u %v0 %v0 1
472 lshi %v2 %v2 1
473 bgti loop %v1 -1
474 ret
475 epilog
476#else
477
478 name main
479main:
480 prolog
481#if __WORDSIZE == 32
482 CLZ(0x80000000, 0)
483 CLO(0xffffffff, 32)
484 CTZ(0x80000000, 31)
485 CTO(0x7fffffff, 31)
486 CLZ(0x40000000, 1)
487 CLO(0xfffffffe, 31)
488 CTZ(0x40000000, 30)
489 CTO(0x3fffffff, 30)
490 CLZ(0x20000000, 2)
491 CLO(0xfffffffc, 30)
492 CTZ(0x20000000, 29)
493 CTO(0x1fffffff, 29)
494 CLZ(0x10000000, 3)
495 CLO(0xfffffff8, 29)
496 CTZ(0x10000000, 28)
497 CTO(0x0fffffff, 28)
498 CLZ(0x08000000, 4)
499 CLO(0xfffffff0, 28)
500 CTZ(0x08000000, 27)
501 CTO(0x07ffffff, 27)
502 CLZ(0x04000000, 5)
503 CLO(0xffffffe0, 27)
504 CTZ(0x04000000, 26)
505 CTO(0x03ffffff, 26)
506 CLZ(0x02000000, 6)
507 CLO(0xffffffc0, 26)
508 CTZ(0x02000000, 25)
509 CTO(0x01ffffff, 25)
510 CLZ(0x01000000, 7)
511 CLO(0xffffff80, 25)
512 CTZ(0x01000000, 24)
513 CTO(0x00ffffff, 24)
514 CLZ(0x00800000, 8)
515 CLO(0xffffff00, 24)
516 CTZ(0x00800000, 23)
517 CTO(0x007fffff, 23)
518 CLZ(0x00400000, 9)
519 CLO(0xfffffe00, 23)
520 CTZ(0x00400000, 22)
521 CTO(0x003fffff, 22)
522 CLZ(0x00200000, 10)
523 CLO(0xfffffc00, 22)
524 CTZ(0x00200000, 21)
525 CTO(0x001fffff, 21)
526 CLZ(0x00100000, 11)
527 CLO(0xfffff800, 21)
528 CTZ(0x00100000, 20)
529 CTO(0x000fffff, 20)
530 CLZ(0x00080000, 12)
531 CLO(0xfffff000, 20)
532 CTZ(0x00080000, 19)
533 CTO(0x0007ffff, 19)
534 CLZ(0x00040000, 13)
535 CLO(0xffffe000, 19)
536 CTZ(0x00040000, 18)
537 CTO(0x0003ffff, 18)
538 CLZ(0x00020000, 14)
539 CLO(0xffffc000, 18)
540 CTZ(0x00020000, 17)
541 CTO(0x0001ffff, 17)
542 CLZ(0x00010000, 15)
543 CLO(0xffff8000, 17)
544 CTZ(0x00010000, 16)
545 CTO(0x0000ffff, 16)
546 CLZ(0x00008000, 16)
547 CLO(0xffff0000, 16)
548 CTZ(0x00008000, 15)
549 CTO(0x00007fff, 15)
550 CLZ(0x00004000, 17)
551 CLO(0xfffe0000, 15)
552 CTZ(0x00004000, 14)
553 CTO(0x00003fff, 14)
554 CLZ(0x00002000, 18)
555 CLO(0xfffc0000, 14)
556 CTZ(0x00002000, 13)
557 CTO(0x00001fff, 13)
558 CLZ(0x00001000, 19)
559 CLO(0xfff80000, 13)
560 CTZ(0x00001000, 12)
561 CTO(0x00000fff, 12)
562 CLZ(0x00000800, 20)
563 CLO(0xfff00000, 12)
564 CTZ(0x00000800, 11)
565 CTO(0x000007ff, 11)
566 CLZ(0x00000400, 21)
567 CLO(0xffe00000, 11)
568 CTZ(0x00000400, 10)
569 CTO(0x000003ff, 10)
570 CLZ(0x00000200, 22)
571 CLO(0xffc00000, 10)
572 CTZ(0x00000200, 9)
573 CTO(0x000001ff, 9)
574 CLZ(0x00000100, 23)
575 CLO(0xff800000, 9)
576 CTZ(0x00000100, 8)
577 CTO(0x000000ff, 8)
578 CLZ(0x00000080, 24)
579 CLO(0xff000000, 8)
580 CTZ(0x00000080, 7)
581 CTO(0x0000007f, 7)
582 CLZ(0x00000040, 25)
583 CLO(0xfe000000, 7)
584 CTZ(0x00000040, 6)
585 CTO(0x0000003f, 6)
586 CLZ(0x00000020, 26)
587 CLO(0xfc000000, 6)
588 CTZ(0x00000020, 5)
589 CTO(0x0000001f, 5)
590 CLZ(0x00000010, 27)
591 CLO(0xf8000000, 5)
592 CTZ(0x00000010, 4)
593 CTO(0x0000000f, 4)
594 CLZ(0x00000008, 28)
595 CLO(0xf0000000, 4)
596 CTZ(0x00000008, 3)
597 CTO(0x00000007, 3)
598 CLZ(0x00000004, 29)
599 CLO(0xe0000000, 3)
600 CTZ(0x00000004, 2)
601 CTO(0x00000003, 2)
602 CLZ(0x00000002, 30)
603 CLO(0xc0000000, 2)
604 CTZ(0x00000002, 1)
605 CTO(0x00000001, 1)
606 CLZ(0x00000001, 31)
607 CLO(0x80000000, 1)
608 CTZ(0x00000001, 0)
609 CTO(0x00000000, 0)
610 CLZ(0x00000000, 32)
611 CLO(0x00000000, 0)
612 CTZ(0x00000000, 32)
613 CTO(0xffffffff, 32)
614#else
615 CLZ(0x8000000000000000, 0)
616 CLO(0xffffffffffffffff, 64)
617 CTZ(0x8000000000000000, 63)
618 CTO(0x7fffffffffffffff, 63)
619 CLZ(0x4000000000000000, 1)
620 CLO(0xfffffffffffffffe, 63)
621 CTZ(0x4000000000000000, 62)
622 CTO(0x3fffffffffffffff, 62)
623 CLZ(0x2000000000000000, 2)
624 CLO(0xfffffffffffffffc, 62)
625 CTZ(0x2000000000000000, 61)
626 CTO(0x1fffffffffffffff, 61)
627 CLZ(0x1000000000000000, 3)
628 CLO(0xfffffffffffffff8, 61)
629 CTZ(0x1000000000000000, 60)
630 CTO(0x0fffffffffffffff, 60)
631 CLZ(0x0800000000000000, 4)
632 CLO(0xfffffffffffffff0, 60)
633 CTZ(0x0800000000000000, 59)
634 CTO(0x07ffffffffffffff, 59)
635 CLZ(0x0400000000000000, 5)
636 CLO(0xffffffffffffffe0, 59)
637 CTZ(0x0400000000000000, 58)
638 CTO(0x03ffffffffffffff, 58)
639 CLZ(0x0200000000000000, 6)
640 CLO(0xffffffffffffffc0, 58)
641 CTZ(0x0200000000000000, 57)
642 CTO(0x01ffffffffffffff, 57)
643 CLZ(0x0100000000000000, 7)
644 CLO(0xffffffffffffff80, 57)
645 CTZ(0x0100000000000000, 56)
646 CTO(0x00ffffffffffffff, 56)
647 CLZ(0x0080000000000000, 8)
648 CLO(0xffffffffffffff00, 56)
649 CTZ(0x0080000000000000, 55)
650 CTO(0x007fffffffffffff, 55)
651 CLZ(0x0040000000000000, 9)
652 CLO(0xfffffffffffffe00, 55)
653 CTZ(0x0040000000000000, 54)
654 CTO(0x003fffffffffffff, 54)
655 CLZ(0x0020000000000000, 10)
656 CLO(0xfffffffffffffc00, 54)
657 CTZ(0x0020000000000000, 53)
658 CTO(0x001fffffffffffff, 53)
659 CLZ(0x0010000000000000, 11)
660 CLO(0xfffffffffffff800, 53)
661 CTZ(0x0010000000000000, 52)
662 CTO(0x000fffffffffffff, 52)
663 CLZ(0x0008000000000000, 12)
664 CLO(0xfffffffffffff000, 52)
665 CTZ(0x0008000000000000, 51)
666 CTO(0x0007ffffffffffff, 51)
667 CLZ(0x0004000000000000, 13)
668 CLO(0xffffffffffffe000, 51)
669 CTZ(0x0004000000000000, 50)
670 CTO(0x0003ffffffffffff, 50)
671 CLZ(0x0002000000000000, 14)
672 CLO(0xffffffffffffc000, 50)
673 CTZ(0x0002000000000000, 49)
674 CTO(0x0001ffffffffffff, 49)
675 CLZ(0x0001000000000000, 15)
676 CLO(0xffffffffffff8000, 49)
677 CTZ(0x0001000000000000, 48)
678 CTO(0x0000ffffffffffff, 48)
679 CLZ(0x0000800000000000, 16)
680 CLO(0xffffffffffff0000, 48)
681 CTZ(0x0000800000000000, 47)
682 CTO(0x00007fffffffffff, 47)
683 CLZ(0x0000400000000000, 17)
684 CLO(0xfffffffffffe0000, 47)
685 CTZ(0x0000400000000000, 46)
686 CTO(0x00003fffffffffff, 46)
687 CLZ(0x0000200000000000, 18)
688 CLO(0xfffffffffffc0000, 46)
689 CTZ(0x0000200000000000, 45)
690 CTO(0x00001fffffffffff, 45)
691 CLZ(0x0000100000000000, 19)
692 CLO(0xfffffffffff80000, 45)
693 CTZ(0x0000100000000000, 44)
694 CTO(0x00000fffffffffff, 44)
695 CLZ(0x0000080000000000, 20)
696 CLO(0xfffffffffff00000, 44)
697 CTZ(0x0000080000000000, 43)
698 CTO(0x000007ffffffffff, 43)
699 CLZ(0x0000040000000000, 21)
700 CLO(0xffffffffffe00000, 43)
701 CTZ(0x0000040000000000, 42)
702 CTO(0x000003ffffffffff, 42)
703 CLZ(0x0000020000000000, 22)
704 CLO(0xffffffffffc00000, 42)
705 CTZ(0x0000020000000000, 41)
706 CTO(0x000001ffffffffff, 41)
707 CLZ(0x0000010000000000, 23)
708 CLO(0xffffffffff800000, 41)
709 CTZ(0x0000010000000000, 40)
710 CTO(0x000000ffffffffff, 40)
711 CLZ(0x0000008000000000, 24)
712 CLO(0xffffffffff000000, 40)
713 CTZ(0x0000008000000000, 39)
714 CTO(0x0000007fffffffff, 39)
715 CLZ(0x0000004000000000, 25)
716 CLO(0xfffffffffe000000, 39)
717 CTZ(0x0000004000000000, 38)
718 CTO(0x0000003fffffffff, 38)
719 CLZ(0x0000002000000000, 26)
720 CLO(0xfffffffffc000000, 38)
721 CTZ(0x0000002000000000, 37)
722 CTO(0x0000001fffffffff, 37)
723 CLZ(0x0000001000000000, 27)
724 CLO(0xfffffffff8000000, 37)
725 CTZ(0x0000001000000000, 36)
726 CTO(0x0000000fffffffff, 36)
727 CLZ(0x0000000800000000, 28)
728 CLO(0xfffffffff0000000, 36)
729 CTZ(0x0000000800000000, 35)
730 CTO(0x00000007ffffffff, 35)
731 CLZ(0x0000000400000000, 29)
732 CLO(0xffffffffe0000000, 35)
733 CTZ(0x0000000400000000, 34)
734 CTO(0x00000003ffffffff, 34)
735 CLZ(0x0000000200000000, 30)
736 CLO(0xffffffffc0000000, 34)
737 CTZ(0x0000000200000000, 33)
738 CTO(0x00000001ffffffff, 33)
739 CLZ(0x0000000100000000, 31)
740 CLO(0xffffffff80000000, 33)
741 CTZ(0x0000000100000000, 32)
742 CTO(0x00000000ffffffff, 32)
743 CLZ(0x0000000080000000, 32)
744 CLO(0xffffffff00000000, 32)
745 CTZ(0x0000000080000000, 31)
746 CTO(0x000000007fffffff, 31)
747 CLZ(0x0000000040000000, 33)
748 CLO(0xfffffffe00000000, 31)
749 CTZ(0x0000000040000000, 30)
750 CTO(0x000000003fffffff, 30)
751 CLZ(0x0000000020000000, 34)
752 CLO(0xfffffffc00000000, 30)
753 CTZ(0x0000000020000000, 29)
754 CTO(0x000000001fffffff, 29)
755 CLZ(0x0000000010000000, 35)
756 CLO(0xfffffff800000000, 29)
757 CTZ(0x0000000010000000, 28)
758 CTO(0x000000000fffffff, 28)
759 CLZ(0x0000000008000000, 36)
760 CLO(0xfffffff000000000, 28)
761 CTZ(0x0000000008000000, 27)
762 CTO(0x0000000007ffffff, 27)
763 CLZ(0x0000000004000000, 37)
764 CLO(0xffffffe000000000, 27)
765 CTZ(0x0000000004000000, 26)
766 CTO(0x0000000003ffffff, 26)
767 CLZ(0x0000000002000000, 38)
768 CLO(0xffffffc000000000, 26)
769 CTZ(0x0000000002000000, 25)
770 CTO(0x0000000001ffffff, 25)
771 CLZ(0x0000000001000000, 39)
772 CLO(0xffffff8000000000, 25)
773 CTZ(0x0000000001000000, 24)
774 CTO(0x0000000000ffffff, 24)
775 CLZ(0x0000000000800000, 40)
776 CLO(0xffffff0000000000, 24)
777 CTZ(0x0000000000800000, 23)
778 CTO(0x00000000007fffff, 23)
779 CLZ(0x0000000000400000, 41)
780 CLO(0xfffffe0000000000, 23)
781 CTZ(0x0000000000400000, 22)
782 CTO(0x00000000003fffff, 22)
783 CLZ(0x0000000000200000, 42)
784 CLO(0xfffffc0000000000, 22)
785 CTZ(0x0000000000200000, 21)
786 CTO(0x00000000001fffff, 21)
787 CLZ(0x0000000000100000, 43)
788 CLO(0xfffff80000000000, 21)
789 CTZ(0x0000000000100000, 20)
790 CTO(0x00000000000fffff, 20)
791 CLZ(0x0000000000080000, 44)
792 CLO(0xfffff00000000000, 20)
793 CTZ(0x0000000000080000, 19)
794 CTO(0x000000000007ffff, 19)
795 CLZ(0x0000000000040000, 45)
796 CLO(0xffffe00000000000, 19)
797 CTZ(0x0000000000040000, 18)
798 CTO(0x000000000003ffff, 18)
799 CLZ(0x0000000000020000, 46)
800 CLO(0xffffc00000000000, 18)
801 CTZ(0x0000000000020000, 17)
802 CTO(0x000000000001ffff, 17)
803 CLZ(0x0000000000010000, 47)
804 CLO(0xffff800000000000, 17)
805 CTZ(0x0000000000010000, 16)
806 CTO(0x000000000000ffff, 16)
807 CLZ(0x0000000000008000, 48)
808 CLO(0xffff000000000000, 16)
809 CTZ(0x0000000000008000, 15)
810 CTO(0x0000000000007fff, 15)
811 CLZ(0x0000000000004000, 49)
812 CLO(0xfffe000000000000, 15)
813 CTZ(0x0000000000004000, 14)
814 CTO(0x0000000000003fff, 14)
815 CLZ(0x0000000000002000, 50)
816 CLO(0xfffc000000000000, 14)
817 CTZ(0x0000000000002000, 13)
818 CTO(0x0000000000001fff, 13)
819 CLZ(0x0000000000001000, 51)
820 CLO(0xfff8000000000000, 13)
821 CTZ(0x0000000000001000, 12)
822 CTO(0x0000000000000fff, 12)
823 CLZ(0x0000000000000800, 52)
824 CLO(0xfff0000000000000, 12)
825 CTZ(0x0000000000000800, 11)
826 CTO(0x00000000000007ff, 11)
827 CLZ(0x0000000000000400, 53)
828 CLO(0xffe0000000000000, 11)
829 CTZ(0x0000000000000400, 10)
830 CTO(0x00000000000003ff, 10)
831 CLZ(0x0000000000000200, 54)
832 CLO(0xffc0000000000000, 10)
833 CTZ(0x0000000000000200, 9)
834 CTO(0x00000000000001ff, 9)
835 CLZ(0x0000000000000100, 55)
836 CLO(0xff80000000000000, 9)
837 CTZ(0x0000000000000100, 8)
838 CTO(0x00000000000000ff, 8)
839 CLZ(0x0000000000000080, 56)
840 CLO(0xff00000000000000, 8)
841 CTZ(0x0000000000000080, 7)
842 CTO(0x000000000000007f, 7)
843 CLZ(0x0000000000000040, 57)
844 CLO(0xfe00000000000000, 7)
845 CTZ(0x0000000000000040, 6)
846 CTO(0x000000000000003f, 6)
847 CLZ(0x0000000000000020, 58)
848 CLO(0xfc00000000000000, 6)
849 CTZ(0x0000000000000020, 5)
850 CTO(0x000000000000001f, 5)
851 CLZ(0x0000000000000010, 59)
852 CLO(0xf800000000000000, 5)
853 CTZ(0x0000000000000010, 4)
854 CTO(0x000000000000000f, 4)
855 CLZ(0x0000000000000008, 60)
856 CLO(0xf000000000000000, 4)
857 CTZ(0x0000000000000008, 3)
858 CTO(0x0000000000000007, 3)
859 CLZ(0x0000000000000004, 61)
860 CLO(0xe000000000000000, 3)
861 CTZ(0x0000000000000004, 2)
862 CTO(0x0000000000000003, 2)
863 CLZ(0x0000000000000002, 62)
864 CLO(0xc000000000000000, 2)
865 CTZ(0x0000000000000002, 1)
866 CTO(0x0000000000000001, 1)
867 CLZ(0x0000000000000001, 63)
868 CLO(0x8000000000000000, 1)
869 CTZ(0x0000000000000001, 0)
870 CTO(0x0000000000000000, 0)
871 CLZ(0x0000000000000000, 64)
872 CLO(0x0000000000000000, 0)
873 CTZ(0x0000000000000000, 64)
874 CTO(0xffffffffffffffff, 64)
875#endif
876 prepare
877 pushargi ok
878 finishi @printf
879 reti 0
880 epilog
881#endif