summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2018-07-03 14:57:48 +0000
committerSander de Smalen <sander.desmalen@arm.com>2018-07-03 14:57:48 +0000
commitcbd224941fb3662f305c24de224ae0003d2a3b2d (patch)
treef276d83e9c0973976a78b1f336cc98219dfc6d7f /llvm/lib/Target/AArch64
parent9338a8838afe3620538c44186d2eb6f25d2213a7 (diff)
downloadbcm5719-llvm-cbd224941fb3662f305c24de224ae0003d2a3b2d.tar.gz
bcm5719-llvm-cbd224941fb3662f305c24de224ae0003d2a3b2d.zip
[AArch64][SVE] Asm: Support for predicated unary operations.
The patch includes support for the following instructions: ABS z0.h, p0/m, z0.h NEG z0.h, p0/m, z0.h (S|U)XTB z0.h, p0/m, z0.h (S|U)XTB z0.s, p0/m, z0.s (S|U)XTB z0.d, p0/m, z0.d (S|U)XTH z0.s, p0/m, z0.s (S|U)XTH z0.d, p0/m, z0.d (S|U)XTW z0.d, p0/m, z0.d llvm-svn: 336204
Diffstat (limited to 'llvm/lib/Target/AArch64')
-rw-r--r--llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td9
-rw-r--r--llvm/lib/Target/AArch64/SVEInstrFormats.td48
2 files changed, 57 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
index 67659af1c6e..76f114bc820 100644
--- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
@@ -43,6 +43,15 @@ let Predicates = [HasSVE] in {
defm EOR_ZI : sve_int_log_imm<0b01, "eor", "eon">;
defm AND_ZI : sve_int_log_imm<0b10, "and", "bic">;
+ 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">;
+ defm UXTH_ZPmZ : sve_int_un_pred_arit_0_w<0b011, "uxth">;
+ defm SXTW_ZPmZ : sve_int_un_pred_arit_0_d<0b100, "sxtw">;
+ defm UXTW_ZPmZ : sve_int_un_pred_arit_0_d<0b101, "uxtw">;
+ defm ABS_ZPmZ : sve_int_un_pred_arit_0< 0b110, "abs">;
+ defm NEG_ZPmZ : sve_int_un_pred_arit_0< 0b111, "neg">;
+
defm FADD_ZPmI : sve_fp_2op_i_p_zds<0b000, "fadd", sve_fpimm_half_one>;
defm FMUL_ZPmI : sve_fp_2op_i_p_zds<0b010, "fmul", sve_fpimm_half_two>;
defm FMAX_ZPmI : sve_fp_2op_i_p_zds<0b110, "fmax", sve_fpimm_zero_one>;
diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td
index 39c6783f85d..f780ef01a9e 100644
--- a/llvm/lib/Target/AArch64/SVEInstrFormats.td
+++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td
@@ -888,6 +888,54 @@ multiclass sve_int_bin_pred_arit_0<bits<3> opc, string asm> {
}
//===----------------------------------------------------------------------===//
+// SVE Integer Arithmetic - Unary Predicated Group
+//===----------------------------------------------------------------------===//
+
+class sve_int_un_pred_arit_0<bits<2> sz8_64, bits<3> opc, string asm,
+ ZPRRegOp zprty>
+: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
+ asm, "\t$Zd, $Pg/m, $Zn",
+ "",
+ []>, Sched<[]> {
+ bits<3> Pg;
+ bits<5> Zd;
+ bits<5> Zn;
+ let Inst{31-24} = 0b00000100;
+ let Inst{23-22} = sz8_64;
+ let Inst{21-19} = 0b010;
+ let Inst{18-16} = opc;
+ let Inst{15-13} = 0b101;
+ let Inst{12-10} = Pg;
+ let Inst{9-5} = Zn;
+ let Inst{4-0} = Zd;
+
+ let Constraints = "$Zd = $_Zd";
+}
+
+multiclass sve_int_un_pred_arit_0<bits<3> opc, string asm> {
+ def _B : sve_int_un_pred_arit_0<0b00, opc, asm, ZPR8>;
+ def _H : sve_int_un_pred_arit_0<0b01, opc, asm, ZPR16>;
+ def _S : sve_int_un_pred_arit_0<0b10, opc, asm, ZPR32>;
+ def _D : sve_int_un_pred_arit_0<0b11, opc, asm, ZPR64>;
+}
+
+multiclass sve_int_un_pred_arit_0_h<bits<3> opc, string asm> {
+ def _H : sve_int_un_pred_arit_0<0b01, opc, asm, ZPR16>;
+ def _S : sve_int_un_pred_arit_0<0b10, opc, asm, ZPR32>;
+ def _D : sve_int_un_pred_arit_0<0b11, opc, asm, ZPR64>;
+}
+
+multiclass sve_int_un_pred_arit_0_w<bits<3> opc, string asm> {
+ def _S : sve_int_un_pred_arit_0<0b10, opc, asm, ZPR32>;
+ def _D : sve_int_un_pred_arit_0<0b11, opc, asm, ZPR64>;
+}
+
+multiclass sve_int_un_pred_arit_0_d<bits<3> opc, string asm> {
+ def _D : sve_int_un_pred_arit_0<0b11, opc, asm, ZPR64>;
+}
+
+
+//===----------------------------------------------------------------------===//
// SVE Integer Wide Immediate - Unpredicated Group
//===----------------------------------------------------------------------===//
class sve_int_dup_imm<bits<2> sz8_64, string asm,
OpenPOWER on IntegriCloud