From patchwork Wed Jul 13 02:44:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 104664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 53AFEB6F62 for ; Thu, 14 Jul 2011 20:46:48 +1000 (EST) Received: from localhost ([::1]:51773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhJRM-0000Yl-CZ for incoming@patchwork.ozlabs.org; Thu, 14 Jul 2011 06:46:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:43467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhIdw-0004of-06 for qemu-devel@nongnu.org; Thu, 14 Jul 2011 05:55:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhIdr-00055z-1h for qemu-devel@nongnu.org; Thu, 14 Jul 2011 05:55:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41002 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhIdq-00055c-7S for qemu-devel@nongnu.org; Thu, 14 Jul 2011 05:55:34 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 009AD8EE65 for ; Thu, 14 Jul 2011 11:55:31 +0200 (CEST) From: Alexander Graf To: "qemu-devel@nongnu.org Developers" Date: Wed, 13 Jul 2011 04:44:08 +0200 Message-Id: <1310525052-22530-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1310525052-22530-1-git-send-email-agraf@suse.de> References: <1310525052-22530-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Subject: [Qemu-devel] [PATCH 1/5] s390x: add ldeb instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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(+), 0 deletions(-) diff --git a/target-s390x/helpers.h b/target-s390x/helpers.h index 6ca48eb..01c8d0e 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 cd33f99..1db6f5e 100644 --- a/target-s390x/op_helper.c +++ b/target-s390x/op_helper.c @@ -1630,6 +1630,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) +{ + u32 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 77fb448..7ec98e2 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);