Commit | Line | Data |
---|---|---|
4a71579b PC |
1 | #include "qalu.inc" |
2 | ||
3 | .code | |
4 | prolog | |
5 | #define QMUL(N, I0, I1, LO, HI) QALU(N, , qmul, I0, I1, LO, HI) | |
6 | #define UQMUL(N, I0, I1, LO, HI) QALU(N, _u, qmul, I0, I1, LO, HI) | |
7 | QMUL(0, -2, -1, 2, 0) | |
8 | QMUL(1, 0, -1, 0, 0) | |
9 | QMUL(2, -1, 0, 0, 0) | |
10 | QMUL(3, 1, -1, -1, -1) | |
11 | #if __WORDSIZE == 32 | |
12 | QMUL(4, 0x7ffff, 0x7ffff, 0xfff00001, 0x3f) | |
13 | UQMUL(5, 0xffffff, 0xffffff, 0xfe000001, 0xffff) | |
14 | QMUL(6, 0x80000000, -2, 0, 1) | |
15 | QMUL(7, 0x80000000, 2, 0, -1) | |
16 | QMUL(8, 0x80000001, 3, 0x80000003, -2) | |
17 | QMUL(9, 0x80000001, -3, 0x7ffffffd, 1) | |
18 | #else | |
19 | QMUL(4, 0x7ffffffff, 0x7ffffffff, 0xfffffff000000001, 0x3f) | |
20 | UQMUL(5, 0xffffffffff, 0xffffffffff, 0xfffffe0000000001, 0xffff) | |
21 | QMUL(6, 0x8000000000000000, -2, 0, 1) | |
22 | QMUL(7, 0x8000000000000000, 2, 0, -1) | |
23 | QMUL(8, 0x8000000000000001, 3, 0x8000000000000003, -2) | |
24 | QMUL(9, 0x8000000000000001, -3, 0x7ffffffffffffffd, 1) | |
25 | #endif | |
26 | prepare | |
27 | pushargi ok | |
28 | ellipsis | |
29 | finishi @printf | |
30 | ret | |
31 | epilog |