Skip to content

Commit 22a2a82

Browse files
[X86] Add support for Nova Lake (#163552)
Add support for Nova Lake, per Intel Architecture Instruction Set Extensions Programming Reference rev. 59 (https://cdrdv2.intel.com/v1/dl/getContent/671368)
1 parent 92caf1a commit 22a2a82

File tree

16 files changed

+74
-6
lines changed

16 files changed

+74
-6
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ X86 Support
518518
- Remove `[no-]evex512` feature request from intrinsics and builtins.
519519
- Change features `avx10.x-[256,512]` to `avx10.x`.
520520
- `-march=wildcatlake` is now supported.
521+
- `-march=novalake` is now supported.
521522

522523
Arm and AArch64 Support
523524
^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/Basic/Targets/X86.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
626626
case CK_Lunarlake:
627627
case CK_Pantherlake:
628628
case CK_Wildcatlake:
629+
case CK_Novalake:
629630
case CK_Sierraforest:
630631
case CK_Grandridge:
631632
case CK_Graniterapids:
@@ -1615,6 +1616,7 @@ std::optional<unsigned> X86TargetInfo::getCPUCacheLineSize() const {
16151616
case CK_Lunarlake:
16161617
case CK_Pantherlake:
16171618
case CK_Wildcatlake:
1619+
case CK_Novalake:
16181620
case CK_Sierraforest:
16191621
case CK_Grandridge:
16201622
case CK_Graniterapids:

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int __attribute__((target("arch=pantherlake"))) foo(void) {return 25;}
3131
int __attribute__((target("arch=clearwaterforest"))) foo(void) {return 26;}
3232
int __attribute__((target("arch=diamondrapids"))) foo(void) {return 27;}
3333
int __attribute__((target("arch=wildcatlake"))) foo(void) {return 28;}
34+
int __attribute__((target("arch=novalake"))) foo(void) {return 29;}
3435
int __attribute__((target("default"))) foo(void) { return 2; }
3536

3637
int bar(void) {
@@ -206,6 +207,8 @@ void calls_pr50025c(void) { pr50025c(); }
206207
// ITANIUM: ret i32 27
207208
// ITANIUM: define{{.*}} i32 @foo.arch_wildcatlake()
208209
// ITANIUM: ret i32 28
210+
// ITANIUM: define{{.*}} i32 @foo.arch_novalake()
211+
// ITANIUM: ret i32 29
209212
// ITANIUM: define{{.*}} i32 @foo()
210213
// ITANIUM: ret i32 2
211214
// ITANIUM: define{{.*}} i32 @bar()
@@ -267,6 +270,8 @@ void calls_pr50025c(void) { pr50025c(); }
267270
// WINDOWS: ret i32 27
268271
// WINDOWS: define dso_local i32 @foo.arch_wildcatlake()
269272
// WINDOWS: ret i32 28
273+
// WINDOWS: define dso_local i32 @foo.arch_novalake()
274+
// WINDOWS: ret i32 29
270275
// WINDOWS: define dso_local i32 @foo()
271276
// WINDOWS: ret i32 2
272277
// WINDOWS: define dso_local i32 @bar()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ void verifycpustrings(void) {
179179
(void)__builtin_cpu_is("clearwaterforest");
180180
(void)__builtin_cpu_is("pantherlake");
181181
(void)__builtin_cpu_is("wildcatlake");
182+
(void)__builtin_cpu_is("novalake");
182183
(void)__builtin_cpu_is("haswell");
183184
(void)__builtin_cpu_is("icelake-client");
184185
(void)__builtin_cpu_is("icelake-server");

clang/test/Driver/x86-march.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
120120
// RUN: | FileCheck %s -check-prefix=wildcatlake
121121
// wildcatlake: "-target-cpu" "wildcatlake"
122122
//
123+
// RUN: %clang --target=x86_64 -c -### %s -march=novalake 2>&1 \
124+
// RUN: | FileCheck %s -check-prefix=novalake
125+
// novalake: "-target-cpu" "novalake"
126+
//
123127
// RUN: %clang --target=x86_64 -c -### %s -march=clearwaterforest 2>&1 \
124128
// RUN: | FileCheck %s -check-prefix=clearwaterforest
125129
// clearwaterforest: "-target-cpu" "clearwaterforest"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
// X86-SAME: {{^}}, gracemont
6565
// X86-SAME: {{^}}, pantherlake
6666
// X86-SAME: {{^}}, wildcatlake
67+
// X86-SAME: {{^}}, novalake
6768
// X86-SAME: {{^}}, sierraforest
6869
// X86-SAME: {{^}}, grandridge
6970
// X86-SAME: {{^}}, graniterapids
@@ -152,6 +153,7 @@
152153
// X86_64-SAME: {{^}}, gracemont
153154
// X86_64-SAME: {{^}}, pantherlake
154155
// X86_64-SAME: {{^}}, wildcatlake
156+
// X86_64-SAME: {{^}}, novalake
155157
// X86_64-SAME: {{^}}, sierraforest
156158
// X86_64-SAME: {{^}}, grandridge
157159
// X86_64-SAME: {{^}}, graniterapids
@@ -249,6 +251,7 @@
249251
// TUNE_X86-SAME: {{^}}, gracemont
250252
// TUNE_X86-SAME: {{^}}, pantherlake
251253
// TUNE_X86-SAME: {{^}}, wildcatlake
254+
// TUNE_X86-SAME: {{^}}, novalake
252255
// TUNE_X86-SAME: {{^}}, sierraforest
253256
// TUNE_X86-SAME: {{^}}, grandridge
254257
// TUNE_X86-SAME: {{^}}, graniterapids
@@ -353,6 +356,7 @@
353356
// TUNE_X86_64-SAME: {{^}}, gracemont
354357
// TUNE_X86_64-SAME: {{^}}, pantherlake
355358
// TUNE_X86_64-SAME: {{^}}, wildcatlake
359+
// TUNE_X86_64-SAME: {{^}}, novalake
356360
// TUNE_X86_64-SAME: {{^}}, sierraforest
357361
// TUNE_X86_64-SAME: {{^}}, grandridge
358362
// TUNE_X86_64-SAME: {{^}}, graniterapids

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,9 +2529,12 @@
25292529
// RUN: %clang -march=wildcatlake -m32 -E -dM %s -o - 2>&1 \
25302530
// RUN: -target i386-unknown-linux \
25312531
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_NKL_M32
2532+
// RUN: %clang -march=novalake -m32 -E -dM %s -o - 2>&1 \
2533+
// RUN: -target i386-unknown-linux \
2534+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M32,CHECK_ARLS_M32,CHECK_NVL_M32,CHECK_NKL_M32
25322535
// RUN: %clang -march=clearwaterforest -m32 -E -dM %s -o - 2>&1 \
25332536
// RUN: -target i386-unknown-linux \
2534-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_CWF_M32,CHECK_NKL_M32
2537+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_ARLS_M32,CHECK_NVL_M32,CHECK_UMSR_M32,CHECK_NKL_M32
25352538
// CHECK_ARL_M32: #define __ADX__ 1
25362539
// CHECK_ARL_M32: #define __AES__ 1
25372540
// CHECK_ARL_M32: #define __AVX2__ 1
@@ -2571,7 +2574,7 @@
25712574
// CHECK_ARL_M32: #define __POPCNT__ 1
25722575
// CHECK_ARL_M32-NOT: #define __PREFETCHI__ 1
25732576
// CHECK_ARLS_M32-NOT: #define __PREFETCHI__ 1
2574-
// CHECK_CWF_M32: #define __PREFETCHI__ 1
2577+
// CHECK_NVL_M32: #define __PREFETCHI__ 1
25752578
// CHECK_ARL_M32: #define __PRFCHW__ 1
25762579
// CHECK_ARL_M32: #define __PTWRITE__ 1
25772580
// CHECK_ARL_M32-NOT: #define __RAOINT__ 1
@@ -2598,7 +2601,7 @@
25982601
// CHECK_ARL_M32: #define __UINTR__ 1
25992602
// CHECK_ARL_M32-NOT: #define __USERMSR__ 1
26002603
// CHECK_ARLS_M32-NOT: #define __USERMSR__ 1
2601-
// CHECK_CWF_M32: #define __USERMSR__ 1
2604+
// CHECK_UMSR_M32: #define __USERMSR__ 1
26022605
// CHECK_ARL_M32: #define __VAES__ 1
26032606
// CHECK_ARL_M32: #define __VPCLMULQDQ__ 1
26042607
// CHECK_ARL_M32: #define __WAITPKG__ 1
@@ -2636,9 +2639,12 @@
26362639
// RUN: %clang -march=wildcatlake -m64 -E -dM %s -o - 2>&1 \
26372640
// RUN: -target i386-unknown-linux \
26382641
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_NKL_M64
2642+
// RUN: %clang -march=novalake -m64 -E -dM %s -o - 2>&1 \
2643+
// RUN: -target i386-unknown-linux \
2644+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_ARLS_M64,CHECK_NVL_M64,CHECK_NKL_M64
26392645
// RUN: %clang -march=clearwaterforest -m64 -E -dM %s -o - 2>&1 \
26402646
// RUN: -target i386-unknown-linux \
2641-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_CWF_M64,CHECK_NKL_M64
2647+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_ARL_M64,CHECK_SRF_M64,CHECK_ARLS_M64,CHECK_NVL_M64,CHECK_UMSR_M64,CHECK_NKL_M64
26422648
// CHECK_ARL_M64: #define __ADX__ 1
26432649
// CHECK_ARL_M64: #define __AES__ 1
26442650
// CHECK_ARL_M64: #define __AVX2__ 1
@@ -2678,7 +2684,7 @@
26782684
// CHECK_ARL_M64: #define __POPCNT__ 1
26792685
// CHECK_ARL_M64-NOT: #define __PREFETCHI__ 1
26802686
// CHECK_ARLS_M64-NOT: #define __PREFETCHI__ 1
2681-
// CHECK_CWF_M64: #define __PREFETCHI__ 1
2687+
// CHECK_NVL_M64: #define __PREFETCHI__ 1
26822688
// CHECK_ARL_M64: #define __PRFCHW__ 1
26832689
// CHECK_ARL_M64: #define __PTWRITE__ 1
26842690
// CHECK_ARL_M64-NOT: #define __RAOINT__ 1
@@ -2706,7 +2712,7 @@
27062712
// CHECK_ARL_M64: #define __UINTR__ 1
27072713
// CHECK_ARL_M64-NOT: #define __USERMSR__ 1
27082714
// CHECK_ARLS_M64-NOT: #define __USERMSR__ 1
2709-
// CHECK_CWF_M64: #define __USERMSR__ 1
2715+
// CHECK_UMSR_M64: #define __USERMSR__ 1
27102716
// CHECK_ARL_M64: #define __VAES__ 1
27112717
// CHECK_ARL_M64: #define __VPCLMULQDQ__ 1
27122718
// CHECK_ARL_M64: #define __WAITPKG__ 1

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,4 @@ ATTR(cpu_specific(gracemont)) void CPU38(void){}
8888
ATTR(cpu_specific(pantherlake)) void CPU39(void){}
8989
ATTR(cpu_specific(clearwaterforest)) void CPU40(void){}
9090
ATTR(cpu_specific(wildcatlake)) void CPU41(void){}
91+
ATTR(cpu_specific(novalake)) void CPU42(void){}

compiler-rt/lib/builtins/cpu_model/x86.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ enum ProcessorSubtypes {
104104
INTEL_COREI7_PANTHERLAKE,
105105
AMDFAM1AH_ZNVER5,
106106
INTEL_COREI7_DIAMONDRAPIDS,
107+
INTEL_COREI7_NOVALAKE,
107108
CPU_SUBTYPE_MAX
108109
};
109110

@@ -646,6 +647,19 @@ static const char *getIntelProcessorTypeAndSubtype(unsigned Family,
646647
break;
647648
}
648649
break;
650+
case 0x12:
651+
switch (Model) {
652+
case 0x1:
653+
case 0x3:
654+
CPU = "novalake";
655+
*Type = INTEL_COREI7;
656+
*Subtype = INTEL_COREI7_NOVALAKE;
657+
break;
658+
default: // Unknown family 0x12 CPU.
659+
break;
660+
}
661+
break;
662+
649663
default:
650664
break; // Unknown.
651665
}

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ Changes to the X86 Backend
140140
--------------------------
141141

142142
* `-mcpu=wildcatlake` is now supported.
143+
* `-mcpu=novalake` is now supported.
143144

144145
Changes to the OCaml bindings
145146
-----------------------------

0 commit comments

Comments
 (0)