[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/15] target/ppc: Implement prefixed integer load instruction
From: |
Luis Pires |
Subject: |
[PATCH v2 12/15] target/ppc: Implement prefixed integer load instructions |
Date: |
Tue, 27 Apr 2021 14:16:46 -0300 |
From: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/ppc/insn64.decode | 15 ++++++
target/ppc/translate/fixedpoint-impl.c.inc | 60 ++++++++++++++++++++++
2 files changed, 75 insertions(+)
diff --git a/target/ppc/insn64.decode b/target/ppc/insn64.decode
index 9bef32a845..2e08d89e62 100644
--- a/target/ppc/insn64.decode
+++ b/target/ppc/insn64.decode
@@ -26,6 +26,21 @@
...... rt:5 ra:5 ................ \
&PLS_D si=%pls_si
+### Fixed-Point Load Instructions
+
+PLBZ 000001 10 0--.-- .................. \
+ 100010 ..... ..... ................ @PLS_D
+PLHZ 000001 10 0--.-- .................. \
+ 101000 ..... ..... ................ @PLS_D
+PLHA 000001 10 0--.-- .................. \
+ 101010 ..... ..... ................ @PLS_D
+PLWZ 000001 10 0--.-- .................. \
+ 100000 ..... ..... ................ @PLS_D
+PLWA 000001 00 0--.-- .................. \
+ 101001 ..... ..... ................ @PLS_D
+PLD 000001 00 0--.-- .................. \
+ 111001 ..... ..... ................ @PLS_D
+
### Fixed-Point Arithmetic Instructions
PADDI 000001 10 0--.-- .................. \
diff --git a/target/ppc/translate/fixedpoint-impl.c.inc
b/target/ppc/translate/fixedpoint-impl.c.inc
index e15e379931..80f849fc4a 100644
--- a/target/ppc/translate/fixedpoint-impl.c.inc
+++ b/target/ppc/translate/fixedpoint-impl.c.inc
@@ -218,6 +218,66 @@ static bool trans_LDUX(DisasContext *ctx, arg_X *a)
return do_ldst_X(ctx, a, true, false, MO_Q);
}
+static bool do_ldst_PLS_D(DisasContext *ctx, arg_PLS_D *a,
+ bool store, MemOp mop)
+{
+ TCGv ea;
+
+ if (!resolve_PLS_D(ctx, a)) {
+ return false;
+ }
+ gen_set_access_type(ctx, ACCESS_INT);
+
+ ea = tcg_temp_new();
+ if (a->ra) {
+ tcg_gen_addi_tl(ea, cpu_gpr[a->ra], a->si);
+ } else {
+ tcg_gen_movi_tl(ea, a->si);
+ }
+ if (NARROW_MODE(ctx)) {
+ tcg_gen_ext32u_tl(ea, ea);
+ }
+ mop ^= ctx->default_tcg_memop_mask;
+ if (store) {
+ tcg_gen_qemu_st_tl(cpu_gpr[a->rt], ea, ctx->mem_idx, mop);
+ } else {
+ tcg_gen_qemu_ld_tl(cpu_gpr[a->rt], ea, ctx->mem_idx, mop);
+ }
+ tcg_temp_free(ea);
+
+ return true;
+}
+
+static bool trans_PLBZ(DisasContext *ctx, arg_PLS_D *a)
+{
+ return do_ldst_PLS_D(ctx, a, false, MO_UB);
+}
+
+static bool trans_PLHZ(DisasContext *ctx, arg_PLS_D *a)
+{
+ return do_ldst_PLS_D(ctx, a, false, MO_UW);
+}
+
+static bool trans_PLHA(DisasContext *ctx, arg_PLS_D *a)
+{
+ return do_ldst_PLS_D(ctx, a, false, MO_SW);
+}
+
+static bool trans_PLWZ(DisasContext *ctx, arg_PLS_D *a)
+{
+ return do_ldst_PLS_D(ctx, a, false, MO_UL);
+}
+
+static bool trans_PLWA(DisasContext *ctx, arg_PLS_D *a)
+{
+ return do_ldst_PLS_D(ctx, a, false, MO_SL);
+}
+
+static bool trans_PLD(DisasContext *ctx, arg_PLS_D *a)
+{
+ return do_ldst_PLS_D(ctx, a, false, MO_Q);
+}
+
static bool trans_ADDI(DisasContext *ctx, arg_D *a)
{
if (a->ra) {
--
2.25.1
- [PATCH v2 06/15] target/ppc: Mark helper_raise_exception* as noreturn, (continued)
- [PATCH v2 06/15] target/ppc: Mark helper_raise_exception* as noreturn, Luis Pires, 2021/04/27
- [PATCH v2 07/15] target/ppc: Use translator_loop_temp_check, Luis Pires, 2021/04/27
- [PATCH v2 08/15] target/ppc: Add infrastructure for prefixed insns, Luis Pires, 2021/04/27
- [PATCH v2 09/15] target/ppc: Move ADDI, ADDIS to decodetree, implement PADDI, Luis Pires, 2021/04/27
- [PATCH v2 10/15] target/ppc: Implement PNOP, Luis Pires, 2021/04/27
- [PATCH v2 11/15] target/ppc: Move D/DS/X-form integer loads to decodetree, Luis Pires, 2021/04/27
- [PATCH v2 12/15] target/ppc: Implement prefixed integer load instructions,
Luis Pires <=
- [PATCH v2 13/15] target/ppc: Move D/DS/X-form integer stores to decodetree, Luis Pires, 2021/04/27
- [PATCH v2 14/15] target/ppc: Implement prefixed integer store instructions, Luis Pires, 2021/04/27
- [PATCH v2 15/15] target/ppc: Check cpu flags for prefixed insn support, Luis Pires, 2021/04/27