@@ -145,6 +145,10 @@ let Features = "mmx", Header = "mmintrin.h", Attributes = [NoThrow, Const] in {
145145 def _m_prefetch : X86LibBuiltin<" void(void *)" >;
146146}
147147
148+ let Features = " mmx" , Attributes = [NoThrow, Const, Constexpr] in {
149+ def pshufw : X86Builtin<" _Vector<4, short>(_Vector<4, short>, _Constant int)" >;
150+ }
151+
148152// PRFCHW
149153let Features = " prfchw" , Header = " intrin.h" , Attributes = [NoThrow, Const] in {
150154 def _m_prefetchw : X86LibBuiltin<" void(void volatile const *)" >;
@@ -217,10 +221,13 @@ let Features = "sse2", Attributes = [NoThrow] in {
217221 def movnti : X86Builtin<" void(int *, int)" >;
218222}
219223
220- let Features = " sse2" , Attributes = [NoThrow, Const, RequiredVectorWidth<128 >] in {
221- def pshufd : X86Builtin<" _Vector<4, int>(_Vector<4, int>, _Constant int)" >;
224+ let Features = " sse2" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
222225 def pshuflw : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Constant int)" >;
226+ def pshufd : X86Builtin<" _Vector<4, int>(_Vector<4, int>, _Constant int)" >;
223227 def pshufhw : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Constant int)" >;
228+ }
229+
230+ let Features = " sse2" , Attributes = [NoThrow, Const, RequiredVectorWidth<128 >] in {
224231 def psadbw128 : X86Builtin<" _Vector<2, long long int>(_Vector<16, char>, _Vector<16, char>)" >;
225232 def sqrtpd : X86Builtin<" _Vector<2, double>(_Vector<2, double>)" >;
226233 def sqrtsd : X86Builtin<" _Vector<2, double>(_Vector<2, double>)" >;
@@ -569,6 +576,12 @@ let Features = "avx", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in
569576 def vec_set_v8si : X86Builtin<" _Vector<8, int>(_Vector<8, int>, int, _Constant int)" >;
570577}
571578
579+ let Features = " avx2" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
580+ def pshuflw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int)" >;
581+ def pshufhw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int)" >;
582+ def pshufd256 : X86Builtin<" _Vector<8, int>(_Vector<8, int>, _Constant int)" >;
583+ }
584+
572585let Features = " avx2" , Attributes = [NoThrow, Const, RequiredVectorWidth<256 >] in {
573586 def mpsadbw256 : X86Builtin<" _Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant char)" >;
574587 def palignr256 : X86Builtin<" _Vector<32, char>(_Vector<32, char>, _Vector<32, char>, _Constant int)" >;
@@ -584,9 +597,6 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
584597 def pmulhrsw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Vector<16, short>)" >;
585598 def psadbw256 : X86Builtin<" _Vector<4, long long int>(_Vector<32, char>, _Vector<32, char>)" >;
586599 def pshufb256 : X86Builtin<" _Vector<32, char>(_Vector<32, char>, _Vector<32, char>)" >;
587- def pshufd256 : X86Builtin<" _Vector<8, int>(_Vector<8, int>, _Constant int)" >;
588- def pshuflw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int)" >;
589- def pshufhw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int)" >;
590600 def psignb256 : X86Builtin<" _Vector<32, char>(_Vector<32, char>, _Vector<32, char>)" >;
591601 def psignw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Vector<16, short>)" >;
592602 def psignd256 : X86Builtin<" _Vector<8, int>(_Vector<8, int>, _Vector<8, int>)" >;
@@ -1989,9 +1999,28 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, Constexpr, RequiredVect
19891999 def prorq256 : X86Builtin<" _Vector<4, long long int>(_Vector<4, long long int>, _Constant int)" >;
19902000}
19912001
1992- let Features = " avx512bw" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
2002+ let Features = " avx512bw" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
19932003 def pshufhw512 : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Constant int)" >;
19942004 def pshuflw512 : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Constant int)" >;
2005+ }
2006+
2007+ let Features = " avx512f" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
2008+ def pshufd512 : X86Builtin<" _Vector<16, int>(_Vector<16, int>, _Constant int)" >;
2009+ def pshufd512_mask : X86Builtin<" _Vector<16, int>(_Vector<16, int>, _Constant int, _Vector<16, int>, unsigned short)" >;
2010+ def pshufd512_maskz : X86Builtin<" _Vector<16, int>(_Vector<16, int>, _Constant int, unsigned short)" >;
2011+ }
2012+
2013+ let Features = " avx512vl" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
2014+ def pshufd256_mask : X86Builtin<" _Vector<8, int>(_Vector<8, int>, _Constant int, _Vector<8, int>, unsigned char)" >;
2015+ def pshufd256_maskz : X86Builtin<" _Vector<8, int>(_Vector<8, int>, _Constant int, unsigned char)" >;
2016+ }
2017+
2018+ let Features = " avx512vl" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
2019+ def pshufd128_mask : X86Builtin<" _Vector<4, int>(_Vector<4, int>, _Constant int, _Vector<4, int>, unsigned char)" >;
2020+ def pshufd128_maskz : X86Builtin<" _Vector<4, int>(_Vector<4, int>, _Constant int, unsigned char)" >;
2021+ }
2022+
2023+ let Features = " avx512bw" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
19952024 def psllw512 : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Vector<8, short>)" >;
19962025}
19972026
@@ -3266,7 +3295,6 @@ let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<128>
32663295}
32673296
32683297let Features = " avx512f" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
3269- def pshufd512 : X86Builtin<" _Vector<16, int>(_Vector<16, int>, _Constant int)" >;
32703298 def expanddf512_mask : X86Builtin<" _Vector<8, double>(_Vector<8, double>, _Vector<8, double>, unsigned char)" >;
32713299 def expanddi512_mask : X86Builtin<" _Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>, unsigned char)" >;
32723300}
@@ -5114,3 +5142,24 @@ let Features = "avx10.2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>
51145142let Features = " avx10.2" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
51155143 def vsqrtbf16512 : X86Builtin<" _Vector<32, __bf16>(_Vector<32, __bf16>)" >;
51165144}
5145+
5146+ let Features = " avx512bw" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
5147+ def pshuflw512_mask : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Constant int, _Vector<32, short>, unsigned int)" >;
5148+ def pshuflw512_maskz : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Constant int, unsigned int)" >;
5149+ def pshufhw512_mask : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Constant int, _Vector<32, short>, unsigned int)" >;
5150+ def pshufhw512_maskz : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Constant int, unsigned int)" >;
5151+ }
5152+
5153+ let Features = " avx512vl,avx512bw" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
5154+ def pshuflw256_mask : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int, _Vector<16, short>, unsigned short)" >;
5155+ def pshuflw256_maskz : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int, unsigned short)" >;
5156+ def pshufhw256_mask : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int, _Vector<16, short>, unsigned short)" >;
5157+ def pshufhw256_maskz : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Constant int, unsigned short)" >;
5158+ }
5159+
5160+ let Features = " avx512vl,avx512bw" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
5161+ def pshuflw128_mask : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Constant int, _Vector<8, short>, unsigned char)" >;
5162+ def pshuflw128_maskz : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Constant int, unsigned char)" >;
5163+ def pshufhw128_mask : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Constant int, _Vector<8, short>, unsigned char)" >;
5164+ def pshufhw128_maskz : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Constant int, unsigned char)" >;
5165+ }
0 commit comments