Skip to content

Commit

Permalink
[SVE] Tidy up the bfloat matmul instruction classes
Browse files Browse the repository at this point in the history
It doesn't really make sense for the bfloat matmul to derive
from sve_bfloat_dot_base, especially since it's not used
anywhere else.

Differential Revision: https://reviews.llvm.org/D138787
  • Loading branch information
david-arm committed Nov 28, 2022
1 parent 5888e5a commit 36141ca
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions llvm/lib/Target/AArch64/SVEInstrFormats.td
Expand Up @@ -8297,21 +8297,6 @@ multiclass sve2_crypto_unary_op<bit opc, string asm, SDPatternOperator op> {
// SVE BFloat16 Group
//===----------------------------------------------------------------------===//

class sve_bfloat_dot_base<bits<2> opc, string asm, string ops, dag iops>
: I<(outs ZPR32:$Zda), iops, asm, ops, "", []>, Sched<[]> {
bits<5> Zda;
bits<5> Zn;
let Inst{31-21} = 0b01100100011;
let Inst{15-14} = opc;
let Inst{13-10} = 0b0000;
let Inst{9-5} = Zn;
let Inst{4-0} = Zda;

let Constraints = "$Zda = $_Zda";
let DestructiveInstType = DestructiveOther;
let ElementSize = ElementSizeH;
}

class sve_float_dot<bit bf, string asm>
: I<(outs ZPR32:$Zda), (ins ZPR32:$_Zda, ZPR16:$Zn, ZPR16:$Zm),
asm, "\t$Zda, $Zn, $Zm", "", []>, Sched<[]> {
Expand Down Expand Up @@ -8396,16 +8381,26 @@ multiclass sve_bfloat_matmul_longvecl<bit BT, bit sub, string asm, SDPatternOper
}

class sve_bfloat_matmul_longvecl_idx<bit BT, bit sub, string asm>
: sve_bfloat_dot_base<0b01, asm, "\t$Zda, $Zn, $Zm$iop",
(ins ZPR32:$_Zda, ZPR16:$Zn, ZPR3b16:$Zm, VectorIndexH:$iop)> {
bits<3> iop;
: I<(outs ZPR32:$Zda), (ins ZPR32:$_Zda, ZPR16:$Zn, ZPR3b16:$Zm, VectorIndexH:$iop),
asm, "\t$Zda, $Zn, $Zm$iop", "", []>, Sched<[]> {
bits<5> Zda;
bits<5> Zn;
bits<3> Zm;
let Inst{23} = 0b1;
bits<3> iop;
let Inst{31-21} = 0b01100100111;
let Inst{20-19} = iop{2-1};
let Inst{18-16} = Zm;
let Inst{15-14} = 0b01;
let Inst{13} = sub;
let Inst{12} = 0b0;
let Inst{11} = iop{0};
let Inst{10} = BT;
let Inst{9-5} = Zn;
let Inst{4-0} = Zda;

let Constraints = "$Zda = $_Zda";
let DestructiveInstType = DestructiveOther;
let ElementSize = ElementSizeH;
}

multiclass sve_bfloat_matmul_longvecl_idx<bit BT, bit sub, string asm, SDPatternOperator op> {
Expand Down

0 comments on commit 36141ca

Please sign in to comment.