Skip to content

[X86] Add missing MACROs in cpuid.h #80815

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

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

FreddyLeaf
Copy link
Contributor

@FreddyLeaf FreddyLeaf commented Feb 6, 2024

Copy link

github-actions bot commented Feb 6, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 4b34558f43121df9b863ff2492f74fb2e65a5af1 fd0c860aab3c78505222c281419a366a36104e37 -- clang/lib/Headers/cpuid.h
View the diff from clang-format here.
diff --git a/clang/lib/Headers/cpuid.h b/clang/lib/Headers/cpuid.h
index c968d37fb8..bc13af54f6 100644
--- a/clang/lib/Headers/cpuid.h
+++ b/clang/lib/Headers/cpuid.h
@@ -200,9 +200,9 @@
 #define bit_AMXINT8       0x02000000
 
 /* Features in %eax for leaf 7 sub-leaf 1 */
-#define bit_SHA512        0x00000001
-#define bit_SM3           0x00000002
-#define bit_SM4           0x00000004
+#define bit_SHA512 0x00000001
+#define bit_SM3 0x00000002
+#define bit_SM4 0x00000004
 #define bit_RAOINT        0x00000008
 #define bit_AVXVNNI       0x00000010
 #define bit_AVX512BF16    0x00000020
@@ -214,11 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x00000010
 #define bit_AVXNECONVERT  0x00000020
-#define bit_AMXCOMPLEX    0x00000100
-#define bit_AVXVNNIINT16  0x00000400
+#define bit_AMXCOMPLEX 0x00000100
+#define bit_AVXVNNIINT16 0x00000400
 #define bit_PREFETCHI     0x00004000
-#define bit_USERMSR       0x00008000
-#define bit_AVX10         0x00080000
+#define bit_USERMSR 0x00008000
+#define bit_AVX10 0x00080000
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT    0x00000001
@@ -252,8 +252,8 @@
 #define bit_WBNOINVD    0x00000200
 
 /* Features in %ebx for leaf 0x24 */
-#define bit_AVX10_256   0x00020000
-#define bit_AVX10_512   0x00040000
+#define bit_AVX10_256 0x00020000
+#define bit_AVX10_512 0x00040000
 
 #if __i386__
 #define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \

@FreddyLeaf FreddyLeaf marked this pull request as ready for review February 6, 2024 11:01
@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 clang:headers Headers provided by Clang, e.g. for intrinsics labels Feb 6, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2024

@llvm/pr-subscribers-backend-x86

@llvm/pr-subscribers-clang

Author: Freddy Ye (FreddyLeaf)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/80815.diff

1 Files Affected:

  • (modified) clang/lib/Headers/cpuid.h (+9)
diff --git a/clang/lib/Headers/cpuid.h b/clang/lib/Headers/cpuid.h
index 1ad6853a97c9d2..1f3e28a3bfa61b 100644
--- a/clang/lib/Headers/cpuid.h
+++ b/clang/lib/Headers/cpuid.h
@@ -200,6 +200,9 @@
 #define bit_AMXINT8       0x02000000
 
 /* Features in %eax for leaf 7 sub-leaf 1 */
+#define bit_SHA512        0x00000001
+#define bit_SM3           0x00000002
+#define bit_SM4           0x00000004
 #define bit_RAOINT        0x00000008
 #define bit_AVXVNNI       0x00000010
 #define bit_AVX512BF16    0x00000020
@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x00000010
 #define bit_AVXNECONVERT  0x00000020
+#define bit_AMXCOMPLEX    0x00000100
+#define bit_AVXVNNIINT16  0x00000400
 #define bit_PREFETCHI     0x00004000
+#define bit_USERMSR       0x00008000
+#define bit_AVX10_256     0x00080000
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT    0x00000001
@@ -244,6 +251,8 @@
 #define bit_RDPRU       0x00000010
 #define bit_WBNOINVD    0x00000200
 
+/* Features in %ebx for leaf 0x24 */
+#define bit_AVX10_512   0x00040000
 
 #if __i386__
 #define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \

Copy link
Contributor

@KanRobert KanRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Past the link of GCC files in description?

@FreddyLeaf
Copy link
Contributor Author

Past the link of GCC files in description?

Done.

Copy link
Contributor

@phoebewang phoebewang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@FreddyLeaf
Copy link
Contributor Author

Thanks review!

@FreddyLeaf FreddyLeaf merged commit c5e5661 into llvm:main Feb 7, 2024
@FreddyLeaf FreddyLeaf deleted the missing_cpuid_macro branch February 7, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang:headers Headers provided by Clang, e.g. for intrinsics clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants