@@ -93,20 +93,23 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
9393 }
9494
9595 let Features = " sse2" in {
96- def pmulhw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
9796 def pavgb128 : X86Builtin<" _Vector<16, char>(_Vector<16, char>, _Vector<16, char>)" >;
9897 def pavgw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
9998 def packsswb128 : X86Builtin<" _Vector<16, char>(_Vector<8, short>, _Vector<8, short>)" >;
10099 def packssdw128 : X86Builtin<" _Vector<8, short>(_Vector<4, int>, _Vector<4, int>)" >;
101100 def packuswb128 : X86Builtin<" _Vector<16, char>(_Vector<8, short>, _Vector<8, short>)" >;
102- def pmulhuw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
103101 def vec_ext_v2di : X86Builtin<" long long int(_Vector<2, long long int>, _Constant int)" >;
104102 def vec_ext_v4si : X86Builtin<" int(_Vector<4, int>, _Constant int)" >;
105103 def vec_ext_v4sf : X86Builtin<" float(_Vector<4, float>, _Constant int)" >;
106104 def vec_ext_v8hi : X86Builtin<" short(_Vector<8, short>, _Constant int)" >;
107105 def vec_set_v8hi : X86Builtin<" _Vector<8, short>(_Vector<8, short>, short, _Constant int)" >;
108106 }
109107
108+ let Features = " sse2" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128 >] in {
109+ def pmulhw128 : X86Builtin<" _Vector<8, short>(_Vector<8, short>, _Vector<8, short>)" >;
110+ def pmulhuw128 : X86Builtin<" _Vector<8, unsigned short>(_Vector<8, unsigned short>, _Vector<8, unsigned short>)" >;
111+ }
112+
110113 let Features = " sse3" in {
111114 foreach Op = [" addsub" , " hadd" , " hsub" ] in {
112115 def Op#ps : X86Builtin<" _Vector<4, float>(_Vector<4, float>, _Vector<4, float>)" >;
@@ -579,8 +582,6 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
579582 def pmovmskb256 : X86Builtin<" int(_Vector<32, char>)" >;
580583 def pmuldq256 : X86Builtin<" _Vector<4, long long int>(_Vector<8, int>, _Vector<8, int>)" >;
581584 def pmulhrsw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Vector<16, short>)" >;
582- def pmulhuw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Vector<16, short>)" >;
583- def pmulhw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Vector<16, short>)" >;
584585 def pmuludq256 : X86Builtin<" _Vector<4, long long int>(_Vector<8, int>, _Vector<8, int>)" >;
585586 def psadbw256 : X86Builtin<" _Vector<4, long long int>(_Vector<32, char>, _Vector<32, char>)" >;
586587 def pshufb256 : X86Builtin<" _Vector<32, char>(_Vector<32, char>, _Vector<32, char>)" >;
@@ -619,6 +620,11 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
619620 def insert128i256 : X86Builtin<" _Vector<4, long long int>(_Vector<4, long long int>, _Vector<2, long long int>, _Constant int)" >;
620621}
621622
623+ let Features = " avx2" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256 >] in {
624+ def pmulhuw256 : X86Builtin<" _Vector<16, unsigned short>(_Vector<16, unsigned short>, _Vector<16, unsigned short>)" >;
625+ def pmulhw256 : X86Builtin<" _Vector<16, short>(_Vector<16, short>, _Vector<16, short>)" >;
626+ }
627+
622628let Features = " avx2" , Attributes = [NoThrow, RequiredVectorWidth<256 >] in {
623629 def maskloadd256 : X86Builtin<" _Vector<8, int>(_Vector<8, int const *>, _Vector<8, int>)" >;
624630 def maskloadq256 : X86Builtin<" _Vector<4, long long int>(_Vector<4, long long int const *>, _Vector<4, long long int>)" >;
@@ -1429,7 +1435,10 @@ let Features = "avx512bitalg,evex512", Attributes = [NoThrow, Const, RequiredVec
14291435
14301436let Features = " avx512bw,evex512" , Attributes = [NoThrow, Const, RequiredVectorWidth<512 >] in {
14311437 def pmulhrsw512 : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Vector<32, short>)" >;
1432- def pmulhuw512 : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Vector<32, short>)" >;
1438+ }
1439+
1440+ let Features = " avx512bw,evex512" , Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512 >] in {
1441+ def pmulhuw512 : X86Builtin<" _Vector<32, unsigned short>(_Vector<32, unsigned short>, _Vector<32, unsigned short>)" >;
14331442 def pmulhw512 : X86Builtin<" _Vector<32, short>(_Vector<32, short>, _Vector<32, short>)" >;
14341443}
14351444
0 commit comments