Commit | Line | Data |
---|---|---|
ba86ff93 PC |
1 | #include "alu.inc" |
2 | ||
3 | .code | |
4 | prolog | |
5 | ||
6 | #define LROT(N, I0, I1, V) ALU(N, , lrot, I0, I1, V) | |
7 | LROT(0, 0x7f, 1, 0xfe) | |
8 | #if __WORDSIZE == 32 | |
9 | LROT(1, 0xfffffffe, 31, 0x7fffffff) | |
10 | LROT(2, 0x12345678, 11, 0xa2b3c091) | |
11 | LROT(3, 0x80000001, 1, 0x03) | |
12 | #else | |
13 | LROT(1, 0xfffffffffffffffe, 31, 0xffffffff7fffffff) | |
14 | LROT(2, 0x123456789abcdef0, 43, 0xe6f78091a2b3c4d5) | |
15 | LROT(3, 0x00000001ffffffff, 32, 0xffffffff00000001) | |
16 | LROT(4, 0x80000001, 33, 0x200000001) | |
17 | LROT(5, 0x8000000000, 35, 0x400) | |
18 | #endif | |
19 | ||
20 | #define RROT(N, I0, I1, V) ALU(N, , rrot, I0, I1, V) | |
21 | RROT(0, 0xfe, 1, 0x7f) | |
22 | #if __WORDSIZE == 32 | |
23 | RROT(1, 0xfffffffe, 31, 0xfffffffd) | |
24 | RROT(2, 0x12345678, 11, 0xcf02468a) | |
25 | RROT(3, 0x80000001, 3, 0x30000000) | |
26 | #else | |
27 | RROT(1, 0xfffffffffffffffe, 31, 0xfffffffdffffffff) | |
28 | RROT(2, 0x123456789abcdef0, 43, 0xcf13579bde02468a) | |
29 | RROT(3, 0x00000001ffffffff, 32, 0xffffffff00000001) | |
30 | RROT(4, 0x80000001, 33, 0x4000000080000000) | |
31 | RROT(5, 0x8000000000, 35, 0x10) | |
32 | #endif | |
33 | ||
34 | prepare | |
35 | pushargi ok | |
36 | ellipsis | |
37 | finishi @printf | |
38 | ret | |
39 | epilog |