Commit | Line | Data |
---|---|---|
4a71579b PC |
1 | #include "alu.inc" |
2 | ||
3 | .code | |
4 | prolog | |
5 | ||
6 | #define REM(N, I0, I1, V) ALU(N, , rem, I0, I1, V) | |
7 | #define UREM(N, I0, I1, V) ALU(N, _u, rem, I0, I1, V) | |
8 | ||
9 | REM(0, 0x7fffffff, 1, 0) | |
10 | REM(1, 1, 0x7fffffff, 1) | |
11 | REM(2, 0x80000000, 1, 0) | |
12 | REM(3, 1, 0x80000000, 1) | |
13 | REM(4, 0x7fffffff, 2, 1) | |
14 | REM(5, 2, 0x7fffffff, 2) | |
15 | REM(6, 0x80000000, 2, 0) | |
16 | REM(7, 2, 0x80000000, 2) | |
17 | REM(8, 0x7fffffff, 0x80000000, 0x7fffffff) | |
18 | REM(9, 0, 0x7fffffff, 0) | |
19 | REM(10, 0xffffffff, 0xffffffff, 0) | |
20 | UREM(0, 0x7fffffff, 1, 0) | |
21 | UREM(1, 1, 0x7fffffff, 1) | |
22 | UREM(2, 0x80000000, 1, 0) | |
23 | UREM(3, 1, 0x80000000, 1) | |
24 | UREM(4, 0x7fffffff, 2, 1) | |
25 | UREM(5, 2, 0x7fffffff, 2) | |
26 | UREM(6, 0x80000000, 2, 0) | |
27 | UREM(7, 2, 0x80000000, 2) | |
28 | UREM(8, 0x7fffffff, 0x80000000, 0x7fffffff) | |
29 | UREM(9, 0x80000000, 0x7fffffff, 1) | |
30 | UREM(10,0, 0x7fffffff, 0) | |
31 | UREM(11,0x7fffffff, 0xffffffff, 0x7fffffff) | |
32 | UREM(12,0xffffffff, 0x7fffffff, 1) | |
33 | UREM(13,0xffffffff, 0xffffffff, 0) | |
34 | ||
35 | #if __WORDSIZE == 32 | |
36 | REM(11, 0x80000000, 0x7fffffff, 0xffffffff) | |
37 | REM(12, 0x7fffffff, 0xffffffff, 0) | |
38 | REM(13, 0xffffffff, 0x7fffffff, 0xffffffff) | |
39 | #else | |
40 | REM(11, 0x80000000, 0x7fffffff, 1) | |
41 | REM(12, 0x7fffffff, 0xffffffff, 0x7fffffff) | |
42 | REM(13, 0xffffffff, 0x7fffffff, 1) | |
43 | REM(14, 0x7fffffffffffffff, 1, 0) | |
44 | REM(15, 1, 0x7fffffffffffffff, 1) | |
45 | REM(16, 0x8000000000000000, 1, 0) | |
46 | REM(17, 1, 0x8000000000000000, 1) | |
47 | REM(18, 0x7fffffffffffffff, 2, 1) | |
48 | REM(19, 2, 0x7fffffffffffffff, 2) | |
49 | REM(20, 0x8000000000000000, 2, 0) | |
50 | REM(21, 2, 0x8000000000000000, 2) | |
51 | REM(22, 0x7fffffffffffffff, 0x8000000000000000, 0x7fffffffffffffff) | |
52 | REM(23, 0x8000000000000000, 0x7fffffffffffffff, 0xffffffffffffffff) | |
53 | REM(24, 0x7fffffffffffffff, 0xffffffffffffffff, 0) | |
54 | REM(25, 0xffffffffffffffff, 0x7fffffffffffffff, 0xffffffffffffffff) | |
55 | REM(26, 0xffffffffffffffff, 0xffffffffffffffff, 0) | |
56 | UREM(14,0x7fffffffffffffff, 1, 0) | |
57 | UREM(15,1, 0x7fffffffffffffff, 1) | |
58 | UREM(16,0x8000000000000000, 1, 0) | |
59 | UREM(17,1, 0x8000000000000000, 1) | |
60 | UREM(18,0x7fffffffffffffff, 2, 1) | |
61 | UREM(19,2, 0x7fffffffffffffff, 2) | |
62 | UREM(20,0x8000000000000000, 2, 0) | |
63 | UREM(21,2, 0x8000000000000000, 2) | |
64 | UREM(22,0x7fffffffffffffff, 0x8000000000000000, 0x7fffffffffffffff) | |
65 | UREM(23,0x8000000000000000, 0x7fffffffffffffff, 1) | |
66 | UREM(24,0x7fffffffffffffff, 0xffffffffffffffff, 0x7fffffffffffffff) | |
67 | UREM(25,0xffffffffffffffff, 0x7fffffffffffffff, 1) | |
68 | UREM(26,0xffffffffffffffff, 0xffffffffffffffff, 0) | |
69 | #endif | |
70 | ||
71 | prepare | |
72 | pushargi ok | |
73 | ellipsis | |
74 | finishi @printf | |
75 | ret | |
76 | epilog |