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#include "xdefs.h"
18
19#define STR(s) #s
20
21#define BMI_OPS  \
22  /* inst */     \
23  X(ctlz)        \
24  X(cttz)        \
25  X(ctpop)
26// #define X(inst)
27
28#define BMI_TYPES \
29  /* type */      \
30  X(uint32)     \
31  X(uint64)
32// #define X(type)
33
34#define FOR_ALL_BMI_TYPES_INST(F, inst) \
35  F(inst, uint32)                     \
36  F(inst, uint64)
37
38#define FOR_ALL_BMI_OP_TYPES(X) \
39  FOR_ALL_BMI_TYPES_INST(X, ctlz)     \
40  FOR_ALL_BMI_TYPES_INST(X, cttz)     \
41  FOR_ALL_BMI_TYPES_INST(X, ctpop)
42//#define X(inst, type)
43
44#define BSWAP_TABLE              \
45  /* type, builtin_name */       \
46  X(uint16_t, __builtin_bswap16) \
47  X(uint32, __builtin_bswap32) \
48  X(uint64, __builtin_bswap64)
49
50#endif // TEST_BIT_MANIP_DEF
51