[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

https://github.com/FreddyLeaf closed 
https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

FreddyLeaf wrote:

Thanks review!

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Phoebe Wang via cfe-commits

https://github.com/phoebewang approved this pull request.

LGTM.

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits


@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008

FreddyLeaf wrote:

I see. Aligned with gcc: 
[fd0c860](https://github.com/llvm/llvm-project/pull/80815/commits/fd0c860aab3c78505222c281419a366a36104e37)

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

https://github.com/FreddyLeaf updated 
https://github.com/llvm/llvm-project/pull/80815

>From 2ed2333085d40ece903b2d70e0da7371b72209f4 Mon Sep 17 00:00:00 2001
From: Freddy Ye 
Date: Tue, 6 Feb 2024 17:20:31 +0800
Subject: [PATCH 1/2] [X86] Add missing MACROs in cpuid.h

---
 clang/lib/Headers/cpuid.h | 9 +
 1 file changed, 9 insertions(+)

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   0x0200
 
 /* Features in %eax for leaf 7 sub-leaf 1 */
+#define bit_SHA5120x0001
+#define bit_SM3   0x0002
+#define bit_SM4   0x0004
 #define bit_RAOINT0x0008
 #define bit_AVXVNNI   0x0010
 #define bit_AVX512BF160x0020
@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT0x0001
@@ -244,6 +251,8 @@
 #define bit_RDPRU   0x0010
 #define bit_WBNOINVD0x0200
 
+/* Features in %ebx for leaf 0x24 */
+#define bit_AVX10_512   0x0004
 
 #if __i386__
 #define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \

>From fd0c860aab3c78505222c281419a366a36104e37 Mon Sep 17 00:00:00 2001
From: Freddy Ye 
Date: Wed, 7 Feb 2024 10:42:40 +0800
Subject: [PATCH 2/2] address comment

---
 clang/lib/Headers/cpuid.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Headers/cpuid.h b/clang/lib/Headers/cpuid.h
index 1f3e28a3bfa61b..c968d37fb8cd64 100644
--- a/clang/lib/Headers/cpuid.h
+++ b/clang/lib/Headers/cpuid.h
@@ -218,7 +218,7 @@
 #define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
 #define bit_USERMSR   0x8000
-#define bit_AVX10_256 0x0008
+#define bit_AVX10 0x0008
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT0x0001
@@ -252,6 +252,7 @@
 #define bit_WBNOINVD0x0200
 
 /* Features in %ebx for leaf 0x24 */
+#define bit_AVX10_256   0x0002
 #define bit_AVX10_512   0x0004
 
 #if __i386__

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

FreddyLeaf wrote:

> Past the link of GCC files in description?

Done.

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

https://github.com/FreddyLeaf edited 
https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Shengchen Kan via cfe-commits

https://github.com/KanRobert commented:

Past the link of GCC files in description?

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Phoebe Wang via cfe-commits


@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008

phoebewang wrote:

They are identical to check this bit or another in Host.cpp. They are different 
to user who check the bit through cpuid, because they have different sub leaf 
and different value.

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits


@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008

FreddyLeaf wrote:

Thanks for pointing this out. I was to but forgot. This is bit_AVX10 in gcc. I 
found in llvm/lib/TargetParser/Host.cpp it sets so.

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Phoebe Wang via cfe-commits


@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008

phoebewang wrote:

This is different with GCC.

https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread via cfe-commits

llvmbot wrote:



@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
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   0x0200
 
 /* Features in %eax for leaf 7 sub-leaf 1 */
+#define bit_SHA5120x0001
+#define bit_SM3   0x0002
+#define bit_SM4   0x0004
 #define bit_RAOINT0x0008
 #define bit_AVXVNNI   0x0010
 #define bit_AVX512BF160x0020
@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT0x0001
@@ -244,6 +251,8 @@
 #define bit_RDPRU   0x0010
 #define bit_WBNOINVD0x0200
 
+/* Features in %ebx for leaf 0x24 */
+#define bit_AVX10_512   0x0004
 
 #if __i386__
 #define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \

``




https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

https://github.com/FreddyLeaf ready_for_review 
https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff 4b34558f43121df9b863ff2492f74fb2e65a5af1 
2ed2333085d40ece903b2d70e0da7371b72209f4 -- clang/lib/Headers/cpuid.h
``





View the diff from clang-format here.


``diff
diff --git a/clang/lib/Headers/cpuid.h b/clang/lib/Headers/cpuid.h
index 1f3e28a3bf..da683bc5d6 100644
--- a/clang/lib/Headers/cpuid.h
+++ b/clang/lib/Headers/cpuid.h
@@ -200,9 +200,9 @@
 #define bit_AMXINT8   0x0200
 
 /* Features in %eax for leaf 7 sub-leaf 1 */
-#define bit_SHA5120x0001
-#define bit_SM3   0x0002
-#define bit_SM4   0x0004
+#define bit_SHA512 0x0001
+#define bit_SM3 0x0002
+#define bit_SM4 0x0004
 #define bit_RAOINT0x0008
 #define bit_AVXVNNI   0x0010
 #define bit_AVX512BF160x0020
@@ -214,11 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
-#define bit_AMXCOMPLEX0x0100
-#define bit_AVXVNNIINT16  0x0400
+#define bit_AMXCOMPLEX 0x0100
+#define bit_AVXVNNIINT16 0x0400
 #define bit_PREFETCHI 0x4000
-#define bit_USERMSR   0x8000
-#define bit_AVX10_256 0x0008
+#define bit_USERMSR 0x8000
+#define bit_AVX10_256 0x0008
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT0x0001
@@ -252,7 +252,7 @@
 #define bit_WBNOINVD0x0200
 
 /* Features in %ebx for leaf 0x24 */
-#define bit_AVX10_512   0x0004
+#define bit_AVX10_512 0x0004
 
 #if __i386__
 #define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \

``




https://github.com/llvm/llvm-project/pull/80815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [X86] Add missing MACROs in cpuid.h (PR #80815)

2024-02-06 Thread Freddy Ye via cfe-commits

https://github.com/FreddyLeaf created 
https://github.com/llvm/llvm-project/pull/80815

None

>From 2ed2333085d40ece903b2d70e0da7371b72209f4 Mon Sep 17 00:00:00 2001
From: Freddy Ye 
Date: Tue, 6 Feb 2024 17:20:31 +0800
Subject: [PATCH] [X86] Add missing MACROs in cpuid.h

---
 clang/lib/Headers/cpuid.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/clang/lib/Headers/cpuid.h b/clang/lib/Headers/cpuid.h
index 1ad6853a97c9d..1f3e28a3bfa61 100644
--- a/clang/lib/Headers/cpuid.h
+++ b/clang/lib/Headers/cpuid.h
@@ -200,6 +200,9 @@
 #define bit_AMXINT8   0x0200
 
 /* Features in %eax for leaf 7 sub-leaf 1 */
+#define bit_SHA5120x0001
+#define bit_SM3   0x0002
+#define bit_SM4   0x0004
 #define bit_RAOINT0x0008
 #define bit_AVXVNNI   0x0010
 #define bit_AVX512BF160x0020
@@ -211,7 +214,11 @@
 /* Features in %edx for leaf 7 sub-leaf 1 */
 #define bit_AVXVNNIINT8   0x0010
 #define bit_AVXNECONVERT  0x0020
+#define bit_AMXCOMPLEX0x0100
+#define bit_AVXVNNIINT16  0x0400
 #define bit_PREFETCHI 0x4000
+#define bit_USERMSR   0x8000
+#define bit_AVX10_256 0x0008
 
 /* Features in %eax for leaf 13 sub-leaf 1 */
 #define bit_XSAVEOPT0x0001
@@ -244,6 +251,8 @@
 #define bit_RDPRU   0x0010
 #define bit_WBNOINVD0x0200
 
+/* Features in %ebx for leaf 0x24 */
+#define bit_AVX10_512   0x0004
 
 #if __i386__
 #define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits