Jan Voung | e4da26f | 2014-07-15 17:52:39 -0700 | [diff] [blame] | 1 | //===- subzero/crosstest/test_bitmanip.def - macros for tests -*- C++ -*---===// |
| 2 | // |
| 3 | // The Subzero Code Generator |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines macros for testing bit manipulation intrinsics. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef TEST_BIT_MANIP_DEF |
| 15 | #define TEST_BIT_MANIP_DEF |
| 16 | |
| 17 | #define STR(s) #s |
| 18 | |
| 19 | #define BMI_OPS \ |
| 20 | /* inst */ \ |
| 21 | X(ctlz) \ |
| 22 | X(cttz) \ |
| 23 | X(ctpop) |
| 24 | // #define X(inst) |
| 25 | |
| 26 | #define BMI_TYPES \ |
| 27 | /* type */ \ |
| 28 | X(uint32_t) \ |
| 29 | X(uint64_t) |
| 30 | // #define X(type) |
| 31 | |
| 32 | #define FOR_ALL_BMI_TYPES_INST(F, inst) \ |
| 33 | F(inst, uint32_t) \ |
| 34 | F(inst, uint64_t) |
| 35 | |
| 36 | #define FOR_ALL_BMI_OP_TYPES(X) \ |
| 37 | FOR_ALL_BMI_TYPES_INST(X, ctlz) \ |
| 38 | FOR_ALL_BMI_TYPES_INST(X, cttz) \ |
| 39 | FOR_ALL_BMI_TYPES_INST(X, ctpop) |
| 40 | //#define X(inst, type) |
| 41 | |
Jan Voung | 7fa813b | 2014-07-18 13:01:08 -0700 | [diff] [blame] | 42 | #define BSWAP_TABLE \ |
| 43 | /* type, builtin_name */ \ |
| 44 | X(uint16_t, __builtin_bswap16) \ |
| 45 | X(uint32_t, __builtin_bswap32) \ |
| 46 | X(uint64_t, __builtin_bswap64) |
| 47 | |
Jan Voung | e4da26f | 2014-07-15 17:52:39 -0700 | [diff] [blame] | 48 | #endif // TEST_BIT_MANIP_DEF |