From patchwork Mon Nov 3 20:01:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Musta X-Patchwork-Id: 406348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 108EE1400A0 for ; Tue, 4 Nov 2014 07:05:07 +1100 (AEDT) Received: from localhost ([::1]:37114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNs9-00029C-36 for incoming@patchwork.ozlabs.org; Mon, 03 Nov 2014 15:05:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNpS-0005gW-5i for qemu-devel@nongnu.org; Mon, 03 Nov 2014 15:02:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlNpJ-00027a-0U for qemu-devel@nongnu.org; Mon, 03 Nov 2014 15:02:18 -0500 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:46777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlNpI-00027M-Qb; Mon, 03 Nov 2014 15:02:08 -0500 Received: by mail-ig0-f177.google.com with SMTP id hl2so5292064igb.10 for ; Mon, 03 Nov 2014 12:02:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=F1h7ddV5NdvvmZ1ZgIEoPmoV/DSWj474SnkNIf0nTP0=; b=IJo1IdpO6opIgc9+wBwnmojEKpzZAdnubMv8VbWK+JioueKQGhvRF7MzIdj98vGwIW FU4bl6cx8YJTXBmla2F36Jt6yJaNnar1Eah9W3nbcbwbLeO+b2/MV3Mz7lfwGYEs9fwg xisPOh3xUsT5xJjuLApBvlGQ2SxY2aH9sls++dw/i2AMKJTRbAwY+JDDGzXvc910RPGV GmLaSqKpaTgGxr1E83jB/EtegjHbHw5IODOaPk9+K2hPWDVgcZnfPRXjCx+v2LTrApZ9 dK3s/HdfOOZcalEb5U7bVZNsIEaxSD7fGxeV42sA996GAa2doNyAPjiSk2B5TtXy3SmO bxHw== X-Received: by 10.50.23.80 with SMTP id k16mr18769446igf.26.1415044928255; Mon, 03 Nov 2014 12:02:08 -0800 (PST) Received: from tmusta-sc.rchland.ibm.com (rchp4.rochester.ibm.com. [129.42.161.36]) by mx.google.com with ESMTPSA id u65sm6165090ioe.14.2014.11.03.12.02.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 12:02:07 -0800 (PST) From: Tom Musta To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Mon, 3 Nov 2014 14:01:16 -0600 Message-Id: <1415044877-17300-7-git-send-email-tommusta@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1415044877-17300-1-git-send-email-tommusta@gmail.com> References: <1415044877-17300-1-git-send-email-tommusta@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::231 Cc: pbonzini@redhat.com, agraf@suse.de, Tom Musta Subject: [Qemu-devel] [PATCH 6/7] target-ppc: Eliminate set_fprf Argument From gen_compute_fprf 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 The set_fprf argument to the gen_compute_fprf() utility is no longer needed -- gen_compute_fprf() is now called only when FPRF is actually computed and set. Eliminate the obsolete argument. Signed-off-by: Tom Musta --- target-ppc/translate.c | 38 +++++++++++++++++++++++--------------- 1 files changed, 23 insertions(+), 15 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index d719cdf..c039494 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -257,16 +257,14 @@ static inline void gen_set_cr1_from_fpscr(void) tcg_temp_free_i32(t0); } -static inline void gen_compute_fprf(TCGv_i64 arg, int set_fprf) +static inline void gen_compute_fprf(TCGv_i64 arg) { TCGv_i32 t0 = tcg_temp_new_i32(); - if (set_fprf != 0) { - /* This case might be optimized later */ - tcg_gen_movi_i32(t0, 1); - gen_helper_compute_fprf(t0, cpu_env, arg, t0); - gen_helper_float_check_status(cpu_env); - } + /* This case might be optimized later */ + tcg_gen_movi_i32(t0, 1); + gen_helper_compute_fprf(t0, cpu_env, arg, t0); + gen_helper_float_check_status(cpu_env); tcg_temp_free_i32(t0); } @@ -2108,7 +2106,9 @@ static void gen_f##name(DisasContext *ctx) \ gen_helper_frsp(cpu_fpr[rD(ctx->opcode)], cpu_env, \ cpu_fpr[rD(ctx->opcode)]); \ } \ - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], set_fprf); \ + if (set_fprf) { \ + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); \ + } \ if (unlikely(Rc(ctx->opcode) != 0)) { \ gen_set_cr1_from_fpscr(); \ } \ @@ -2135,7 +2135,9 @@ static void gen_f##name(DisasContext *ctx) \ gen_helper_frsp(cpu_fpr[rD(ctx->opcode)], cpu_env, \ cpu_fpr[rD(ctx->opcode)]); \ } \ - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], set_fprf); \ + if (set_fprf) { \ + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); \ + } \ if (unlikely(Rc(ctx->opcode) != 0)) { \ gen_set_cr1_from_fpscr(); \ } \ @@ -2161,7 +2163,9 @@ static void gen_f##name(DisasContext *ctx) \ gen_helper_frsp(cpu_fpr[rD(ctx->opcode)], cpu_env, \ cpu_fpr[rD(ctx->opcode)]); \ } \ - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], set_fprf); \ + if (set_fprf) { \ + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); \ + } \ if (unlikely(Rc(ctx->opcode) != 0)) { \ gen_set_cr1_from_fpscr(); \ } \ @@ -2182,7 +2186,9 @@ static void gen_f##name(DisasContext *ctx) \ gen_reset_fpstatus(); \ gen_helper_f##name(cpu_fpr[rD(ctx->opcode)], cpu_env, \ cpu_fpr[rB(ctx->opcode)]); \ - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], set_fprf); \ + if (set_fprf) { \ + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); \ + } \ if (unlikely(Rc(ctx->opcode) != 0)) { \ gen_set_cr1_from_fpscr(); \ } \ @@ -2200,7 +2206,9 @@ static void gen_f##name(DisasContext *ctx) \ gen_reset_fpstatus(); \ gen_helper_f##name(cpu_fpr[rD(ctx->opcode)], cpu_env, \ cpu_fpr[rB(ctx->opcode)]); \ - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], set_fprf); \ + if (set_fprf) { \ + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); \ + } \ if (unlikely(Rc(ctx->opcode) != 0)) { \ gen_set_cr1_from_fpscr(); \ } \ @@ -2236,7 +2244,7 @@ static void gen_frsqrtes(DisasContext *ctx) cpu_fpr[rB(ctx->opcode)]); gen_helper_frsp(cpu_fpr[rD(ctx->opcode)], cpu_env, cpu_fpr[rD(ctx->opcode)]); - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], 1); + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); if (unlikely(Rc(ctx->opcode) != 0)) { gen_set_cr1_from_fpscr(); } @@ -2260,7 +2268,7 @@ static void gen_fsqrt(DisasContext *ctx) gen_reset_fpstatus(); gen_helper_fsqrt(cpu_fpr[rD(ctx->opcode)], cpu_env, cpu_fpr[rB(ctx->opcode)]); - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], 1); + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); if (unlikely(Rc(ctx->opcode) != 0)) { gen_set_cr1_from_fpscr(); } @@ -2279,7 +2287,7 @@ static void gen_fsqrts(DisasContext *ctx) cpu_fpr[rB(ctx->opcode)]); gen_helper_frsp(cpu_fpr[rD(ctx->opcode)], cpu_env, cpu_fpr[rD(ctx->opcode)]); - gen_compute_fprf(cpu_fpr[rD(ctx->opcode)], 1); + gen_compute_fprf(cpu_fpr[rD(ctx->opcode)]); if (unlikely(Rc(ctx->opcode) != 0)) { gen_set_cr1_from_fpscr(); }