Skip to content

Commit 66f332b

Browse files
committed
[X86] Add missing key feature for core2
Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D133094
1 parent 4ed30c8 commit 66f332b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ int __attribute__((target("arch=tigerlake"))) foo(void) {return 9;}
1414
int __attribute__((target("arch=sapphirerapids"))) foo(void) {return 10;}
1515
int __attribute__((target("arch=alderlake"))) foo(void) {return 11;}
1616
int __attribute__((target("arch=rocketlake"))) foo(void) {return 12;}
17+
int __attribute__((target("arch=core2"))) foo(void) {return 13;}
1718
int __attribute__((target("default"))) foo(void) { return 2; }
1819

1920
int bar(void) {
@@ -146,6 +147,8 @@ void calls_pr50025c(void) { pr50025c(); }
146147
// LINUX: ret i32 11
147148
// LINUX: define{{.*}} i32 @foo.arch_rocketlake()
148149
// LINUX: ret i32 12
150+
// LINUX: define{{.*}} i32 @foo.arch_core2()
151+
// LINUX: ret i32 13
149152
// LINUX: define{{.*}} i32 @foo()
150153
// LINUX: ret i32 2
151154
// LINUX: define{{.*}} i32 @bar()
@@ -175,6 +178,8 @@ void calls_pr50025c(void) { pr50025c(); }
175178
// WINDOWS: ret i32 11
176179
// WINDOWS: define dso_local i32 @foo.arch_rocketlake()
177180
// WINDOWS: ret i32 12
181+
// WINDOWS: define dso_local i32 @foo.arch_core2()
182+
// WINDOWS: ret i32 13
178183
// WINDOWS: define dso_local i32 @foo()
179184
// WINDOWS: ret i32 2
180185
// WINDOWS: define dso_local i32 @bar()

llvm/lib/Support/X86TargetParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ constexpr ProcInfo Processors[] = {
321321
{ {"prescott"}, CK_Prescott, ~0U, FeaturesPrescott },
322322
{ {"nocona"}, CK_Nocona, ~0U, FeaturesNocona },
323323
// Core microarchitecture based processors.
324-
{ {"core2"}, CK_Core2, ~0U, FeaturesCore2 },
324+
{ {"core2"}, CK_Core2, FEATURE_SSSE3, FeaturesCore2 },
325325
{ {"penryn"}, CK_Penryn, ~0U, FeaturesPenryn },
326326
// Atom processors
327327
{ {"bonnell"}, CK_Bonnell, FEATURE_SSSE3, FeaturesBonnell },

0 commit comments

Comments
 (0)