From 27b5979d9d5dbc5f2ef21a96481f766bf3959b57 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 14 Jul 2011 11:44:11 +0200 Subject: s390x: add ldeb instruction While running perl, we encountered the ldeb instruction to be used, so we implement it :). Signed-off-by: Alexander Graf --- target-s390x/helpers.h | 1 + target-s390x/op_helper.c | 9 +++++++++ target-s390x/translate.c | 4 ++++ 3 files changed, 14 insertions(+) (limited to 'target-s390x') diff --git a/target-s390x/helpers.h b/target-s390x/helpers.h index 6ca48ebe00..01c8d0ea84 100644 --- a/target-s390x/helpers.h +++ b/target-s390x/helpers.h @@ -102,6 +102,7 @@ DEF_HELPER_3(madb, void, i32, i64, i32) DEF_HELPER_3(maebr, void, i32, i32, i32) DEF_HELPER_3(madbr, void, i32, i32, i32) DEF_HELPER_3(msdbr, void, i32, i32, i32) +DEF_HELPER_2(ldeb, void, i32, i64) DEF_HELPER_2(lxdb, void, i32, i64) DEF_HELPER_FLAGS_2(tceb, TCG_CALL_PURE, i32, i32, i64) DEF_HELPER_FLAGS_2(tcdb, TCG_CALL_PURE, i32, i32, i64) diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c index cd57678150..e5941187ae 100644 --- a/target-s390x/op_helper.c +++ b/target-s390x/op_helper.c @@ -1631,6 +1631,15 @@ void HELPER(maebr)(uint32_t f1, uint32_t f3, uint32_t f2) &env->fpu_status); } +/* convert 32-bit float to 64-bit float */ +void HELPER(ldeb)(uint32_t f1, uint64_t a2) +{ + uint32_t v2; + v2 = ldl(a2); + env->fregs[f1].d = float32_to_float64(v2, + &env->fpu_status); +} + /* convert 64-bit float to 128-bit float */ void HELPER(lxdb)(uint32_t f1, uint64_t a2) { diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 6a22fded57..ee15672185 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -2214,6 +2214,10 @@ static void disas_ed(DisasContext *s, int op, int r1, int x2, int b2, int d2, addr = get_address(s, x2, b2, d2); tmp_r1 = tcg_const_i32(r1); switch (op) { + case 0x4: /* LDEB R1,D2(X2,B2) [RXE] */ + potential_page_fault(s); + gen_helper_ldeb(tmp_r1, addr); + break; case 0x5: /* LXDB R1,D2(X2,B2) [RXE] */ potential_page_fault(s); gen_helper_lxdb(tmp_r1, addr); -- cgit v1.2.3-55-g7522