Skip to content

Commit 278e533

Browse files
authored
[X86] Support -march=pantherlake,clearwaterforest (#69277)
1 parent 7f1733a commit 278e533

File tree

16 files changed

+118
-4
lines changed

16 files changed

+118
-4
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ X86 Support
571571
* Support intrinsic of ``_urdmsr``.
572572
* Support intrinsic of ``_uwrmsr``.
573573
- Support ISA of ``AVX10.1``.
574+
- ``-march=pantherlake`` and ``-march=clearwaterforest`` are now supported.
574575

575576
Arm and AArch64 Support
576577
^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/Basic/Targets/X86.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,13 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
588588
case CK_Arrowlake:
589589
case CK_ArrowlakeS:
590590
case CK_Lunarlake:
591+
case CK_Pantherlake:
591592
case CK_Sierraforest:
592593
case CK_Grandridge:
593594
case CK_Graniterapids:
594595
case CK_GraniterapidsD:
595596
case CK_Emeraldrapids:
597+
case CK_Clearwaterforest:
596598
// FIXME: Historically, we defined this legacy name, it would be nice to
597599
// remove it at some point. We've never exposed fine-grained names for
598600
// recent primary x86 CPUs, and we should keep it that way.
@@ -1501,11 +1503,13 @@ std::optional<unsigned> X86TargetInfo::getCPUCacheLineSize() const {
15011503
case CK_Arrowlake:
15021504
case CK_ArrowlakeS:
15031505
case CK_Lunarlake:
1506+
case CK_Pantherlake:
15041507
case CK_Sierraforest:
15051508
case CK_Grandridge:
15061509
case CK_Graniterapids:
15071510
case CK_GraniterapidsD:
15081511
case CK_Emeraldrapids:
1512+
case CK_Clearwaterforest:
15091513
case CK_KNL:
15101514
case CK_KNM:
15111515
// K7

clang/test/CodeGen/attr-cpuspecific-cpus.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ ATTR(cpu_specific(arrowlake)) void CPU35(void){}
8484
ATTR(cpu_specific(arrowlake_s)) void CPU36(void){}
8585
ATTR(cpu_specific(lunarlake)) void CPU37(void){}
8686
ATTR(cpu_specific(gracemont)) void CPU38(void){}
87+
ATTR(cpu_specific(pantherlake)) void CPU39(void){}
88+
ATTR(cpu_specific(clearwaterforest)) void CPU40(void){}

clang/test/CodeGen/attr-target-mv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ int __attribute__((target("arch=arrowlake"))) foo(void) {return 21;}
2626
int __attribute__((target("arch=arrowlake-s"))) foo(void) {return 22;}
2727
int __attribute__((target("arch=lunarlake"))) foo(void) {return 23;}
2828
int __attribute__((target("arch=gracemont"))) foo(void) {return 24;}
29+
int __attribute__((target("arch=pantherlake"))) foo(void) {return 25;}
30+
int __attribute__((target("arch=clearwaterforest"))) foo(void) {return 26;}
2931
int __attribute__((target("default"))) foo(void) { return 2; }
3032

3133
int bar(void) {
@@ -190,6 +192,10 @@ void calls_pr50025c(void) { pr50025c(); }
190192
// LINUX: ret i32 23
191193
// LINUX: define{{.*}} i32 @foo.arch_gracemont()
192194
// LINUX: ret i32 24
195+
// LINUX: define{{.*}} i32 @foo.arch_pantherlake()
196+
// LINUX: ret i32 25
197+
// LINUX: define{{.*}} i32 @foo.arch_clearwaterforest()
198+
// LINUX: ret i32 26
193199
// LINUX: define{{.*}} i32 @foo()
194200
// LINUX: ret i32 2
195201
// LINUX: define{{.*}} i32 @bar()
@@ -243,6 +249,10 @@ void calls_pr50025c(void) { pr50025c(); }
243249
// WINDOWS: ret i32 23
244250
// WINDOWS: define dso_local i32 @foo.arch_gracemont()
245251
// WINDOWS: ret i32 24
252+
// WINDOWS: define dso_local i32 @foo.arch_pantherlake()
253+
// WINDOWS: ret i32 25
254+
// WINDOWS: define dso_local i32 @foo.arch_clearwaterforest()
255+
// WINDOWS: ret i32 26
246256
// WINDOWS: define dso_local i32 @foo()
247257
// WINDOWS: ret i32 2
248258
// WINDOWS: define dso_local i32 @bar()

clang/test/CodeGen/target-builtin-noerror.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ void verifycpustrings(void) {
114114
(void)__builtin_cpu_is("arrowlake");
115115
(void)__builtin_cpu_is("arrowlake-s");
116116
(void)__builtin_cpu_is("lunarlake");
117+
(void)__builtin_cpu_is("clearwaterforest");
118+
(void)__builtin_cpu_is("pantherlake");
117119
(void)__builtin_cpu_is("haswell");
118120
(void)__builtin_cpu_is("icelake-client");
119121
(void)__builtin_cpu_is("icelake-server");

clang/test/Driver/x86-march.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@
112112
// RUN: | FileCheck %s -check-prefix=gracemont
113113
// gracemont: "-target-cpu" "gracemont"
114114
//
115+
// RUN: %clang --target=x86_64 -c -### %s -march=pantherlake 2>&1 \
116+
// RUN: | FileCheck %s -check-prefix=pantherlake
117+
// pantherlake: "-target-cpu" "pantherlake"
118+
//
119+
// RUN: %clang --target=x86_64 -c -### %s -march=clearwaterforest 2>&1 \
120+
// RUN: | FileCheck %s -check-prefix=clearwaterforest
121+
// clearwaterforest: "-target-cpu" "clearwaterforest"
122+
//
115123
// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=lakemont 2>&1 \
116124
// RUN: | FileCheck %s -check-prefix=lakemont
117125
// lakemont: "-target-cpu" "lakemont"

clang/test/Misc/target-invalid-cpu-note.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313

1414
// RUN: not %clang_cc1 -triple i386--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86
1515
// X86: error: unknown target CPU 'not-a-cpu'
16-
// X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, x86-64-v2, x86-64-v3, x86-64-v4, geode{{$}}
16+
// X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, pantherlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, clearwaterforest, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, x86-64-v2, x86-64-v3, x86-64-v4, geode{{$}}
1717

1818
// RUN: not %clang_cc1 -triple x86_64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86_64
1919
// X86_64: error: unknown target CPU 'not-a-cpu'
20-
// X86_64-NEXT: note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, x86-64-v2, x86-64-v3, x86-64-v4{{$}}
20+
// X86_64-NEXT: note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, pantherlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, clearwaterforest, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, x86-64-v2, x86-64-v3, x86-64-v4{{$}}
2121

2222
// RUN: not %clang_cc1 -triple i386--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_X86
2323
// TUNE_X86: error: unknown target CPU 'not-a-cpu'
24-
// TUNE_X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, geode{{$}}
24+
// TUNE_X86-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, pantherlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, clearwaterforest, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, geode{{$}}
2525

2626
// RUN: not %clang_cc1 -triple x86_64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_X86_64
2727
// TUNE_X86_64: error: unknown target CPU 'not-a-cpu'
28-
// TUNE_X86_64-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, geode{{$}}
28+
// TUNE_X86_64-NEXT: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, pantherlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, clearwaterforest, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, geode{{$}}
2929

3030
// RUN: not %clang_cc1 -triple nvptx--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix NVPTX
3131
// NVPTX: error: unknown target CPU 'not-a-cpu'

clang/test/Preprocessor/predefined-arch-macros.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,12 @@
25032503
// RUN: %clang -march=lunarlake -m32 -E -dM %s -o - 2>&1 \
25042504
// RUN: -target i386-unknown-linux \
25052505
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32
2506+
// RUN: %clang -march=pantherlake -m32 -E -dM %s -o - 2>&1 \
2507+
// RUN: -target i386-unknown-linux \
2508+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_PTL_M32
2509+
// RUN: %clang -march=clearwaterforest -m32 -E -dM %s -o - 2>&1 \
2510+
// RUN: -target i386-unknown-linux \
2511+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_PTL_M32,CHECK_CWF_M32
25062512
// CHECK_SRF_M32: #define __ADX__ 1
25072513
// CHECK_SRF_M32: #define __AES__ 1
25082514
// CHECK_SRF_M32: #define __AVX2__ 1
@@ -2538,6 +2544,9 @@
25382544
// CHECK_SRF_M32: #define __PCONFIG__ 1
25392545
// CHECK_SRF_M32: #define __PKU__ 1
25402546
// CHECK_SRF_M32: #define __POPCNT__ 1
2547+
// CHECK_SRF_M32-NOT: #define __PREFETCHI__ 1
2548+
// CHECK_ARLS_M32-NOT: #define __PREFETCHI__ 1
2549+
// CHECK_PTL_M32: #define __PREFETCHI__ 1
25412550
// CHECK_SRF_M32: #define __PRFCHW__ 1
25422551
// CHECK_SRF_M32: #define __PTWRITE__ 1
25432552
// CHECK_SRF_M32-NOT: #define __RAOINT__ 1
@@ -2563,6 +2572,10 @@
25632572
// CHECK_SRF_M32: #define __SSE__ 1
25642573
// CHECK_SRF_M32: #define __SSSE3__ 1
25652574
// CHECK_SRF_M32: #define __UINTR__ 1
2575+
// CHECK_SRF_M32-NOT: #define __USERMSR__ 1
2576+
// CHECK_ARLS_M32-NOT: #define __USERMSR__ 1
2577+
// CHECK_PTL_M32-NOT: #define __USERMSR__ 1
2578+
// CHECK_CWF_M32: #define __USERMSR__ 1
25662579
// CHECK_SRF_M32: #define __VAES__ 1
25672580
// CHECK_SRF_M32: #define __VPCLMULQDQ__ 1
25682581
// CHECK_SRF_M32: #define __WAITPKG__ 1
@@ -2593,6 +2606,12 @@
25932606
// RUN: %clang -march=lunarlake -m64 -E -dM %s -o - 2>&1 \
25942607
// RUN: -target i386-unknown-linux \
25952608
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M64,CHECK_ARLS_M64
2609+
// RUN: %clang -march=pantherlake -m64 -E -dM %s -o - 2>&1 \
2610+
// RUN: -target i386-unknown-linux \
2611+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_PTL_M64
2612+
// RUN: %clang -march=clearwaterforest -m64 -E -dM %s -o - 2>&1 \
2613+
// RUN: -target i386-unknown-linux \
2614+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_PTL_M64,CHECK_CWF_M64
25962615
// CHECK_SRF_M64: #define __ADX__ 1
25972616
// CHECK_SRF_M64: #define __AES__ 1
25982617
// CHECK_SRF_M64: #define __AVX2__ 1
@@ -2628,6 +2647,9 @@
26282647
// CHECK_SRF_M64: #define __PCONFIG__ 1
26292648
// CHECK_SRF_M64: #define __PKU__ 1
26302649
// CHECK_SRF_M64: #define __POPCNT__ 1
2650+
// CHECK_SRF_M64-NOT: #define __PREFETCHI__ 1
2651+
// CHECK_ARLS_M64-NOT: #define __PREFETCHI__ 1
2652+
// CHECK_PTL_M64: #define __PREFETCHI__ 1
26312653
// CHECK_SRF_M64: #define __PRFCHW__ 1
26322654
// CHECK_SRF_M64: #define __PTWRITE__ 1
26332655
// CHECK_SRF_M64-NOT: #define __RAOINT__ 1
@@ -2654,6 +2676,10 @@
26542676
// CHECK_SRF_M64: #define __SSE__ 1
26552677
// CHECK_SRF_M64: #define __SSSE3__ 1
26562678
// CHECK_SRF_M64: #define __UINTR__ 1
2679+
// CHECK_SRF_M64-NOT: #define __USERMSR__ 1
2680+
// CHECK_ARLS_M64-NOT: #define __USERMSR__ 1
2681+
// CHECK_PTL_M64-NOT: #define __USERMSR__ 1
2682+
// CHECK_CWF_M64: #define __USERMSR__ 1
26572683
// CHECK_SRF_M64: #define __VAES__ 1
26582684
// CHECK_SRF_M64: #define __VPCLMULQDQ__ 1
26592685
// CHECK_SRF_M64: #define __WAITPKG__ 1

compiler-rt/lib/builtins/cpu_model.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ enum ProcessorTypes {
7979
ZHAOXIN_FAM7H,
8080
INTEL_SIERRAFOREST,
8181
INTEL_GRANDRIDGE,
82+
INTEL_CLEARWATERFOREST,
8283
CPU_TYPE_MAX
8384
};
8485

@@ -116,6 +117,7 @@ enum ProcessorSubtypes {
116117
INTEL_COREI7_GRANITERAPIDS_D,
117118
INTEL_COREI7_ARROWLAKE,
118119
INTEL_COREI7_ARROWLAKE_S,
120+
INTEL_COREI7_PANTHERLAKE,
119121
CPU_SUBTYPE_MAX
120122
};
121123

@@ -492,6 +494,13 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model,
492494
*Subtype = INTEL_COREI7_ARROWLAKE_S;
493495
break;
494496

497+
// Pantherlake:
498+
case 0xcc:
499+
CPU = "pantherlake";
500+
*Type = INTEL_COREI7;
501+
*Subtype = INTEL_COREI7_PANTHERLAKE;
502+
break;
503+
495504
// Icelake Xeon:
496505
case 0x6a:
497506
case 0x6c:
@@ -572,6 +581,12 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model,
572581
*Type = INTEL_GRANDRIDGE;
573582
break;
574583

584+
// Clearwaterforest:
585+
case 0xdd:
586+
CPU = "clearwaterforest";
587+
*Type = INTEL_COREI7;
588+
*Subtype = INTEL_CLEARWATERFOREST;
589+
575590
case 0x57:
576591
CPU = "knl";
577592
*Type = INTEL_KNL;

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ Changes to the X86 Backend
135135
type matched and called into libgcc helper functions.
136136
* Support ISA of ``USER_MSR``.
137137
* Support ISA of ``AVX10.1-256`` and ``AVX10.1-512``.
138+
* ``-mcpu=pantherlake`` and ``-mcpu=clearwaterforest`` are now supported.
138139

139140
Changes to the OCaml bindings
140141
-----------------------------

llvm/include/llvm/TargetParser/X86TargetParser.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ X86_CPU_TYPE(AMDFAM19H, "amdfam19h")
4848
X86_CPU_TYPE(ZHAOXIN_FAM7H, "zhaoxin_fam7h")
4949
X86_CPU_TYPE(INTEL_SIERRAFOREST, "sierraforest")
5050
X86_CPU_TYPE(INTEL_GRANDRIDGE, "grandridge")
51+
X86_CPU_TYPE(INTEL_CLEARWATERFOREST, "clearwaterforest")
5152

5253
// Alternate names supported by __builtin_cpu_is and target multiversioning.
5354
X86_CPU_TYPE_ALIAS(INTEL_BONNELL, "atom")
@@ -102,6 +103,7 @@ X86_CPU_SUBTYPE(INTEL_COREI7_GRANITERAPIDS, "graniterapids")
102103
X86_CPU_SUBTYPE(INTEL_COREI7_GRANITERAPIDS_D,"graniterapids-d")
103104
X86_CPU_SUBTYPE(INTEL_COREI7_ARROWLAKE, "arrowlake")
104105
X86_CPU_SUBTYPE(INTEL_COREI7_ARROWLAKE_S, "arrowlake-s")
106+
X86_CPU_SUBTYPE(INTEL_COREI7_PANTHERLAKE, "pantherlake")
105107

106108
// Alternate names supported by __builtin_cpu_is and target multiversioning.
107109
X86_CPU_SUBTYPE_ALIAS(INTEL_COREI7_ALDERLAKE, "raptorlake")

llvm/include/llvm/TargetParser/X86TargetParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ enum CPUKind {
114114
CK_Arrowlake,
115115
CK_ArrowlakeS,
116116
CK_Lunarlake,
117+
CK_Pantherlake,
117118
CK_Sierraforest,
118119
CK_Grandridge,
119120
CK_Graniterapids,
120121
CK_GraniterapidsD,
121122
CK_Emeraldrapids,
123+
CK_Clearwaterforest,
122124
CK_KNL,
123125
CK_KNM,
124126
CK_Lakemont,

llvm/lib/Target/X86/X86.td

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,18 @@ def ProcessorFeatures {
12571257
list<SubtargetFeature> ARLSFeatures =
12581258
!listconcat(SRFFeatures, ARLSAdditionalFeatures);
12591259

1260+
// Pantherlake
1261+
list<SubtargetFeature> PTLAdditionalFeatures = [FeaturePREFETCHI];
1262+
list<SubtargetFeature> PTLFeatures =
1263+
!listconcat(ARLSFeatures, PTLAdditionalFeatures);
1264+
1265+
1266+
// Clearwaterforest
1267+
list<SubtargetFeature> CWFAdditionalFeatures = [FeaturePREFETCHI,
1268+
FeatureUSERMSR];
1269+
list<SubtargetFeature> CWFFeatures =
1270+
!listconcat(ARLSFeatures, CWFAdditionalFeatures);
1271+
12601272
// Knights Landing
12611273
list<SubtargetFeature> KNLFeatures = [FeatureX87,
12621274
FeatureCX8,
@@ -1770,6 +1782,10 @@ foreach P = ["arrowlake-s", "arrowlake_s", "lunarlake"] in {
17701782
def : ProcModel<P, AlderlakePModel,
17711783
ProcessorFeatures.ARLSFeatures, ProcessorFeatures.ADLTuning>;
17721784
}
1785+
def : ProcModel<"pantherlake", AlderlakePModel,
1786+
ProcessorFeatures.PTLFeatures, ProcessorFeatures.ADLTuning>;
1787+
def : ProcModel<"clearwaterforest", AlderlakePModel,
1788+
ProcessorFeatures.CWFFeatures, ProcessorFeatures.ADLTuning>;
17731789
def : ProcModel<"graniterapids", SapphireRapidsModel,
17741790
ProcessorFeatures.GNRFeatures, ProcessorFeatures.SPRTuning>;
17751791
def : ProcModel<"emeraldrapids", SapphireRapidsModel,

llvm/lib/TargetParser/Host.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,13 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model,
852852
*Subtype = X86::INTEL_COREI7_ARROWLAKE_S;
853853
break;
854854

855+
// Pantherlake:
856+
case 0xcc:
857+
CPU = "pantherlake";
858+
*Type = X86::INTEL_COREI7;
859+
*Subtype = X86::INTEL_COREI7_PANTHERLAKE;
860+
break;
861+
855862
// Graniterapids:
856863
case 0xad:
857864
CPU = "graniterapids";
@@ -932,6 +939,12 @@ getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model,
932939
*Type = X86::INTEL_GRANDRIDGE;
933940
break;
934941

942+
// Clearwaterforest:
943+
case 0xdd:
944+
CPU = "clearwaterforest";
945+
*Type = X86::INTEL_CLEARWATERFOREST;
946+
break;
947+
935948
// Xeon Phi (Knights Landing + Knights Mill):
936949
case 0x57:
937950
CPU = "knl";

0 commit comments

Comments
 (0)