File: predefined-arch-macros-x86.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (55 lines) | stat: -rw-r--r-- 2,037 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// RUN: %clang -target x86_64 -march=x86-64 -E -dM %s > %tv1
// RUN: FileCheck %s --check-prefix=X86_64_V1 < %tv1

// X86_64_V1: #define __MMX__ 1
// X86_64_V1: #define __SSE2_MATH__ 1
// X86_64_V1: #define __SSE2__ 1
// X86_64_V1: #define __SSE_MATH__ 1
// X86_64_V1: #define __SSE__ 1
// X86_64_V1: #define __amd64 1
// X86_64_V1: #define __amd64__ 1
// X86_64_V1: #define __k8 1
// X86_64_V1: #define __k8__ 1
// X86_64_V1: #define __x86_64 1
// X86_64_V1: #define __x86_64__ 1

// RUN: %clang -target x86_64 -march=x86-64-v2 -E -dM %s > %tv2
// RUN: diff %tv1 %tv2 > %t.txt || true
// RUN: FileCheck %s --check-prefix=X86_64_V2 < %t.txt

/// v2 is close to Nehalem.
// X86_64_V2:      #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
// X86_64_V2:      #define __LAHF_SAHF__ 1
// X86_64_V2:      #define __POPCNT__ 1
// X86_64_V2:      #define __SSE3__ 1
// X86_64_V2-NEXT: #define __SSE4_1__ 1
// X86_64_V2-NEXT: #define __SSE4_2__ 1
// X86_64_V2:      #define __SSSE3__ 1

/// v3 is close to Haswell.
// RUN: %clang -target x86_64 -march=x86-64-v3 -E -dM %s > %tv3
// RUN: diff %tv2 %tv3 > %t.txt || true
// RUN: FileCheck %s --check-prefix=X86_64_V3 < %t.txt

// X86_64_V3:      #define __AVX2__ 1
// X86_64_V3-NEXT: #define __AVX__ 1
// X86_64_V3:      #define __BMI2__ 1
// X86_64_V3-NEXT: #define __BMI__ 1
// X86_64_V3:      #define __F16C__ 1
// X86_64_V3:      #define __FMA__ 1
// X86_64_V3:      #define __LZCNT__ 1
// X86_64_V3:      #define __MOVBE__ 1
// X86_64_V3:      #define __XSAVE__ 1

/// v4 is close to the AVX-512 level implemented by Xeon Scalable Processors.
// RUN: %clang -target x86_64 -march=x86-64-v4 -E -dM %s > %tv4
// RUN: diff %tv3 %tv4 > %t.txt || true
// RUN: FileCheck %s --check-prefix=X86_64_V4 < %t.txt

// X86_64_V4:      #define __AVX512BW__ 1
// X86_64_V4-NEXT: #define __AVX512CD__ 1
// X86_64_V4-NEXT: #define __AVX512DQ__ 1
// X86_64_V4-NEXT: #define __AVX512F__ 1
// X86_64_V4-NEXT: #define __AVX512VL__ 1
// X86_64_V4-NOT:  #define __AVX512{{.*}}
// X86_64_V4:      #define __EVEX512__ 1