https://github.com/RKSimon created 
https://github.com/llvm/llvm-project/pull/169223

None

>From f1fa3531bd79956a706d4abc2bb023918f583ae4 Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <[email protected]>
Date: Sun, 23 Nov 2025 16:03:21 +0000
Subject: [PATCH] [X86] BuiltinsX86.td - merge cmp/ucmp builtins into common
 Features/Attributes blocks. NFC.

---
 clang/include/clang/Basic/BuiltinsX86.td | 96 ++++++------------------
 1 file changed, 22 insertions(+), 74 deletions(-)

diff --git a/clang/include/clang/Basic/BuiltinsX86.td 
b/clang/include/clang/Basic/BuiltinsX86.td
index f6069fdc5707a..4aa3d51931980 100644
--- a/clang/include/clang/Basic/BuiltinsX86.td
+++ b/clang/include/clang/Basic/BuiltinsX86.td
@@ -1246,102 +1246,46 @@ let Features = "avx512bw", Attributes = [NoThrow, 
Const, Constexpr] in {
   def knotdi : X86Builtin<"unsigned long long int(unsigned long long int)">;
 }
 
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
-  def cmpb128_mask : X86Builtin<"unsigned short(_Vector<16, char>, _Vector<16, 
char>, _Constant int, unsigned short)">;
-}
-
-let Features = "avx512vl",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
+let Features = "avx512vl", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<128>] in {
   def cmpd128_mask : X86Builtin<"unsigned char(_Vector<4, int>, _Vector<4, 
int>, _Constant int, unsigned char)">;
   def cmpq128_mask : X86Builtin<"unsigned char(_Vector<2, long long int>, 
_Vector<2, long long int>, _Constant int, unsigned char)">;
-}
-
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
-  def cmpw128_mask : X86Builtin<"unsigned char(_Vector<8, short>, _Vector<8, 
short>, _Constant int, unsigned char)">;
-}
-
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
-  def cmpb256_mask : X86Builtin<"unsigned int(_Vector<32, char>, _Vector<32, 
char>, _Constant int, unsigned int)">;
-}
-
-let Features = "avx512vl",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
-  def cmpd256_mask : X86Builtin<"unsigned char(_Vector<8, int>, _Vector<8, 
int>, _Constant int, unsigned char)">;
-  def cmpq256_mask : X86Builtin<"unsigned char(_Vector<4, long long int>, 
_Vector<4, long long int>, _Constant int, unsigned char)">;
-}
-
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
-  def cmpw256_mask : X86Builtin<"unsigned short(_Vector<16, short>, 
_Vector<16, short>, _Constant int, unsigned short)">;
-}
-
-let Features = "avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
-  def cmpb512_mask : X86Builtin<"unsigned long long int(_Vector<64, char>, 
_Vector<64, char>, _Constant int, unsigned long long int)">;
-}
-
-let Features = "avx512f",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
-  def cmpd512_mask : X86Builtin<"unsigned short(_Vector<16, int>, _Vector<16, 
int>, _Constant int, unsigned short)">;
-  def cmpq512_mask : X86Builtin<"unsigned char(_Vector<8, long long int>, 
_Vector<8, long long int>, _Constant int, unsigned char)">;
-}
-
-let Features = "avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
-  def cmpw512_mask : X86Builtin<"unsigned int(_Vector<32, short>, _Vector<32, 
short>, _Constant int, unsigned int)">;
-}
-
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
-  def ucmpb128_mask : X86Builtin<"unsigned short(_Vector<16, char>, 
_Vector<16, char>, _Constant int, unsigned short)">;
-}
 
-let Features = "avx512vl",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
   def ucmpd128_mask : X86Builtin<"unsigned char(_Vector<4, int>, _Vector<4, 
int>, _Constant int, unsigned char)">;
   def ucmpq128_mask : X86Builtin<"unsigned char(_Vector<2, long long int>, 
_Vector<2, long long int>, _Constant int, unsigned char)">;
 }
 
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
+let Features = "avx512vl,avx512bw", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<128>] in {
+  def cmpb128_mask : X86Builtin<"unsigned short(_Vector<16, char>, _Vector<16, 
char>, _Constant int, unsigned short)">;
+  def cmpw128_mask : X86Builtin<"unsigned char(_Vector<8, short>, _Vector<8, 
short>, _Constant int, unsigned char)">;
+
+  def ucmpb128_mask : X86Builtin<"unsigned short(_Vector<16, char>, 
_Vector<16, char>, _Constant int, unsigned short)">;
   def ucmpw128_mask : X86Builtin<"unsigned char(_Vector<8, short>, _Vector<8, 
