Home | History | Annotate | Download | only in Preprocessor
      1 // RUN: %clang -target i386-unknown-unknown -march=core2 -msse4 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE4 %s
      2 
      3 // SSE4: #define __SSE2_MATH__ 1
      4 // SSE4: #define __SSE2__ 1
      5 // SSE4: #define __SSE3__ 1
      6 // SSE4: #define __SSE4_1__ 1
      7 // SSE4: #define __SSE4_2__ 1
      8 // SSE4: #define __SSE_MATH__ 1
      9 // SSE4: #define __SSE__ 1
     10 // SSE4: #define __SSSE3__ 1
     11 
     12 // RUN: %clang -target i386-unknown-unknown -march=core2 -msse4.1 -mno-sse4 -x c -E -dM -o - %s | FileCheck --check-prefix=NOSSE4 %s
     13 
     14 // NOSSE4-NOT: #define __SSE4_1__ 1
     15 
     16 // RUN: %clang -target i386-unknown-unknown -march=core2 -msse4 -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE %s
     17 
     18 // SSE-NOT: #define __SSE2_MATH__ 1
     19 // SSE-NOT: #define __SSE2__ 1
     20 // SSE-NOT: #define __SSE3__ 1
     21 // SSE-NOT: #define __SSE4_1__ 1
     22 // SSE-NOT: #define __SSE4_2__ 1
     23 // SSE: #define __SSE_MATH__ 1
     24 // SSE: #define __SSE__ 1
     25 // SSE-NOT: #define __SSSE3__ 1
     26 
     27 // RUN: %clang -target i386-unknown-unknown -march=pentium-m -x c -E -dM -o - %s | FileCheck --check-prefix=SSE2 %s
     28 
     29 // SSE2: #define __SSE2_MATH__ 1
     30 // SSE2: #define __SSE2__ 1
     31 // SSE2-NOT: #define __SSE3__ 1
     32 // SSE2-NOT: #define __SSE4_1__ 1
     33 // SSE2-NOT: #define __SSE4_2__ 1
     34 // SSE2: #define __SSE_MATH__ 1
     35 // SSE2: #define __SSE__ 1
     36 // SSE2-NOT: #define __SSSE3__ 1
     37 
     38 // RUN: %clang -target i386-unknown-unknown -march=pentium-m -mno-sse -mavx -x c -E -dM -o - %s | FileCheck --check-prefix=AVX %s
     39 
     40 // AVX: #define __AVX__ 1
     41 // AVX: #define __SSE2_MATH__ 1
     42 // AVX: #define __SSE2__ 1
     43 // AVX: #define __SSE3__ 1
     44 // AVX: #define __SSE4_1__ 1
     45 // AVX: #define __SSE4_2__ 1
     46 // AVX: #define __SSE_MATH__ 1
     47 // AVX: #define __SSE__ 1
     48 // AVX: #define __SSSE3__ 1
     49 
     50 // RUN: %clang -target i386-unknown-unknown -march=pentium-m -mxop -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=SSE4A %s
     51 
     52 // SSE4A: #define __SSE2_MATH__ 1
     53 // SSE4A: #define __SSE2__ 1
     54 // SSE4A: #define __SSE3__ 1
     55 // SSE4A: #define __SSE4A__ 1
     56 // SSE4A: #define __SSE4_1__ 1
     57 // SSE4A: #define __SSE4_2__ 1
     58 // SSE4A: #define __SSE_MATH__ 1
     59 // SSE4A: #define __SSE__ 1
     60 // SSE4A: #define __SSSE3__ 1
     61 
     62 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512f -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512F %s
     63 
     64 // AVX512F: #define __AVX2__ 1
     65 // AVX512F: #define __AVX512F__ 1
     66 // AVX512F: #define __AVX__ 1
     67 // AVX512F: #define __SSE2_MATH__ 1
     68 // AVX512F: #define __SSE2__ 1
     69 // AVX512F: #define __SSE3__ 1
     70 // AVX512F: #define __SSE4_1__ 1
     71 // AVX512F: #define __SSE4_2__ 1
     72 // AVX512F: #define __SSE_MATH__ 1
     73 // AVX512F: #define __SSE__ 1
     74 // AVX512F: #define __SSSE3__ 1
     75 
     76 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512cd -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512CD %s
     77 
     78 // AVX512CD: #define __AVX2__ 1
     79 // AVX512CD: #define __AVX512CD__ 1
     80 // AVX512CD: #define __AVX512F__ 1
     81 // AVX512CD: #define __AVX__ 1
     82 // AVX512CD: #define __SSE2_MATH__ 1
     83 // AVX512CD: #define __SSE2__ 1
     84 // AVX512CD: #define __SSE3__ 1
     85 // AVX512CD: #define __SSE4_1__ 1
     86 // AVX512CD: #define __SSE4_2__ 1
     87 // AVX512CD: #define __SSE_MATH__ 1
     88 // AVX512CD: #define __SSE__ 1
     89 // AVX512CD: #define __SSSE3__ 1
     90 
     91 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512er -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512ER %s
     92 
     93 // AVX512ER: #define __AVX2__ 1
     94 // AVX512ER: #define __AVX512ER__ 1
     95 // AVX512ER: #define __AVX512F__ 1
     96 // AVX512ER: #define __AVX__ 1
     97 // AVX512ER: #define __SSE2_MATH__ 1
     98 // AVX512ER: #define __SSE2__ 1
     99 // AVX512ER: #define __SSE3__ 1
    100 // AVX512ER: #define __SSE4_1__ 1
    101 // AVX512ER: #define __SSE4_2__ 1
    102 // AVX512ER: #define __SSE_MATH__ 1
    103 // AVX512ER: #define __SSE__ 1
    104 // AVX512ER: #define __SSSE3__ 1
    105 
    106 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512pf -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512PF %s
    107 
    108 // AVX512PF: #define __AVX2__ 1
    109 // AVX512PF: #define __AVX512F__ 1
    110 // AVX512PF: #define __AVX512PF__ 1
    111 // AVX512PF: #define __AVX__ 1
    112 // AVX512PF: #define __SSE2_MATH__ 1
    113 // AVX512PF: #define __SSE2__ 1
    114 // AVX512PF: #define __SSE3__ 1
    115 // AVX512PF: #define __SSE4_1__ 1
    116 // AVX512PF: #define __SSE4_2__ 1
    117 // AVX512PF: #define __SSE_MATH__ 1
    118 // AVX512PF: #define __SSE__ 1
    119 // AVX512PF: #define __SSSE3__ 1
    120 
    121 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512dq -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512DQ %s
    122 
    123 // AVX512DQ: #define __AVX2__ 1
    124 // AVX512DQ: #define __AVX512DQ__ 1
    125 // AVX512DQ: #define __AVX512F__ 1
    126 // AVX512DQ: #define __AVX__ 1
    127 // AVX512DQ: #define __SSE2_MATH__ 1
    128 // AVX512DQ: #define __SSE2__ 1
    129 // AVX512DQ: #define __SSE3__ 1
    130 // AVX512DQ: #define __SSE4_1__ 1
    131 // AVX512DQ: #define __SSE4_2__ 1
    132 // AVX512DQ: #define __SSE_MATH__ 1
    133 // AVX512DQ: #define __SSE__ 1
    134 // AVX512DQ: #define __SSSE3__ 1
    135 
    136 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512bw -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512BW %s
    137 
    138 // AVX512BW: #define __AVX2__ 1
    139 // AVX512BW: #define __AVX512BW__ 1
    140 // AVX512BW: #define __AVX512F__ 1
    141 // AVX512BW: #define __AVX__ 1
    142 // AVX512BW: #define __SSE2_MATH__ 1
    143 // AVX512BW: #define __SSE2__ 1
    144 // AVX512BW: #define __SSE3__ 1
    145 // AVX512BW: #define __SSE4_1__ 1
    146 // AVX512BW: #define __SSE4_2__ 1
    147 // AVX512BW: #define __SSE_MATH__ 1
    148 // AVX512BW: #define __SSE__ 1
    149 // AVX512BW: #define __SSSE3__ 1
    150 
    151 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512vl -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512VL %s
    152 
    153 // AVX512VL: #define __AVX2__ 1
    154 // AVX512VL: #define __AVX512F__ 1
    155 // AVX512VL: #define __AVX512VL__ 1
    156 // AVX512VL: #define __AVX__ 1
    157 // AVX512VL: #define __SSE2_MATH__ 1
    158 // AVX512VL: #define __SSE2__ 1
    159 // AVX512VL: #define __SSE3__ 1
    160 // AVX512VL: #define __SSE4_1__ 1
    161 // AVX512VL: #define __SSE4_2__ 1
    162 // AVX512VL: #define __SSE_MATH__ 1
    163 // AVX512VL: #define __SSE__ 1
    164 // AVX512VL: #define __SSSE3__ 1
    165 
    166 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512pf -mno-avx512f -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512F2 %s
    167 
    168 // AVX512F2: #define __AVX2__ 1
    169 // AVX512F2-NOT: #define __AVX512F__ 1
    170 // AVX512F2-NOT: #define __AVX512PF__ 1
    171 // AVX512F2: #define __AVX__ 1
    172 // AVX512F2: #define __SSE2_MATH__ 1
    173 // AVX512F2: #define __SSE2__ 1
    174 // AVX512F2: #define __SSE3__ 1
    175 // AVX512F2: #define __SSE4_1__ 1
    176 // AVX512F2: #define __SSE4_2__ 1
    177 // AVX512F2: #define __SSE_MATH__ 1
    178 // AVX512F2: #define __SSE__ 1
    179 // AVX512F2: #define __SSSE3__ 1
    180 
    181 // RUN: %clang -target i386-unknown-unknown -march=atom -msse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE42POPCNT %s
    182 
    183 // SSE42POPCNT: #define __POPCNT__ 1
    184 
    185 // RUN: %clang -target i386-unknown-unknown -march=atom -mno-popcnt -msse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE42NOPOPCNT %s
    186 
    187 // SSE42NOPOPCNT-NOT: #define __POPCNT__ 1
    188 
    189 // RUN: %clang -target i386-unknown-unknown -march=atom -mpopcnt -mno-sse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=NOSSE42POPCNT %s
    190 
    191 // NOSSE42POPCNT: #define __POPCNT__ 1
    192 
    193 // RUN: %clang -target i386-unknown-unknown -march=atom -msse -x c -E -dM -o - %s | FileCheck --check-prefix=SSEMMX %s
    194 
    195 // SSEMMX: #define __MMX__ 1
    196 
    197 // RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-sse -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOSSEMMX %s
    198 
    199 // SSENOSSEMMX-NOT: #define __MMX__ 1
    200 
    201 // RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-mmx -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOMMX %s
    202 
    203 // SSENOMMX-NOT: #define __MMX__ 1
    204 
    205 // RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -x c -E -dM -o - %s | FileCheck --check-prefix=F16C %s
    206 
    207 // F16C: #define __AVX__ 1
    208 // F16C: #define __F16C__ 1
    209 
    210 // RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=F16CNOAVX %s
    211 
    212 // F16CNOAVX-NOT: #define __AVX__ 1
    213 // F16CNOAVX-NOT: #define __F16C__ 1
    214 
    215 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mpclmul -x c -E -dM -o - %s | FileCheck --check-prefix=PCLMUL %s
    216 
    217 // PCLMUL: #define __PCLMUL__ 1
    218 // PCLMUL: #define __SSE2__ 1
    219 // PCLMUL-NOT: #define __SSE3__ 1
    220 
    221 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mpclmul -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=PCLMULNOSSE2 %s
    222 
    223 // PCLMULNOSSE2-NOT: #define __PCLMUL__ 1
    224 // PCLMULNOSSE2-NOT: #define __SSE2__ 1
    225 // PCLMULNOSSE2-NOT: #define __SSE3__ 1
    226 
    227 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -maes -x c -E -dM -o - %s | FileCheck --check-prefix=AES %s
    228 
    229 // AES: #define __AES__ 1
    230 // AES: #define __SSE2__ 1
    231 // AES-NOT: #define __SSE3__ 1
    232 
    233 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -maes -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=AESNOSSE2 %s
    234 
    235 // AESNOSSE2-NOT: #define __AES__ 1
    236 // AESNOSSE2-NOT: #define __SSE2__ 1
    237 // AESNOSSE2-NOT: #define __SSE3__ 1
    238 
    239 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -x c -E -dM -o - %s | FileCheck --check-prefix=SHA %s
    240 
    241 // SHA: #define __SHA__ 1
    242 // SHA: #define __SSE2__ 1
    243 // SHA-NOT: #define __SSE3__ 1
    244 
    245 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sha -x c -E -dM -o - %s | FileCheck --check-prefix=SHANOSHA %s
    246 
    247 // SHANOSHA-NOT: #define __SHA__ 1
    248 // SHANOSHA-NOT: #define __SSE2__ 1
    249 
    250 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=SHANOSSE2 %s
    251 
    252 // SHANOSSE2-NOT: #define __SHA__ 1
    253 // SHANOSSE2-NOT: #define __SSE2__ 1
    254 // SHANOSSE2-NOT: #define __SSE3__ 1
    255 
    256 // RUN: %clang -target i386-unknown-unknown -march=atom -mtbm -x c -E -dM -o - %s | FileCheck --check-prefix=TBM %s
    257 
    258 // TBM: #define __TBM__ 1
    259 
    260 // RUN: %clang -target i386-unknown-unknown -march=bdver2 -mno-tbm -x c -E -dM -o - %s | FileCheck --check-prefix=NOTBM %s
    261 
    262 // NOTBM-NOT: #define __TBM__ 1
    263 
    264 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mcx16 -x c -E -dM -o - %s | FileCheck --check-prefix=MCX16 %s
    265 
    266 // MCX16: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
    267 
    268 // RUN: %clang -target i386-unknown-unknown -march=atom -mprfchw -x c -E -dM -o - %s | FileCheck --check-prefix=PRFCHW %s
    269 
    270 // PRFCHW: #define __PRFCHW__ 1
    271 
    272 // RUN: %clang -target i386-unknown-unknown -march=btver2 -mno-prfchw -x c -E -dM -o - %s | FileCheck --check-prefix=NOPRFCHW %s
    273 
    274 // NOPRFCHW-NOT: #define __PRFCHW__ 1
    275 
    276 // RUN: %clang -target i386-unknown-unknown -march=atom -m3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=3DNOWPRFCHW %s
    277 
    278 // 3DNOWPRFCHW: #define __PRFCHW__ 1
    279 
    280 // RUN: %clang -target i386-unknown-unknown -march=atom -mno-prfchw -m3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=3DNOWNOPRFCHW %s
    281 
    282 // 3DNOWNOPRFCHW-NOT: #define __PRFCHW__ 1
    283 
    284 // RUN: %clang -target i386-unknown-unknown -march=atom -mprfchw -mno-3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=NO3DNOWPRFCHW %s
    285 
    286 // NO3DNOWPRFCHW: #define __PRFCHW__ 1
    287 
    288 // RUN: %clang -target i386-unknown-unknown -march=atom -madx -x c -E -dM -o - %s | FileCheck --check-prefix=ADX %s
    289 
    290 // ADX: #define __ADX__ 1
    291 
    292 // RUN: %clang -target i386-unknown-unknown -march=atom -mrdseed -x c -E -dM -o - %s | FileCheck --check-prefix=RDSEED %s
    293 
    294 // RDSEED: #define __RDSEED__ 1
    295 
    296