Index: llvm/trunk/lib/Target/X86/X86InstrAVX512.td =================================================================== --- llvm/trunk/lib/Target/X86/X86InstrAVX512.td +++ llvm/trunk/lib/Target/X86/X86InstrAVX512.td @@ -1955,11 +1955,12 @@ } multiclass avx512_mask_binop_all opc, string OpcodeStr, - SDPatternOperator OpNode, bit IsCommutable> { + SDPatternOperator OpNode, bit IsCommutable, + Predicate prdW = HasAVX512> { defm B : avx512_mask_binop, VEX_4V, VEX_L, PD; defm W : avx512_mask_binop, VEX_4V, VEX_L, PS; + prdW, IsCommutable>, VEX_4V, VEX_L, PS; defm D : avx512_mask_binop, VEX_4V, VEX_L, VEX_W, PD; defm Q : avx512_mask_binop; defm KXOR : avx512_mask_binop_all<0x47, "kxor", xor, 1>; defm KANDN : avx512_mask_binop_all<0x42, "kandn", andn, 0>; +defm KADD : avx512_mask_binop_all<0x4A, "kadd", add, 1, HasDQI>; multiclass avx512_mask_binop_int { let Predicates = [HasAVX512] in Index: llvm/trunk/test/MC/X86/x86-64-avx512bw.s =================================================================== --- llvm/trunk/test/MC/X86/x86-64-avx512bw.s +++ llvm/trunk/test/MC/X86/x86-64-avx512bw.s @@ -4112,6 +4112,14 @@ // CHECK: encoding: [0x62,0x61,0x2d,0x40,0x69,0xb2,0xc0,0xdf,0xff,0xff] vpunpckhwd -8256(%rdx), %zmm26, %zmm30 +// CHECK: kaddd %k6, %k6, %k2 +// CHECK: encoding: [0xc4,0xe1,0xcd,0x4a,0xd6] + kaddd %k6, %k6, %k2 + +// CHECK: kaddq %k4, %k6, %k3 +// CHECK: encoding: [0xc4,0xe1,0xcc,0x4a,0xdc] + kaddq %k4, %k6, %k3 + // CHECK: vpalignr $171, %zmm17, %zmm26, %zmm22 // CHECK: encoding: [0x62,0xa3,0x2d,0x40,0x0f,0xf1,0xab] vpalignr $171, %zmm17, %zmm26, %zmm22 Index: llvm/trunk/test/MC/X86/x86-64-avx512dq.s =================================================================== --- llvm/trunk/test/MC/X86/x86-64-avx512dq.s +++ llvm/trunk/test/MC/X86/x86-64-avx512dq.s @@ -2371,3 +2371,19 @@ // CHECK: encoding: [0x62,0xa1,0xff,0xca,0x7a,0xd5] vcvtuqq2ps %zmm21, %ymm18 {%k2} {z} +// CHECK: kaddb %k7, %k4, %k5 +// CHECK: encoding: [0xc5,0xdd,0x4a,0xef] + kaddb %k7, %k4, %k5 + +// CHECK: kaddb %k4, %k6, %k5 +// CHECK: encoding: [0xc5,0xcd,0x4a,0xec] + kaddb %k4, %k6, %k5 + +// CHECK: kaddw %k4, %k3, %k2 +// CHECK: encoding: [0xc5,0xe4,0x4a,0xd4] + kaddw %k4, %k3, %k2 + +// CHECK: kaddw %k6, %k6, %k2 +// CHECK: encoding: [0xc5,0xcc,0x4a,0xd6] + kaddw %k6, %k6, %k2 +