From patchwork Sun Jul 2 16:32:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 9821717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5856C603B5 for ; Sun, 2 Jul 2017 16:34:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A1DA27D4A for ; Sun, 2 Jul 2017 16:34:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ECBB280DE; Sun, 2 Jul 2017 16:34:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5705127FB7 for ; Sun, 2 Jul 2017 16:34:00 +0000 (UTC) Received: from localhost ([::1]:58598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRhos-0007mV-3F for patchwork-qemu-devel@patchwork.kernel.org; Sun, 02 Jul 2017 12:33:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRhnU-0007mD-1k for qemu-devel@nongnu.org; Sun, 02 Jul 2017 12:32:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRhnT-0006kM-6r for qemu-devel@nongnu.org; Sun, 02 Jul 2017 12:32:32 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:40220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dRhnT-0006hn-0X for qemu-devel@nongnu.org; Sun, 02 Jul 2017 12:32:31 -0400 Received: from [2001:bc8:30d7:120:9bb5:8936:7e6a:9e36] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dRhnP-0003E5-Pn; Sun, 02 Jul 2017 18:32:27 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.89) (envelope-from ) id 1dRhnN-000275-DM; Sun, 02 Jul 2017 18:32:25 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sun, 2 Jul 2017 18:32:20 +0200 Message-Id: <20170702163220.8039-3-aurelien@aurel32.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170702163220.8039-1-aurelien@aurel32.net> References: <20170702163220.8039-1-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH 2/2] target/sh4: do not use a helper to implement fneg X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bruno Haible , Aurelien Jarno Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There is no need to use a helper to flip one bit, just use a TCG xor instruction instead. Signed-off-by: Aurelien Jarno --- target/sh4/helper.h | 1 - target/sh4/op_helper.c | 5 ----- target/sh4/translate.c | 5 ++--- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/sh4/helper.h b/target/sh4/helper.h index f715224822..d2398922dd 100644 --- a/target/sh4/helper.h +++ b/target/sh4/helper.h @@ -32,7 +32,6 @@ DEF_HELPER_FLAGS_2(float_DT, TCG_CALL_NO_WG, f64, env, i32) DEF_HELPER_FLAGS_4(fmac_FT, TCG_CALL_NO_WG, f32, env, f32, f32, f32) DEF_HELPER_FLAGS_3(fmul_FT, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fmul_DT, TCG_CALL_NO_WG, f64, env, f64, f64) -DEF_HELPER_FLAGS_1(fneg_T, TCG_CALL_NO_RWG_SE, f32, f32) DEF_HELPER_FLAGS_3(fsub_FT, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fsub_DT, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_2(fsqrt_FT, TCG_CALL_NO_WG, f32, env, f32) diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index 5e3a3ba68c..d561141301 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -396,11 +396,6 @@ float64 helper_fmul_DT(CPUSH4State *env, float64 t0, float64 t1) return t0; } -float32 helper_fneg_T(float32 t0) -{ - return float32_chs(t0); -} - float32 helper_fsqrt_FT(CPUSH4State *env, float32 t0) { set_float_exception_flags(0, &env->fp_status); diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 7c40945908..8098228c51 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1691,9 +1691,8 @@ static void _decode_opc(DisasContext * ctx) return; case 0xf04d: /* fneg FRn/DRn - FPSCR: Nothing */ CHECK_FPU_ENABLED - { - gen_helper_fneg_T(cpu_fregs[FREG(B11_8)], cpu_fregs[FREG(B11_8)]); - } + tcg_gen_xori_i32(cpu_fregs[FREG(B11_8)], cpu_fregs[FREG(B11_8)], + 0x80000000); return; case 0xf05d: /* fabs FRn/DRn - FPCSR: Nothing */ CHECK_FPU_ENABLED