diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td index 000532ec23916..9a23c35766cac 100644 --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -3748,18 +3748,18 @@ multiclass sve2_int_mla_long_by_indexed_elem opc, string asm, // SVE Integer Dot Product Group //===----------------------------------------------------------------------===// -class sve_intx_dot +class sve_intx_dot sz, bits<5> op5, bit U, string asm, + ZPRRegOp zprty1, ZPRRegOp zprty2> : I<(outs zprty1:$Zda), (ins zprty1:$_Zda, zprty2:$Zn, zprty2:$Zm), asm, "\t$Zda, $Zn, $Zm", "", []>, Sched<[]> { bits<5> Zda; bits<5> Zn; bits<5> Zm; - let Inst{31-23} = 0b010001001; - let Inst{22} = sz; + let Inst{31-24} = 0b01000100; + let Inst{23-22} = sz; let Inst{21} = 0; let Inst{20-16} = Zm; - let Inst{15-11} = 0; + let Inst{15-11} = op5; let Inst{10} = U; let Inst{9-5} = Zn; let Inst{4-0} = Zda; @@ -3770,13 +3770,19 @@ class sve_intx_dot { - def _BtoS : sve_intx_dot<0b0, opc, asm, ZPR32, ZPR8>; - def _HtoD : sve_intx_dot<0b1, opc, asm, ZPR64, ZPR16>; + def _BtoS : sve_intx_dot<0b10, 0b00000, opc, asm, ZPR32, ZPR8>; + def _HtoD : sve_intx_dot<0b11, 0b00000, opc, asm, ZPR64, ZPR16>; def : SVE_3_Op_Pat(NAME # _BtoS)>; def : SVE_3_Op_Pat(NAME # _HtoD)>; } +multiclass sve2p1_two_way_dot_vv { + def NAME : sve_intx_dot<0b00, 0b11001, u, mnemonic, ZPR32, ZPR16>; + + def : SVE_3_Op_Pat(NAME)>; +} + //===----------------------------------------------------------------------===// // SVE Integer Dot Product Group - Indexed Group //===----------------------------------------------------------------------===// @@ -9893,32 +9899,6 @@ multiclass sve_fp_clamp_bfloat { def : SVE_3_Op_Pat(NAME)>; } -// SVE two-way dot product -class sve2p1_two_way_dot_vv - : I<(outs ZPR32:$Zda), (ins ZPR32:$_Zda, ZPR16:$Zn, ZPR16:$Zm), - mnemonic, "\t$Zda, $Zn, $Zm", - "", []>, Sched<[]> { - bits<5> Zda; - bits<5> Zn; - bits<5> Zm; - let Inst{31-21} = 0b01000100000; - let Inst{20-16} = Zm; - let Inst{15-11} = 0b11001; - let Inst{10} = u; - let Inst{9-5} = Zn; - let Inst{4-0} = Zda; - - let Constraints = "$Zda = $_Zda"; - let DestructiveInstType = DestructiveOther; - let hasSideEffects = 0; -} - -multiclass sve2p1_two_way_dot_vv { - def NAME : sve2p1_two_way_dot_vv; - - def : SVE_3_Op_Pat(NAME)>; -} - // SVE two-way dot product (indexed) class sve2p1_two_way_dot_vvi : I<(outs ZPR32:$Zda), (ins ZPR32:$_Zda, ZPR16:$Zn, ZPR3b16:$Zm, VectorIndexS32b:$i2),