diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2018-07-18 09:37:51 +0000 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2018-07-18 09:37:51 +0000 |
commit | ccdc7ebc1d99a3ccc34fe4a875b916bbb23b7298 (patch) | |
tree | 3f73a10d47100884ab090f976c4b163d5bf877fa /llvm/lib | |
parent | c1090da8529d85e85ab8dbf141ebecd8926b00ab (diff) | |
download | bcm5719-llvm-ccdc7ebc1d99a3ccc34fe4a875b916bbb23b7298.tar.gz bcm5719-llvm-ccdc7ebc1d99a3ccc34fe4a875b916bbb23b7298.zip |
[AArch64][SVE] Asm: Support for UDOT/SDOT instructions.
The signed/unsigned DOT instructions perform a dot-product on
quadtuplets from two source vectors and accumulate the result in
the destination register. The instructions come in two forms:
Vector form, e.g.
sdot z0.s, z1.b, z2.b - signed dot product on four 8-bit quad-tuplets,
accumulating results in 32-bit elements.
udot z0.d, z1.h, z2.h - unsigned dot product on four 16-bit quad-tuplets,
accumulating results in 64-bit elements.
Indexed form, e.g.
sdot z0.s, z1.b, z2.b[3] - signed dot product on four 8-bit quad-tuplets
with specified quadtuplet from second
source vector, accumulating results in 32-bit
elements.
udot z0.d, z1.h, z2.h[1] - dot product on four 16-bit quad-tuplets
with specified quadtuplet from second
source vector, accumulating results in 64-bit
elements.
llvm-svn: 337372
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td | 6 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/SVEInstrFormats.td | 66 |
2 files changed, 72 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td index b37c6967727..94f0be01b3c 100644 --- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -72,6 +72,12 @@ let Predicates = [HasSVE] in { defm SDIVR_ZPmZ : sve_int_bin_pred_arit_2_div<0b110, "sdivr">; defm UDIVR_ZPmZ : sve_int_bin_pred_arit_2_div<0b111, "udivr">; + defm SDOT_ZZZ : sve_intx_dot<0b0, "sdot">; + defm UDOT_ZZZ : sve_intx_dot<0b1, "udot">; + + defm SDOT_ZZZI : sve_intx_dot_by_indexed_elem<0b0, "sdot">; + defm UDOT_ZZZI : sve_intx_dot_by_indexed_elem<0b1, "udot">; + defm SXTB_ZPmZ : sve_int_un_pred_arit_0_h<0b000, "sxtb">; defm UXTB_ZPmZ : sve_int_un_pred_arit_0_h<0b001, "uxtb">; defm SXTH_ZPmZ : sve_int_un_pred_arit_0_w<0b010, "sxth">; diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td index c759950daa7..4bcde3edbcf 100644 --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -1458,6 +1458,72 @@ multiclass sve_int_mlas_vvv_pred<bits<1> opc, string asm> { } //===----------------------------------------------------------------------===// +// SVE Integer Dot Product Group +//===----------------------------------------------------------------------===// + +class sve_intx_dot<bit sz, 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{21} = 0; + let Inst{20-16} = Zm; + let Inst{15-11} = 0; + let Inst{10} = U; + let Inst{9-5} = Zn; + let Inst{4-0} = Zda; + + let Constraints = "$Zda = $_Zda"; +} + +multiclass sve_intx_dot<bit opc, string asm> { + def _S : sve_intx_dot<0b0, opc, asm, ZPR32, ZPR8>; + def _D : sve_intx_dot<0b1, opc, asm, ZPR64, ZPR16>; +} + +//===----------------------------------------------------------------------===// +// SVE Integer Dot Product Group - Indexed Group +//===----------------------------------------------------------------------===// + +class sve_intx_dot_by_indexed_elem<bit sz, bit U, string asm, + ZPRRegOp zprty1, ZPRRegOp zprty2, + ZPRRegOp zprty3, Operand itype> +: I<(outs zprty1:$Zda), (ins zprty1:$_Zda, zprty2:$Zn, zprty3:$Zm, itype:$iop), + asm, "\t$Zda, $Zn, $Zm$iop", + "", []>, Sched<[]> { + bits<5> Zda; + bits<5> Zn; + let Inst{31-23} = 0b010001001; + let Inst{22} = sz; + let Inst{21} = 0b1; + let Inst{15-11} = 0; + let Inst{10} = U; + let Inst{9-5} = Zn; + let Inst{4-0} = Zda; + + let Constraints = "$Zda = $_Zda"; +} + +multiclass sve_intx_dot_by_indexed_elem<bit opc, string asm> { + def _S : sve_intx_dot_by_indexed_elem<0b0, opc, asm, ZPR32, ZPR8, ZPR3b8, VectorIndexS> { + bits<2> iop; + bits<3> Zm; + let Inst{20-19} = iop; + let Inst{18-16} = Zm; + } + def _D : sve_intx_dot_by_indexed_elem<0b1, opc, asm, ZPR64, ZPR16, ZPR4b16, VectorIndexD> { + bits<1> iop; + bits<4> Zm; + let Inst{20} = iop; + let Inst{19-16} = Zm; + } +} + +//===----------------------------------------------------------------------===// // SVE Integer Arithmetic - Unary Predicated Group //===----------------------------------------------------------------------===// |