@@ -91,42 +91,6 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
9191 def cmppd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>, _Constant char)" >;
9292 def cmpsd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>, _Constant char)" >;
9393 }
94-
95- let Features = " sse3" ,
96- Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
97- foreach Op = [" addsub" ] in {
98- def Op#ps : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>)" >;
99- def Op#pd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>)" >;
100- }
101- }
102-
103- let Features = " sse3" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
104- foreach Op = [" hadd" , " hsub" ] in {
105- def Op#ps : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>)" >;
106- def Op#pd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>)" >;
107- }
108- }
109-
110- let Features = " ssse3" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
111- def psignb128
112- : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>)" >;
113- def psignw128
114- : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
115- def psignd128
116- : X86Builtin<" _Vector<4, int>(_Vector<4, int>, _Vector<4, int>)" >;
117- def pmulhrsw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
118- def pmaddubsw128 : X86Builtin<" _Vector<8, short>(_Vector<16, char>, _Vector<16, char>)" >;
119- def pshufb128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>)" >;
120- }
121- }
122-
123- // AVX
124- let Attributes = [Const, NoThrow, RequiredVectorWidth<256 >],
125- Features = " avx" in {
126- foreach Op = [" max" , " min" ] in {
127- def Op#pd256 : X86Builtin<" _Vector<4, double>(_Vector<4, double>, _Vector<4, double>)" >;
128- def Op#ps256 : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Vector<8, float>)" >;
129- }
13094}
13195
13296let Features = " mmx" , Header = " mmintrin.h" , Attributes = [NoThrow, Const] in {
@@ -312,11 +276,22 @@ let Features = "sse3", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
312276 def lddqu : X86Builtin<" _Vector<16, char>(char const *)" >;
313277}
314278
315- let Features = " ssse3" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
316- def palignr128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>, _Constant int)" >;
279+ let Features = " sse3" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
280+ foreach Op = [" addsub" , " hadd" , " hsub" ] in {
281+ def Op#ps : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>)" >;
282+ def Op#pd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>)" >;
283+ }
317284}
318285
319286let Features = " ssse3" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
287+ def palignr128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>, _Constant int)" >;
288+ def pmulhrsw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
289+ def pmaddubsw128 : X86Builtin<" _Vector<8, short>(_Vector<16, char>, _Vector<16, char>)" >;
290+ def pshufb128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>)" >;
291+ def psignb128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>)" >;
292+ def psignw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
293+ def psignd128 : X86Builtin<" _Vector<4, int>(_Vector<4, int>, _Vector<4, int>)" >;
294+
320295 foreach Op = [" phadd" , " phsub" ] in {
321296 def Op#w128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
322297 def Op#sw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
@@ -330,25 +305,13 @@ let Features = "sse4.1", Attributes = [NoThrow, Const, RequiredVectorWidth<128>]
330305 def roundsd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>, _Constant int)" >;
331306 def roundpd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Constant int)" >;
332307 def dpps : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>, _Constant char)" >;
333- def dppd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, "
334- " _Vector<2,double>, _Constant char)" >;
335- def mpsadbw128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, "
336- " _Vector<16, char>, _Constant char)" >;
337- }
338-
339- let Features = " sse4.1" ,
340- Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
341- def insertps128 : X86Builtin<" _Vector<4, float>(_Vector<4, float>, "
342- " _Vector<4, float>, _Constant char)" >;
343- def ptestz128
344- : X86Builtin<" int(_Vector<2, long long int>, _Vector<2, long long int>)" >;
345- def ptestc128
346- : X86Builtin<" int(_Vector<2, long long int>, _Vector<2, long long int>)" >;
347- def ptestnzc128
348- : X86Builtin<" int(_Vector<2, long long int>, _Vector<2, long long int>)" >;
308+ def dppd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2,double>, _Constant char)" >;
309+ def mpsadbw128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>, _Constant char)" >;
349310}
350311
351312let Features = " sse4.1" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
313+ def insertps128 : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>, _Constant char)" >;
314+
352315 def pblendw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>, _Constant int)" >;
353316 def blendpd : X86Builtin<" _Vector<2, double>(_Vector<2, double>, _Vector<2, double>, _Constant int)" >;
354317 def blendps : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>, _Constant int)" >;
@@ -360,6 +323,10 @@ let Features = "sse4.1", Attributes = [NoThrow, Const, Constexpr, RequiredVector
360323 def packusdw128 : X86Builtin<" _Vector<8, short>(_Vector<4, int>, _Vector<4, int>)" >;
361324 def phminposuw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>)" >;
362325
326+ def ptestz128 : X86Builtin<" int(_Vector<2, long long int>, _Vector<2, long long int>)" >;
327+ def ptestc128 : X86Builtin<" int(_Vector<2, long long int>, _Vector<2, long long int>)" >;
328+ def ptestnzc128 : X86Builtin<" int(_Vector<2, long long int>, _Vector<2, long long int>)" >;
329+
363330 def vec_ext_v16qi : X86Builtin<" char(_Vector<16, char>, _Constant int)" >;
364331 def vec_set_v16qi : X86Builtin<" _Vector<16, char>(_Vector<16, char>, char, _Constant int)" >;
365332 def vec_set_v4si : X86Builtin<" _Vector<4, int>(_Vector<4, int>, int, _Constant int)" >;
@@ -510,6 +477,11 @@ let Features = "avx", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in
510477 def vperm2f128_pd256 : X86Builtin<" _Vector<4, double>(_Vector<4, double>, _Vector<4, double>, _Constant int)" >;
511478 def vperm2f128_ps256 : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Vector<8, float>, _Constant int)" >;
512479 def vperm2f128_si256 : X86Builtin<" _Vector<8, int>(_Vector<8, int>, _Vector<8, int>, _Constant int)" >;
480+
481+ foreach Op = [" max" , " min" ] in {
482+ def Op#pd256 : X86Builtin<" _Vector<4, double>(_Vector<4, double>, _Vector<4, double>)" >;
483+ def Op#ps256 : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Vector<8, float>)" >;
484+ }
513485}
514486
515487let Features = " avx" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
@@ -531,7 +503,7 @@ let Features = "avx", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWid
531503 def vpermilpd256 : X86Builtin<" _Vector<4, double>(_Vector<4, double>, _Constant int)" >;
532504 def vpermilps256 : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Constant int)" >;
533505
534- foreach Op = [" hadd" , " hsub" ] in {
506+ foreach Op = [" addsub " , " hadd" , " hsub" ] in {
535507 def Op#pd256 : X86Builtin<" _Vector<4, double>(_Vector<4, double>, _Vector<4, double>)" >;
536508 def Op#ps256 : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Vector<8, float>)" >;
537509 }
@@ -572,15 +544,6 @@ let Features = "avx",
572544 def movmskps256 : X86Builtin<" int(_Vector<8, float>)" >;
573545}
574546
575- let Features = " avx" ,
576- Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
577- def addsubpd256
578- : X86Builtin<
579- " _Vector<4, double>(_Vector<4, double>, _Vector<4, double>)" >;
580- def addsubps256
581- : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Vector<8, float>)" >;
582- }
583-
584547let Features = " avx" , Attributes = [NoThrow] in {
585548 def vzeroall : X86Builtin<" void()" >;
586549 def vzeroupper : X86Builtin<" void()" >;
@@ -2506,24 +2469,28 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256
25062469 def rsqrt14ps256_mask : X86Builtin<" _Vector<8, float>(_Vector<8, float>, _Vector<8, float>, unsigned char)" >;
25072470}
25082471
2509- let Features = " avx512bw" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
2472+ let Features = " avx512bw" ,
2473+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
25102474 def cvtb2mask512 : X86Builtin<" unsigned long long int(_Vector<64, char>)" >;
25112475 def cvtmask2b512 : X86Builtin<" _Vector<64, char>(unsigned long long int)" >;
25122476 def cvtmask2w512 : X86Builtin<" _Vector<32, short>(unsigned int)" >;
25132477}
25142478
2515- let Features = " avx512dq" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
2479+ let Features = " avx512dq" ,
2480+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
25162481 def cvtd2mask512 : X86Builtin<" unsigned short(_Vector<16, int>)" >;
25172482 def cvtmask2d512 : X86Builtin<" _Vector<16, int>(unsigned short)" >;
25182483 def cvtmask2q512 : X86Builtin<" _Vector<8, long long int>(unsigned char)" >;
25192484 def cvtq2mask512 : X86Builtin<" unsigned char(_Vector<8, long long int>)" >;
25202485}
25212486
2522- let Features = " avx512bw,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<128 >] in {
2487+ let Features = " avx512bw,avx512vl" ,
2488+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
25232489 def cvtb2mask128 : X86Builtin<" unsigned short(_Vector<16, char>)" >;
25242490}
25252491
2526- let Features = " avx512bw,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<256 >] in {
2492+ let Features = " avx512bw,avx512vl" ,
2493+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
25272494 def cvtb2mask256 : X86Builtin<" unsigned int(_Vector<32, char>)" >;
25282495}
25292496
@@ -2543,11 +2510,13 @@ let Features = "avx512bw,avx512vl", Attributes = [NoThrow, Const, RequiredVector
25432510 def cvtmask2w256 : X86Builtin<" _Vector<16, short>(unsigned short)" >;
25442511}
25452512
2546- let Features = " avx512dq,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<128 >] in {
2513+ let Features = " avx512dq,avx512vl" ,
2514+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
25472515 def cvtd2mask128 : X86Builtin<" unsigned char(_Vector<4, int>)" >;
25482516}
25492517
2550- let Features = " avx512dq,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<256 >] in {
2518+ let Features = " avx512dq,avx512vl" ,
2519+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
25512520 def cvtd2mask256 : X86Builtin<" unsigned char(_Vector<8, int>)" >;
25522521}
25532522
@@ -2567,11 +2536,13 @@ let Features = "avx512dq,avx512vl", Attributes = [NoThrow, Const, RequiredVector
25672536 def cvtmask2q256 : X86Builtin<" _Vector<4, long long int>(unsigned char)" >;
25682537}
25692538
2570- let Features = " avx512dq,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<128 >] in {
2539+ let Features = " avx512dq,avx512vl" ,
2540+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
25712541 def cvtq2mask128 : X86Builtin<" unsigned char(_Vector<2, long long int>)" >;
25722542}
25732543
2574- let Features = " avx512dq,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<256 >] in {
2544+ let Features = " avx512dq,avx512vl" ,
2545+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
25752546 def cvtq2mask256 : X86Builtin<" unsigned char(_Vector<4, long long int>)" >;
25762547}
25772548
@@ -3365,15 +3336,18 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256
33653336 def vcvtps2ph256_mask : X86Builtin<" _Vector<8, short>(_Vector<8, float>, _Constant int, _Vector<8, short>, unsigned char)" >;
33663337}
33673338
3368- let Features = " avx512bw" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
3339+ let Features = " avx512bw" ,
3340+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
33693341 def cvtw2mask512 : X86Builtin<" unsigned int(_Vector<32, short>)" >;
33703342}
33713343
3372- let Features = " avx512bw,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<128 >] in {
3344+ let Features = " avx512bw,avx512vl" ,
3345+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
33733346 def cvtw2mask128 : X86Builtin<" unsigned char(_Vector<8, short>)" >;
33743347}
33753348
3376- let Features = " avx512bw,avx512vl" , Attributes = [NoThrow, Const, RequiredVectorWidth<256 >] in {
3349+ let Features = " avx512bw,avx512vl" ,
3350+ Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
33773351 def cvtw2mask256 : X86Builtin<" unsigned short(_Vector<16, short>)" >;
33783352}
33793353
0 commit comments