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 -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE %s 13 14 // SSE-NOT: #define __SSE2_MATH__ 1 15 // SSE-NOT: #define __SSE2__ 1 16 // SSE-NOT: #define __SSE3__ 1 17 // SSE-NOT: #define __SSE4_1__ 1 18 // SSE-NOT: #define __SSE4_2__ 1 19 // SSE: #define __SSE_MATH__ 1 20 // SSE: #define __SSE__ 1 21 // SSE-NOT: #define __SSSE3__ 1 22 23 // RUN: %clang -target i386-unknown-unknown -march=pentium-m -x c -E -dM -o - %s | FileCheck --check-prefix=SSE2 %s 24 25 // SSE2: #define __SSE2_MATH__ 1 26 // SSE2: #define __SSE2__ 1 27 // SSE2-NOT: #define __SSE3__ 1 28 // SSE2-NOT: #define __SSE4_1__ 1 29 // SSE2-NOT: #define __SSE4_2__ 1 30 // SSE2: #define __SSE_MATH__ 1 31 // SSE2: #define __SSE__ 1 32 // SSE2-NOT: #define __SSSE3__ 1 33 34 // RUN: %clang -target i386-unknown-unknown -march=pentium-m -mno-sse -mavx -x c -E -dM -o - %s | FileCheck --check-prefix=AVX %s 35 36 // AVX: #define __AVX__ 1 37 // AVX: #define __SSE2_MATH__ 1 38 // AVX: #define __SSE2__ 1 39 // AVX: #define __SSE3__ 1 40 // AVX: #define __SSE4_1__ 1 41 // AVX: #define __SSE4_2__ 1 42 // AVX: #define __SSE_MATH__ 1 43 // AVX: #define __SSE__ 1 44 // AVX: #define __SSSE3__ 1 45 46 // RUN: %clang -target i386-unknown-unknown -march=pentium-m -mxop -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=SSE4A %s 47 48 // SSE4A: #define __SSE2_MATH__ 1 49 // SSE4A: #define __SSE2__ 1 50 // SSE4A: #define __SSE3__ 1 51 // SSE4A: #define __SSE4A__ 1 52 // SSE4A: #define __SSE4_1__ 1 53 // SSE4A: #define __SSE4_2__ 1 54 // SSE4A: #define __SSE_MATH__ 1 55 // SSE4A: #define __SSE__ 1 56 // SSE4A: #define __SSSE3__ 1 57 58 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512f -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512F %s 59 60 // AVX512F: #define __AVX2__ 1 61 // AVX512F: #define __AVX512F__ 1 62 // AVX512F: #define __AVX__ 1 63 // AVX512F: #define __SSE2_MATH__ 1 64 // AVX512F: #define __SSE2__ 1 65 // AVX512F: #define __SSE3__ 1 66 // AVX512F: #define __SSE4_1__ 1 67 // AVX512F: #define __SSE4_2__ 1 68 // AVX512F: #define __SSE_MATH__ 1 69 // AVX512F: #define __SSE__ 1 70 // AVX512F: #define __SSSE3__ 1 71 72 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512cd -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512CD %s 73 74 // AVX512CD: #define __AVX2__ 1 75 // AVX512CD: #define __AVX512CD__ 1 76 // AVX512CD: #define __AVX512F__ 1 77 // AVX512CD: #define __AVX__ 1 78 // AVX512CD: #define __SSE2_MATH__ 1 79 // AVX512CD: #define __SSE2__ 1 80 // AVX512CD: #define __SSE3__ 1 81 // AVX512CD: #define __SSE4_1__ 1 82 // AVX512CD: #define __SSE4_2__ 1 83 // AVX512CD: #define __SSE_MATH__ 1 84 // AVX512CD: #define __SSE__ 1 85 // AVX512CD: #define __SSSE3__ 1 86 87 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512er -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512ER %s 88 89 // AVX512ER: #define __AVX2__ 1 90 // AVX512ER: #define __AVX512ER__ 1 91 // AVX512ER: #define __AVX512F__ 1 92 // AVX512ER: #define __AVX__ 1 93 // AVX512ER: #define __SSE2_MATH__ 1 94 // AVX512ER: #define __SSE2__ 1 95 // AVX512ER: #define __SSE3__ 1 96 // AVX512ER: #define __SSE4_1__ 1 97 // AVX512ER: #define __SSE4_2__ 1 98 // AVX512ER: #define __SSE_MATH__ 1 99 // AVX512ER: #define __SSE__ 1 100 // AVX512ER: #define __SSSE3__ 1 101 102 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512pf -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512PF %s 103 104 // AVX512PF: #define __AVX2__ 1 105 // AVX512PF: #define __AVX512F__ 1 106 // AVX512PF: #define __AVX512PF__ 1 107 // AVX512PF: #define __AVX__ 1 108 // AVX512PF: #define __SSE2_MATH__ 1 109 // AVX512PF: #define __SSE2__ 1 110 // AVX512PF: #define __SSE3__ 1 111 // AVX512PF: #define __SSE4_1__ 1 112 // AVX512PF: #define __SSE4_2__ 1 113 // AVX512PF: #define __SSE_MATH__ 1 114 // AVX512PF: #define __SSE__ 1 115 // AVX512PF: #define __SSSE3__ 1 116 117 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512pf -mno-avx512f -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512F2 %s 118 119 // AVX512F2: #define __AVX2__ 1 120 // AVX512F2-NOT: #define __AVX512F__ 1 121 // AVX512F2-NOT: #define __AVX512PF__ 1 122 // AVX512F2: #define __AVX__ 1 123 // AVX512F2: #define __SSE2_MATH__ 1 124 // AVX512F2: #define __SSE2__ 1 125 // AVX512F2: #define __SSE3__ 1 126 // AVX512F2: #define __SSE4_1__ 1 127 // AVX512F2: #define __SSE4_2__ 1 128 // AVX512F2: #define __SSE_MATH__ 1 129 // AVX512F2: #define __SSE__ 1 130 // AVX512F2: #define __SSSE3__ 1 131 132 // RUN: %clang -target i386-unknown-unknown -march=atom -msse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE42POPCNT %s 133 134 // SSE42POPCNT: #define __POPCNT__ 1 135 136 // RUN: %clang -target i386-unknown-unknown -march=atom -mno-popcnt -msse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE42NOPOPCNT %s 137 138 // SSE42NOPOPCNT-NOT: #define __POPCNT__ 1 139 140 // RUN: %clang -target i386-unknown-unknown -march=atom -mpopcnt -mno-sse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=NOSSE42POPCNT %s 141 142 // NOSSE42POPCNT: #define __POPCNT__ 1 143 144 // RUN: %clang -target i386-unknown-unknown -march=atom -msse -x c -E -dM -o - %s | FileCheck --check-prefix=SSEMMX %s 145 146 // SSEMMX: #define __MMX__ 1 147 148 // RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-sse -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOSSEMMX %s 149 150 // SSENOSSEMMX-NOT: #define __MMX__ 1 151 152 // RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-mmx -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOMMX %s 153 154 // SSENOMMX-NOT: #define __MMX__ 1 155 156 // RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -x c -E -dM -o - %s | FileCheck --check-prefix=F16C %s 157 158 // F16C: #define __AVX__ 1 159 // F16C: #define __F16C__ 1 160 161 // RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=F16CNOAVX %s 162 163 // F16CNOAVX-NOT: #define __AVX__ 1 164 // F16CNOAVX-NOT: #define __F16C__ 1 165 166 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mpclmul -x c -E -dM -o - %s | FileCheck --check-prefix=PCLMUL %s 167 168 // PCLMUL: #define __PCLMUL__ 1 169 // PCLMUL: #define __SSE2__ 1 170 // PCLMUL-NOT: #define __SSE3__ 1 171 172 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mpclmul -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=PCLMULNOSSE2 %s 173 174 // PCLMULNOSSE2-NOT: #define __PCLMUL__ 1 175 // PCLMULNOSSE2-NOT: #define __SSE2__ 1 176 // PCLMULNOSSE2-NOT: #define __SSE3__ 1 177 178 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -maes -x c -E -dM -o - %s | FileCheck --check-prefix=AES %s 179 180 // AES: #define __AES__ 1 181 // AES: #define __SSE2__ 1 182 // AES-NOT: #define __SSE3__ 1 183 184 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -maes -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=AESNOSSE2 %s 185 186 // AESNOSSE2-NOT: #define __AES__ 1 187 // AESNOSSE2-NOT: #define __SSE2__ 1 188 // AESNOSSE2-NOT: #define __SSE3__ 1 189 190 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -x c -E -dM -o - %s | FileCheck --check-prefix=SHA %s 191 192 // SHA: #define __SHA__ 1 193 // SHA: #define __SSE2__ 1 194 // SHA-NOT: #define __SSE3__ 1 195 196 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sha -x c -E -dM -o - %s | FileCheck --check-prefix=SHANOSHA %s 197 198 // SHANOSHA-NOT: #define __SHA__ 1 199 // SHANOSHA-NOT: #define __SSE2__ 1 200 201 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=SHANOSSE2 %s 202 203 // SHANOSSE2-NOT: #define __SHA__ 1 204 // SHANOSSE2-NOT: #define __SSE2__ 1 205 // SHANOSSE2-NOT: #define __SSE3__ 1 206 207 // RUN: %clang -target i386-unknown-unknown -march=atom -mtbm -x c -E -dM -o - %s | FileCheck --check-prefix=TBM %s 208 209 // TBM: #define __TBM__ 1 210 211 // RUN: %clang -target i386-unknown-unknown -march=bdver2 -mno-tbm -x c -E -dM -o - %s | FileCheck --check-prefix=NOTBM %s 212 213 // NOTBM-NOT: #define __TBM__ 1 214 215 // RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mcx16 -x c -E -dM -o - %s | FileCheck --check-prefix=MCX16 %s 216 217 // MCX16: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1 218 219 // RUN: %clang -target i386-unknown-unknown -march=atom -mprfchw -x c -E -dM -o - %s | FileCheck --check-prefix=PRFCHW %s 220 221 // PRFCHW: #define __PRFCHW__ 1 222 223 // RUN: %clang -target i386-unknown-unknown -march=btver2 -mno-prfchw -x c -E -dM -o - %s | FileCheck --check-prefix=NOPRFCHW %s 224 225 // NOPRFCHW-NOT: #define __PRFCHW__ 1 226 227 // RUN: %clang -target i386-unknown-unknown -march=atom -m3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=3DNOWPRFCHW %s 228 229 // 3DNOWPRFCHW: #define __PRFCHW__ 1 230 231 // RUN: %clang -target i386-unknown-unknown -march=atom -mno-prfchw -m3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=3DNOWNOPRFCHW %s 232 233 // 3DNOWNOPRFCHW-NOT: #define __PRFCHW__ 1 234 235 // RUN: %clang -target i386-unknown-unknown -march=atom -mprfchw -mno-3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=NO3DNOWPRFCHW %s 236 237 // NO3DNOWPRFCHW: #define __PRFCHW__ 1 238 239