summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2018-07-17 15:41:58 +0000
committerSander de Smalen <sander.desmalen@arm.com>2018-07-17 15:41:58 +0000
commit7b33faaf38a49787b209cfa514bfda5e20d1fc40 (patch)
tree0a634bda90346099ab07c056a0a4a2c8b0bd2225 /llvm/lib
parentc491c2b955a2a2dadb719a38c8df62c4e708bb6e (diff)
downloadbcm5719-llvm-7b33faaf38a49787b209cfa514bfda5e20d1fc40.tar.gz
bcm5719-llvm-7b33faaf38a49787b209cfa514bfda5e20d1fc40.zip
[AArch64][SVE]: Integer multiply-add/subtract instructions.
This patch adds support for the following instructions: MLA mul-add, writing addend (Zda = Zda + Zn * Zm) MLS mul-sub, writing addend (Zda = Zda + -Zn * Zm) MAD mul-add, writing multiplicant (Zdn = Za + Zdn * Zm) MSB mul-sub, writing multiplicant (Zdn = Za + -Zdn * Zm) llvm-svn: 337293
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td5
-rw-r--r--llvm/lib/Target/AArch64/SVEInstrFormats.td64
2 files changed, 69 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
index 60114f7f479..42c3df3b9f3 100644
--- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
@@ -48,6 +48,11 @@ let Predicates = [HasSVE] in {
defm SQSUB_ZI : sve_int_arith_imm0<0b110, "sqsub">;
defm UQSUB_ZI : sve_int_arith_imm0<0b111, "uqsub">;
+ defm MAD_ZPmZZ : sve_int_mladdsub_vvv_pred<0b0, "mad">;
+ defm MSB_ZPmZZ : sve_int_mladdsub_vvv_pred<0b1, "msb">;
+ defm MLA_ZPmZZ : sve_int_mlas_vvv_pred<0b0, "mla">;
+ defm MLS_ZPmZZ : sve_int_mlas_vvv_pred<0b1, "mls">;
+
defm ORR_ZI : sve_int_log_imm<0b00, "orr", "orn">;
defm EOR_ZI : sve_int_log_imm<0b01, "eor", "eon">;
defm AND_ZI : sve_int_log_imm<0b10, "and", "bic">;
diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td
index 39397447fea..fced9d0d830 100644
--- a/llvm/lib/Target/AArch64/SVEInstrFormats.td
+++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td
@@ -1381,6 +1381,70 @@ multiclass sve_int_bin_pred_arit_1<bits<3> opc, string asm> {
}
//===----------------------------------------------------------------------===//
+// SVE Integer Multiply-Add Group
+//===----------------------------------------------------------------------===//
+
+class sve_int_mladdsub_vvv_pred<bits<2> sz8_64, bits<1> opc, string asm,
+ ZPRRegOp zprty>
+: I<(outs zprty:$Zdn), (ins PPR3bAny:$Pg, zprty:$_Zdn, zprty:$Zm, zprty:$Za),
+ asm, "\t$Zdn, $Pg/m, $Zm, $Za",
+ "",
+ []>, Sched<[]> {
+ bits<3> Pg;
+ bits<5> Zdn;
+ bits<5> Za;
+ bits<5> Zm;
+ let Inst{31-24} = 0b00000100;
+ let Inst{23-22} = sz8_64;
+ let Inst{21} = 0b0;
+ let Inst{20-16} = Zm;
+ let Inst{15-14} = 0b11;
+ let Inst{13} = opc;
+ let Inst{12-10} = Pg;
+ let Inst{9-5} = Za;
+ let Inst{4-0} = Zdn;
+
+ let Constraints = "$Zdn = $_Zdn";
+}
+
+multiclass sve_int_mladdsub_vvv_pred<bits<1> opc, string asm> {
+ def _B : sve_int_mladdsub_vvv_pred<0b00, opc, asm, ZPR8>;
+ def _H : sve_int_mladdsub_vvv_pred<0b01, opc, asm, ZPR16>;
+ def _S : sve_int_mladdsub_vvv_pred<0b10, opc, asm, ZPR32>;
+ def _D : sve_int_mladdsub_vvv_pred<0b11, opc, asm, ZPR64>;
+}
+
+class sve_int_mlas_vvv_pred<bits<2> sz8_64, bits<1> opc, string asm,
+ ZPRRegOp zprty>
+: I<(outs zprty:$Zda), (ins PPR3bAny:$Pg, zprty:$_Zda, zprty:$Zn, zprty:$Zm),
+ asm, "\t$Zda, $Pg/m, $Zn, $Zm",
+ "",
+ []>, Sched<[]> {
+ bits<3> Pg;
+ bits<5> Zda;
+ bits<5> Zm;
+ bits<5> Zn;
+ let Inst{31-24} = 0b00000100;
+ let Inst{23-22} = sz8_64;
+ let Inst{21} = 0b0;
+ let Inst{20-16} = Zm;
+ let Inst{15-14} = 0b01;
+ let Inst{13} = opc;
+ let Inst{12-10} = Pg;
+ let Inst{9-5} = Zn;
+ let Inst{4-0} = Zda;
+
+ let Constraints = "$Zda = $_Zda";
+}
+
+multiclass sve_int_mlas_vvv_pred<bits<1> opc, string asm> {
+ def _B : sve_int_mlas_vvv_pred<0b00, opc, asm, ZPR8>;
+ def _H : sve_int_mlas_vvv_pred<0b01, opc, asm, ZPR16>;
+ def _S : sve_int_mlas_vvv_pred<0b10, opc, asm, ZPR32>;
+ def _D : sve_int_mlas_vvv_pred<0b11, opc, asm, ZPR64>;
+}
+
+//===----------------------------------------------------------------------===//
// SVE Integer Arithmetic - Unary Predicated Group
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud