-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[X86] Sync multiversion features with libgcc and refactor internal feature tables #168750
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
Changes from 10 commits
b990337
ad7108b
2683f8f
652dca4
f9b584f
83aa05b
3a7e98d
800b55e
bf783a2
a9a59ed
e67d4f7
df08e46
b1b1be1
b26ff0f
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 |
|---|---|---|
|
|
@@ -135,13 +135,9 @@ enum ProcessorFeatures { | |
| FEATURE_AVX512BW, | ||
| FEATURE_AVX512DQ, | ||
| FEATURE_AVX512CD, | ||
| FEATURE_AVX512ER, | ||
| FEATURE_AVX512PF, | ||
| FEATURE_AVX512VBMI, | ||
| FEATURE_AVX512VBMI = 26, | ||
| FEATURE_AVX512IFMA, | ||
| FEATURE_AVX5124VNNIW, | ||
| FEATURE_AVX5124FMAPS, | ||
| FEATURE_AVX512VPOPCNTDQ, | ||
| FEATURE_AVX512VPOPCNTDQ = 30, | ||
| FEATURE_AVX512VBMI2, | ||
| FEATURE_GFNI, | ||
| FEATURE_VPCLMULQDQ, | ||
|
|
@@ -181,8 +177,7 @@ enum ProcessorFeatures { | |
| // FEATURE_OSXSAVE, | ||
| FEATURE_PCONFIG = 63, | ||
| FEATURE_PKU, | ||
| FEATURE_PREFETCHWT1, | ||
| FEATURE_PRFCHW, | ||
| FEATURE_PRFCHW = 66, | ||
|
Comment on lines
-184
to
+180
Contributor
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. What about commenting out as above instead of deleting?
Member
Author
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 believe we comment out features not supported by llvm but supported gcc. This feature is not supported by gcc, so no comment |
||
| FEATURE_PTWRITE, | ||
| FEATURE_RDPID, | ||
| FEATURE_RDRND, | ||
|
|
@@ -231,7 +226,11 @@ enum ProcessorFeatures { | |
| FEATURE_USERMSR, | ||
| FEATURE_AVX10_1 = 114, | ||
| FEATURE_AVX10_2 = 116, | ||
| FEATURE_AMX_AVX512, | ||
| FEATURE_AMX_TF32, | ||
| FEATURE_AMX_FP8 = 120, | ||
| FEATURE_MOVRS, | ||
| FEATURE_AMX_MOVRS, | ||
| CPU_FEATURE_MAX | ||
| }; | ||
|
|
||
|
|
@@ -961,10 +960,6 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, | |
| setFeature(FEATURE_AVX512IFMA); | ||
| if (HasLeaf7 && ((EBX >> 24) & 1)) | ||
| setFeature(FEATURE_CLWB); | ||
| if (HasLeaf7 && ((EBX >> 26) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX512PF); | ||
| if (HasLeaf7 && ((EBX >> 27) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX512ER); | ||
| if (HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX512CD); | ||
| if (HasLeaf7 && ((EBX >> 29) & 1)) | ||
|
|
@@ -974,8 +969,6 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, | |
| if (HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX512VL); | ||
|
|
||
| if (HasLeaf7 && ((ECX >> 0) & 1)) | ||
| setFeature(FEATURE_PREFETCHWT1); | ||
| if (HasLeaf7 && ((ECX >> 1) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX512VBMI); | ||
| if (HasLeaf7 && ((ECX >> 4) & 1)) | ||
|
|
@@ -1011,10 +1004,6 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, | |
| if (HasLeaf7 && ((ECX >> 29) & 1)) | ||
| setFeature(FEATURE_ENQCMD); | ||
|
|
||
| if (HasLeaf7 && ((EDX >> 2) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX5124VNNIW); | ||
| if (HasLeaf7 && ((EDX >> 3) & 1) && HasAVX512Save) | ||
| setFeature(FEATURE_AVX5124FMAPS); | ||
| if (HasLeaf7 && ((EDX >> 5) & 1)) | ||
| setFeature(FEATURE_UINTR); | ||
| if (HasLeaf7 && ((EDX >> 8) & 1) && HasAVX512Save) | ||
|
|
@@ -1088,6 +1077,17 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf, | |
| if (HasLeafD && ((EAX >> 3) & 1) && HasAVXSave) | ||
| setFeature(FEATURE_XSAVES); | ||
|
|
||
| bool HasLeaf1E = MaxLevel >= 0x1e && | ||
| !getX86CpuIDAndInfoEx(0x1e, 0x1, &EAX, &EBX, &ECX, &EDX); | ||
| if (HasLeaf1E && (EAX & 0x10)) | ||
| setFeature(FEATURE_AMX_FP8); | ||
| if (HasLeaf1E && (EAX & 0x40)) | ||
| setFeature(FEATURE_AMX_TF32); | ||
| if (HasLeaf1E && (EAX & 0x80)) | ||
| setFeature(FEATURE_AMX_AVX512); | ||
| if (HasLeaf1E && (EAX & 0x100)) | ||
| setFeature(FEATURE_AMX_MOVRS); | ||
|
|
||
| bool HasLeaf24 = | ||
| MaxLevel >= 0x24 && !getX86CpuIDAndInfo(0x24, &EAX, &EBX, &ECX, &EDX); | ||
| if (HasLeaf7Subleaf1 && ((EDX >> 19) & 1) && HasLeaf24) { | ||
|
|
||
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.
ABI or API?
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'm fine with both names -- I've picked ABI instead of API since it's low-level information on how features are stored in a table for multiversion functions