[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 47/70] target/s390x: implement MOVE INVERSE
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL v2 47/70] target/s390x: implement MOVE INVERSE |
Date: |
Tue, 6 Jun 2017 17:30:56 -0700 |
From: Aurelien Jarno <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/s390x/helper.h | 1 +
target/s390x/insn-data.def | 2 ++
target/s390x/mem_helper.c | 12 ++++++++++++
target/s390x/translate.c | 8 ++++++++
4 files changed, 23 insertions(+)
diff --git a/target/s390x/helper.h b/target/s390x/helper.h
index 86e2bc1..4b6c756 100644
--- a/target/s390x/helper.h
+++ b/target/s390x/helper.h
@@ -3,6 +3,7 @@ DEF_HELPER_FLAGS_4(nc, TCG_CALL_NO_WG, i32, env, i32, i64, i64)
DEF_HELPER_FLAGS_4(oc, TCG_CALL_NO_WG, i32, env, i32, i64, i64)
DEF_HELPER_FLAGS_4(xc, TCG_CALL_NO_WG, i32, env, i32, i64, i64)
DEF_HELPER_FLAGS_4(mvc, TCG_CALL_NO_WG, void, env, i32, i64, i64)
+DEF_HELPER_FLAGS_4(mvcin, TCG_CALL_NO_WG, void, env, i32, i64, i64)
DEF_HELPER_FLAGS_4(clc, TCG_CALL_NO_WG, i32, env, i32, i64, i64)
DEF_HELPER_3(mvcl, i32, env, i32, i32)
DEF_HELPER_FLAGS_4(clm, TCG_CALL_NO_WG, i32, env, i32, i32, i64)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index 39fcce5..c1303d6 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -570,6 +570,8 @@
C(0xe548, MVGHI, SIL, GIE, la1, i2, 0, m1_64, mov2, 0)
C(0x9200, MVI, SI, Z, la1, i2, 0, m1_8, mov2, 0)
C(0xeb52, MVIY, SIY, LD, la1, i2, 0, m1_8, mov2, 0)
+/* MOVE INVERSE */
+ C(0xe800, MVCIN, SS_a, Z, la1, a2, 0, 0, mvcin, 0)
/* MOVE LONG */
C(0x0e00, MVCL, RR_a, Z, 0, 0, 0, 0, mvcl, 0)
/* MOVE LONG EXTENDED */
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 850472e..6faaadd 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -231,6 +231,18 @@ void HELPER(mvc)(CPUS390XState *env, uint32_t l, uint64_t
dest, uint64_t src)
do_helper_mvc(env, l, dest, src, GETPC());
}
+/* move inverse */
+void HELPER(mvcin)(CPUS390XState *env, uint32_t l, uint64_t dest, uint64_t src)
+{
+ uintptr_t ra = GETPC();
+ int i;
+
+ for (i = 0; i <= l; i++) {
+ uint8_t v = cpu_ldub_data_ra(env, src - i, ra);
+ cpu_stb_data_ra(env, dest + i, v, ra);
+ }
+}
+
/* compare unsigned byte arrays */
static uint32_t do_helper_clc(CPUS390XState *env, uint32_t l, uint64_t s1,
uint64_t s2, uintptr_t ra)
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 0a35eed..a9b96e7 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -2938,6 +2938,14 @@ static ExitStatus op_mvc(DisasContext *s, DisasOps *o)
return NO_EXIT;
}
+static ExitStatus op_mvcin(DisasContext *s, DisasOps *o)
+{
+ TCGv_i32 l = tcg_const_i32(get_field(s->fields, l1));
+ gen_helper_mvcin(cpu_env, l, o->addr1, o->in2);
+ tcg_temp_free_i32(l);
+ return NO_EXIT;
+}
+
static ExitStatus op_mvcl(DisasContext *s, DisasOps *o)
{
TCGv_i32 r1 = tcg_const_i32(get_field(s->fields, r1));
--
2.9.4
- [Qemu-devel] [PULL v2 38/70] target/s390x: Re-implement a few EXECUTE target insns directly, (continued)
- [Qemu-devel] [PULL v2 38/70] target/s390x: Re-implement a few EXECUTE target insns directly, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 40/70] target/s390x: remove dead code in translate.c, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 41/70] target/s390x: remove some Linux assumptions from IPTE, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 39/70] target/s390x/cpu_models: Allow some additional feature bits for the "qemu" CPU, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 43/70] target/s390x: implement TEST AND SET, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 42/70] target/s390x: implement local-TLB-clearing in IPTE, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 44/70] target/s390x: implement TEST ADDRESSING MODE, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 45/70] target/s390x: implement PACK, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 46/70] target/s390x: implement COMPARE AND SIGNAL, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 48/70] target/s390x: implement MOVE NUMERICS, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 47/70] target/s390x: implement MOVE INVERSE,
Richard Henderson <=
- [Qemu-devel] [PULL v2 49/70] target/s390x: implement MOVE WITH OFFSET, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 50/70] target/s390x: implement MOVE ZONES, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 51/70] target/s390x: improve 24-bit and 31-bit addresses read, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 54/70] target/s390x: fix COMPARE LOGICAL LONG EXTENDED, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 52/70] target/s390x: improve 24-bit and 31-bit addresses write, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 53/70] target/s390x: improve 24-bit and 31-bit lengths read/write, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 55/70] target/s390x: implement COMPARE LOGICAL LONG, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 56/70] target/s390x: fix adj_len_to_page, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 59/70] target/s390x: implement MOVE LONG UNICODE, Richard Henderson, 2017/06/06
- [Qemu-devel] [PULL v2 58/70] target/s390x: implement COMPARE LOGICAL LONG UNICODE, Richard Henderson, 2017/06/06