OLD | NEW |
1 //===- subzero/crosstest/test_arith.def - macros for tests ----*- C++ -*---===// | 1 //===- subzero/crosstest/test_arith.def - macros for tests ----*- C++ -*---===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines macros for crosstesting arithmetic operations. | 10 // This file defines macros for crosstesting arithmetic operations. |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 #ifndef TEST_ARITH_DEF | 14 #ifndef TEST_ARITH_DEF |
15 #define TEST_ARITH_DEF | 15 #define TEST_ARITH_DEF |
16 | 16 |
17 #define XSTR(s) STR(s) | 17 #define XSTR(s) STR(s) |
18 #define STR(s) #s | 18 #define STR(s) #s |
19 | 19 |
20 #define UINTOP_TABLE \ | 20 #define UINTOP_TABLE \ |
21 /* inst, operator, div */ \ | 21 /* inst, operator, div, shift */ \ |
22 X(Add, +, 0 ) \ | 22 X(Add, +, 0, 0) \ |
23 X(Sub, -, 0 ) \ | 23 X(Sub, -, 0, 0) \ |
24 X(Mul, *, 0 ) \ | 24 X(Mul, *, 0, 0) \ |
25 X(Udiv, /, 1 ) \ | 25 X(Udiv, /, 1, 0) \ |
26 X(Urem, %, 1 ) \ | 26 X(Urem, %, 1, 0) \ |
27 X(Shl, <<, 0) \ | 27 X(Shl, <<, 0, 1) \ |
28 X(Lshr, >>, 0) \ | 28 X(Lshr, >>, 0, 1) \ |
29 X(And, &, 0 ) \ | 29 X(And, &, 0, 0) \ |
30 X(Or, |, 0 ) \ | 30 X(Or, |, 0, 0) \ |
31 X(Xor, ^, 0 ) \ | 31 X(Xor, ^, 0, 0) \ |
32 //#define X(inst, op, isdiv) | 32 //#define X(inst, op, isdiv, isshift) |
33 | 33 |
34 #define SINTOP_TABLE \ | 34 #define SINTOP_TABLE \ |
35 /* inst, operator, div */ \ | 35 /* inst, operator, div, shift */ \ |
36 X(Sdiv, /, 1) \ | 36 X(Sdiv, /, 1, 0) \ |
37 X(Srem, %, 1) \ | 37 X(Srem, %, 1, 0) \ |
38 X(Ashr, >>, 0) \ | 38 X(Ashr, >>, 0, 1) \ |
39 //#define X(inst, op, isdiv) | 39 //#define X(inst, op, isdiv, isshift) |
40 | 40 |
41 #define COMMA , | 41 #define COMMA , |
42 #define FPOP_TABLE \ | 42 #define FPOP_TABLE \ |
43 /* inst, infix_op, func */ \ | 43 /* inst, infix_op, func */ \ |
44 X(Fadd, +, ) \ | 44 X(Fadd, +, ) \ |
45 X(Fsub, -, ) \ | 45 X(Fsub, -, ) \ |
46 X(Fmul, *, ) \ | 46 X(Fmul, *, ) \ |
47 X(Fdiv, /, ) \ | 47 X(Fdiv, /, ) \ |
48 X(Frem, COMMA, myFrem) \ | 48 X(Frem, COMMA, myFrem) \ |
49 //#define X(inst, op, func) | 49 //#define X(inst, op, func) |
50 | 50 |
51 // Note: The above definition of COMMA, plus the "func" argument to | 51 // Note: The above definition of COMMA, plus the "func" argument to |
52 // the X macro, are because C++ does not allow the % operator on | 52 // the X macro, are because C++ does not allow the % operator on |
(...skipping 19 matching lines...) Expand all Loading... |
72 0x7fffffff, 0x80000000, 0x80000001, \ | 72 0x7fffffff, 0x80000000, 0x80000001, \ |
73 0xfffffffe, 0xffffffff, 0x100000000ll, \ | 73 0xfffffffe, 0xffffffff, 0x100000000ll, \ |
74 0x100000001ll, 0x7ffffffffffffffell, 0x7fffffffffffffffll, \ | 74 0x100000001ll, 0x7ffffffffffffffell, 0x7fffffffffffffffll, \ |
75 0x8000000000000000ll, 0x8000000000000001ll, 0xfffffffffffffffell, \ | 75 0x8000000000000000ll, 0x8000000000000001ll, 0xfffffffffffffffell, \ |
76 0xffffffffffffffffll, NegInf, PosInf, \ | 76 0xffffffffffffffffll, NegInf, PosInf, \ |
77 Nan, NegNan, -0.0, \ | 77 Nan, NegNan, -0.0, \ |
78 FLT_MIN, FLT_MAX, DBL_MIN, \ | 78 FLT_MIN, FLT_MAX, DBL_MIN, \ |
79 DBL_MAX } | 79 DBL_MAX } |
80 | 80 |
81 #endif // TEST_ARITH_DEF | 81 #endif // TEST_ARITH_DEF |
OLD | NEW |