-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove 3DNow! from X86TargetParser. #99352
Changes from all commits
70160e0
a529fc4
8297c94
e81e93b
c8b4a45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -171,14 +171,14 @@ constexpr FeatureBitset FeaturesClearwaterforest = | |||||||||||||
|
||||||||||||||
// Geode Processor. | ||||||||||||||
constexpr FeatureBitset FeaturesGeode = | ||||||||||||||
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | Feature3DNOW | Feature3DNOWA; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add a FeaturePREFTECH of some kind? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly not? We didn't enable it before (so, e.g. OTOH, maybe it's weird to have that divergence, so I'd also be fine with adding it (and therefore setting the preprocessor define). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I somewhat lean towards submitting the commit as-is, but will change this if you wish) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add the define. If/when we eventually remove mm3dnow.h then the only way to access prfchwintrin.h is via x86intrin.h (which we already recommend) which can sometimes require the llvm-project/clang/lib/Headers/x86intrin.h Lines 17 to 19 in f6add66
Also, we still have references to mm3dnow.h in prfchwintrin.h that probably need removing: llvm-project/clang/lib/Headers/prfchwintrin.h Lines 10 to 12 in f6add66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, making the change. I note that "sometimes" is essentially "if |
||||||||||||||
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeaturePRFCHW; | ||||||||||||||
|
||||||||||||||
// K6 processor. | ||||||||||||||
constexpr FeatureBitset FeaturesK6 = FeatureX87 | FeatureCMPXCHG8B | FeatureMMX; | ||||||||||||||
|
||||||||||||||
// K7 and K8 architecture processors. | ||||||||||||||
constexpr FeatureBitset FeaturesAthlon = | ||||||||||||||
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | Feature3DNOW | Feature3DNOWA; | ||||||||||||||
FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeaturePRFCHW; | ||||||||||||||
constexpr FeatureBitset FeaturesAthlonXP = | ||||||||||||||
FeaturesAthlon | FeatureFXSR | FeatureSSE; | ||||||||||||||
constexpr FeatureBitset FeaturesK8 = | ||||||||||||||
|
@@ -256,8 +256,8 @@ constexpr ProcInfo Processors[] = { | |||||||||||||
// i486-generation processors. | ||||||||||||||
{ {"i486"}, CK_i486, ~0U, FeatureX87, '\0', false }, | ||||||||||||||
{ {"winchip-c6"}, CK_WinChipC6, ~0U, FeaturesPentiumMMX, '\0', false }, | ||||||||||||||
{ {"winchip2"}, CK_WinChip2, ~0U, FeaturesPentiumMMX | Feature3DNOW, '\0', false }, | ||||||||||||||
{ {"c3"}, CK_C3, ~0U, FeaturesPentiumMMX | Feature3DNOW, '\0', false }, | ||||||||||||||
{ {"winchip2"}, CK_WinChip2, ~0U, FeaturesPentiumMMX | FeaturePRFCHW, '\0', false }, | ||||||||||||||
{ {"c3"}, CK_C3, ~0U, FeaturesPentiumMMX | FeaturePRFCHW, '\0', false }, | ||||||||||||||
// i586-generation processors, P5 microarchitecture based. | ||||||||||||||
{ {"i586"}, CK_i586, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false }, | ||||||||||||||
{ {"pentium"}, CK_Pentium, ~0U, FeatureX87 | FeatureCMPXCHG8B, 'B', false }, | ||||||||||||||
|
@@ -386,8 +386,8 @@ constexpr ProcInfo Processors[] = { | |||||||||||||
{ {"lakemont"}, CK_Lakemont, ~0U, FeatureCMPXCHG8B, '\0', false }, | ||||||||||||||
// K6 architecture processors. | ||||||||||||||
{ {"k6"}, CK_K6, ~0U, FeaturesK6, '\0', false }, | ||||||||||||||
{ {"k6-2"}, CK_K6_2, ~0U, FeaturesK6 | Feature3DNOW, '\0', false }, | ||||||||||||||
{ {"k6-3"}, CK_K6_3, ~0U, FeaturesK6 | Feature3DNOW, '\0', false }, | ||||||||||||||
{ {"k6-2"}, CK_K6_2, ~0U, FeaturesK6 | FeaturePRFCHW, '\0', false }, | ||||||||||||||
{ {"k6-3"}, CK_K6_3, ~0U, FeaturesK6 | FeaturePRFCHW, '\0', false }, | ||||||||||||||
// K7 architecture processors. | ||||||||||||||
{ {"athlon"}, CK_Athlon, ~0U, FeaturesAthlon, '\0', false }, | ||||||||||||||
{ {"athlon-tbird"}, CK_Athlon, ~0U, FeaturesAthlon, '\0', false }, | ||||||||||||||
|
@@ -493,6 +493,7 @@ constexpr FeatureBitset ImpliedFeaturesFXSR = {}; | |||||||||||||
constexpr FeatureBitset ImpliedFeaturesINVPCID = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesLWP = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesLZCNT = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesMMX = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesMWAITX = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesMOVBE = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesMOVDIR64B = {}; | ||||||||||||||
|
@@ -520,6 +521,8 @@ constexpr FeatureBitset ImpliedFeaturesWBNOINVD = {}; | |||||||||||||
constexpr FeatureBitset ImpliedFeaturesVZEROUPPER = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesX87 = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesXSAVE = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesDUMMYFEATURE1 = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesDUMMYFEATURE2 = {}; | ||||||||||||||
|
||||||||||||||
// Not really CPU features, but need to be in the table because clang uses | ||||||||||||||
// target features to communicate them to the backend. | ||||||||||||||
|
@@ -534,11 +537,6 @@ constexpr FeatureBitset ImpliedFeaturesXSAVEC = FeatureXSAVE; | |||||||||||||
constexpr FeatureBitset ImpliedFeaturesXSAVEOPT = FeatureXSAVE; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesXSAVES = FeatureXSAVE; | ||||||||||||||
|
||||||||||||||
// MMX->3DNOW->3DNOWA chain. | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesMMX = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeatures3DNOW = FeatureMMX; | ||||||||||||||
constexpr FeatureBitset ImpliedFeatures3DNOWA = Feature3DNOW; | ||||||||||||||
|
||||||||||||||
// SSE/AVX/AVX512F chain. | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesSSE = {}; | ||||||||||||||
constexpr FeatureBitset ImpliedFeaturesSSE2 = FeatureSSE; | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FreddyLeaf IIRC, we need to find two features to fill here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if gcc also deleted 3dnow, then find 1 feature to fill here. if not, then find 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I realized even gcc removed, they will keep one blank here to keep backward compatibility. So two features are required.
according to this comment above the file:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can put sub-features of APX here if you do not have better candidates.
egpr,ndd,push2pop2,ppx,ccmp,cf,nf,zu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bad news is that only
zu
can be "used" here. all other sub-features of APX have already be "used."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this thread. What exactly needs to match what else?
Also, if it's important for each feature to be assigned a specific ABI-stable number for some reason, we should assign that number directly in this macro, not indirectly via ordering...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I just put this in place of these two lines for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gone ahead and done that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove here too https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/cpu_model/x86.c#L144