1 //===- subzero/crosstest/test_sync_atomic.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 atomic intrinsics (via sync builtins). 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef TEST_SYNC_ATOMIC_DEF 15 #define TEST_SYNC_ATOMIC_DEF 16 17 #include "xdefs.h" 18 19 #define STR(s) #s 20 21 #define RMWOP_TABLE \ 22 /* inst */ \ 23 X(add) \ 24 X(sub) \ 25 X(or) \ 26 X(and) \ 27 X(xor) 28 //#define X(inst) 29 30 #define ATOMIC_TYPE_TABLE \ 31 /* type */ \ 32 X(uint8_t) \ 33 X(uint16_t) \ 34 X(uint32_t) \ 35 X(uint64) 36 //#define X(type) 37 38 #define FOR_ALL_RMWTYPES_INST(F, inst) \ 39 F(inst, uint8_t) \ 40 F(inst, uint16_t) \ 41 F(inst, uint32_t) \ 42 F(inst, uint64) 43 44 #define FOR_ALL_RMWOP_TYPES(X) \ 45 FOR_ALL_RMWTYPES_INST(X, add) \ 46 FOR_ALL_RMWTYPES_INST(X, sub) \ 47 FOR_ALL_RMWTYPES_INST(X, or) \ 48 FOR_ALL_RMWTYPES_INST(X, and) \ 49 FOR_ALL_RMWTYPES_INST(X, xor) 50 //#define X(inst, type) 51 52 #endif // TEST_SYNC_ATOMIC_DEF 53