aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-07-07 23:16:42 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-07-07 23:16:42 +0100
commit59dc0a1e9b4ccd9d8d7366fdc31acd5c1fbb240a (patch)
tree2dbacde38366caca953b290a8fb11bcb3c09bc4c
parent7ce0f7dc87e50ebf58ac756ff6be17ec97d3ba4e (diff)
parentcd3b29b745b0ff393b2d37317837bc726b8dacc8 (diff)
Merge remote-tracking branch 'remotes/agraf/tags/signed-s390-for-upstream' into staging
Patch queue for s390 - 2015-07-07 A few last minute fixes for 2.4. All of them are s390 TCG bug fixes. # gpg: Signature made Tue Jul 7 16:52:22 2015 BST using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-s390-for-upstream: tcg/s390: fix branch target change during code retranslation target-s390x: fix CONVERT TO BINARY (CVD, CVDY) target-s390x: fix EXECUTE instruction executing TRT target-s390x: fix MOVE LONG instruction Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target-s390x/int_helper.c9
-rw-r--r--target-s390x/mem_helper.c3
-rw-r--r--tcg/s390/tcg-target.c12
3 files changed, 14 insertions, 10 deletions
diff --git a/target-s390x/int_helper.c b/target-s390x/int_helper.c
index 2c2b3f622c..a46c736d67 100644
--- a/target-s390x/int_helper.c
+++ b/target-s390x/int_helper.c
@@ -121,11 +121,12 @@ uint64_t HELPER(clz)(uint64_t v)
return clz64(v);
}
-uint64_t HELPER(cvd)(int32_t bin)
+uint64_t HELPER(cvd)(int32_t reg)
{
/* positive 0 */
uint64_t dec = 0x0c;
- int shift = 4;
+ int64_t bin = reg;
+ int shift;
if (bin < 0) {
bin = -bin;
@@ -133,9 +134,7 @@ uint64_t HELPER(cvd)(int32_t bin)
}
for (shift = 4; (shift < 64) && bin; shift += 4) {
- int current_number = bin % 10;
-
- dec |= (current_number) << shift;
+ dec |= (bin % 10) << shift;
bin /= 10;
}
diff --git a/target-s390x/mem_helper.c b/target-s390x/mem_helper.c
index 3ccbeb99e4..6f8bd796ad 100644
--- a/target-s390x/mem_helper.c
+++ b/target-s390x/mem_helper.c
@@ -482,6 +482,7 @@ uint32_t HELPER(ex)(CPUS390XState *env, uint32_t cc, uint64_t v1,
case 0xc00:
helper_tr(env, l, get_address(env, 0, b1, d1),
get_address(env, 0, b2, d2));
+ break;
case 0xd00:
cc = helper_trt(env, l, get_address(env, 0, b1, d1),
get_address(env, 0, b2, d2));
@@ -550,7 +551,7 @@ uint32_t HELPER(mvcl)(CPUS390XState *env, uint32_t r1, uint32_t r2)
uint64_t dest = get_address_31fix(env, r1);
uint64_t srclen = env->regs[r2 + 1] & 0xffffff;
uint64_t src = get_address_31fix(env, r2);
- uint8_t pad = src >> 24;
+ uint8_t pad = env->regs[r2 + 1] >> 24;
uint8_t v;
uint32_t cc;
diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index 669fafe24f..921991ebfa 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -1643,8 +1643,10 @@ static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 1);
- label_ptr = s->code_ptr + 1;
- tcg_out_insn(s, RI, BRC, S390_CC_NE, 0);
+ /* We need to keep the offset unchanged for retranslation. */
+ tcg_out16(s, RI_BRC | (S390_CC_NE << 4));
+ label_ptr = s->code_ptr;
+ s->code_ptr += 1;
tcg_out_qemu_ld_direct(s, opc, data_reg, base_reg, TCG_REG_R2, 0);
@@ -1669,8 +1671,10 @@ static void tcg_out_qemu_st(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 0);
- label_ptr = s->code_ptr + 1;
- tcg_out_insn(s, RI, BRC, S390_CC_NE, 0);
+ /* We need to keep the offset unchanged for retranslation. */
+ tcg_out16(s, RI_BRC | (S390_CC_NE << 4));
+ label_ptr = s->code_ptr;
+ s->code_ptr += 1;
tcg_out_qemu_st_direct(s, opc, data_reg, base_reg, TCG_REG_R2, 0);