short>, _Constant int, unsigned char)">;
 }
 
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
-  def ucmpb256_mask : X86Builtin<"unsigned int(_Vector<32, char>, _Vector<32, 
char>, _Constant int, unsigned int)">;
-}
+let Features = "avx512vl", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<256>] in {
+  def cmpd256_mask : X86Builtin<"unsigned char(_Vector<8, int>, _Vector<8, 
int>, _Constant int, unsigned char)">;
+  def cmpq256_mask : X86Builtin<"unsigned char(_Vector<4, long long int>, 
_Vector<4, long long int>, _Constant int, unsigned char)">;
 
-let Features = "avx512vl",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
   def ucmpd256_mask : X86Builtin<"unsigned char(_Vector<8, int>, _Vector<8, 
int>, _Constant int, unsigned char)">;
   def ucmpq256_mask : X86Builtin<"unsigned char(_Vector<4, long long int>, 
_Vector<4, long long int>, _Constant int, unsigned char)">;
 }
 
-let Features = "avx512vl,avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
+let Features = "avx512vl,avx512bw", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<256>] in {
+  def cmpb256_mask : X86Builtin<"unsigned int(_Vector<32, char>, _Vector<32, 
char>, _Constant int, unsigned int)">;
+  def cmpw256_mask : X86Builtin<"unsigned short(_Vector<16, short>, 
_Vector<16, short>, _Constant int, unsigned short)">;
+
+  def ucmpb256_mask : X86Builtin<"unsigned int(_Vector<32, char>, _Vector<32, 
char>, _Constant int, unsigned int)">;
   def ucmpw256_mask : X86Builtin<"unsigned short(_Vector<16, short>, 
_Vector<16, short>, _Constant int, unsigned short)">;
 }
 
-let Features = "avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
-  def ucmpb512_mask : X86Builtin<"unsigned long long int(_Vector<64, char>, 
_Vector<64, char>, _Constant int, unsigned long long int)">;
-}
+let Features = "avx512f", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<512>] in {
+  def cmpd512_mask : X86Builtin<"unsigned short(_Vector<16, int>, _Vector<16, 
int>, _Constant int, unsigned short)">;
+  def cmpq512_mask : X86Builtin<"unsigned char(_Vector<8, long long int>, 
_Vector<8, long long int>, _Constant int, unsigned char)">;
 
-let Features = "avx512f",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
   def ucmpd512_mask : X86Builtin<"unsigned short(_Vector<16, int>, _Vector<16, 
int>, _Constant int, unsigned short)">;
   def ucmpq512_mask : X86Builtin<"unsigned char(_Vector<8, long long int>, 
_Vector<8, long long int>, _Constant int, unsigned char)">;
 }
 
-let Features = "avx512bw",
-    Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
-  def ucmpw512_mask : X86Builtin<"unsigned int(_Vector<32, short>, _Vector<32, 
short>, _Constant int, unsigned int)">;
-}
-
 let Features = "avx512bw", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<512>] in {
   def packsswb512 : X86Builtin<"_Vector<64, char>(_Vector<32, short>, 
_Vector<32, short>)">;
   def packssdw512 : X86Builtin<"_Vector<32, short>(_Vector<16, int>, 
_Vector<16, int>)">;
@@ -1349,6 +1293,11 @@ let Features = "avx512bw", Attributes = [NoThrow, Const, 
Constexpr, RequiredVect
   def packusdw512 : X86Builtin<"_Vector<32, short>(_Vector<16, int>, 
_Vector<16, int>)">;
 
   def pshufb512 : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, 
char>)">;
+
+  def cmpb512_mask : X86Builtin<"unsigned long long int(_Vector<64, char>, 
_Vector<64, char>, _Constant int, unsigned long long int)">;
+  def cmpw512_mask : X86Builtin<"unsigned int(_Vector<32, short>, _Vector<32, 
short>, _Constant int, unsigned int)">;
+  def ucmpb512_mask : X86Builtin<"unsigned long long int(_Vector<64, char>, 
_Vector<64, char>, _Constant int, unsigned long long int)">;
+  def ucmpw512_mask : X86Builtin<"unsigned int(_Vector<32, short>, _Vector<32, 
short>, _Constant int, unsigned int)">;
 }
 
 let Features = "avx512cd,avx512vl", Attributes = [NoThrow, Const, Constexpr, 
RequiredVectorWidth<128>] in {
@@ -1397,7 +1346,6 @@ let Features = "avx512f", Attributes = [NoThrow, Const, 
RequiredVectorWidth<512>
   def subps512 : X86Builtin<"_Vector<16, float>(_Vector<16, float>, 
_Vector<16, float>, _Constant int)">;
 }
 
-
 let Features = "avx512f", Attributes = [NoThrow, Const, 
RequiredVectorWidth<128>] in {
   def addss_round_mask : X86Builtin<"_Vector<4, float>(_Vector<4, float>, 
_Vector<4, float>, _Vector<4, float>, unsigned char, _Constant int)">;
   def divss_round_mask : X86Builtin<"_Vector<4, float>(_Vector<4, float>, 
_Vector<4, float>, _Vector<4, float>, unsigned char, _Constant int)">;

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to