From patchwork Thu Mar 9 20:05:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 661129 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp504108wrb; Thu, 9 Mar 2023 12:25:36 -0800 (PST) X-Google-Smtp-Source: AK7set/9MBlYQ0HZvY723B11/vAx/dMfQdDuDPGXfsUYotyh8WpmQu2FIt+V6570lvjNHu3eohyc X-Received: by 2002:a05:6214:d66:b0:56e:a88f:70ef with SMTP id 6-20020a0562140d6600b0056ea88f70efmr44928026qvs.23.1678393536394; Thu, 09 Mar 2023 12:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678393536; cv=none; d=google.com; s=arc-20160816; b=wxMpaCQbnMaQr4v623VYb4M26E7zUutvvh9Wz6dd9PZ9VgYwd0rQSp9VcR+IWKPNQ3 Q8XGyK3g9zFwjbVqlOkbtw824iNqdiJe/GmJ5qsjHoi0V/Os73SjUlbctJ/kGE7L72kK nzG/4AWsyaEMVcNO2VVrTRPvsn3vMjloP11YyOYRWqqfax+4NvH3EpOYvEpSTq+uvLDB sa+Yji50ssVnnS5gpzwEy/vNwdRDPfRUG5ku1ToMNa9q8k0N80jHPw2sISXWfG+7O9ko reo7xSdwr4TpPGDR1NR28F3tX2DbOIUxEG3g4d3geO+FrOBt9PSKkuJLr2R+ALma+ans Uixg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qZKMbGBHLUIPIIhsEHnttx2TLeNVjws2XpIpxHi8cLQ=; b=sWi2wpNC3DYjwc7IVSA6no/exvMwzwYR0eSiwB+HOvQDlPR8mWUpet1Z05D4W6K301 e2kRPuVzR2VnPTGi96kt+peRHdF5az5aYjydYjOIxXfSmUsKnR/bvMBl349Mgggr/b2w ZiPFmiCuQ6eptoxlndAozsZWmf3YPBG8tRAlQYkTAAGnRU5N68OJYeTg5qgLNKh+zWfu /5vfIsaN/I8dNlNXm3ng8gpbGHeXvIQmvjIvcrB5LoCcrvvP1yKIDBL/f9ifYG4Qt8yt eH16tS8zfdny2rZ6WkiAWBS+kY4QNUAIrXMvzDVvXrZenr4qt3ft8YMyzp1+8T2JnvA2 SRtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJGsWGY8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y15-20020a37640f000000b0073b6466beb7si14310508qkb.482.2023.03.09.12.25.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Mar 2023 12:25:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJGsWGY8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paMkW-0003Dt-OD; Thu, 09 Mar 2023 15:20:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paMkU-00035V-EA for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:20:26 -0500 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paMkS-0003XC-R5 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:20:26 -0500 Received: by mail-il1-x132.google.com with SMTP id l2so1712997ilg.7 for ; Thu, 09 Mar 2023 12:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678393223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qZKMbGBHLUIPIIhsEHnttx2TLeNVjws2XpIpxHi8cLQ=; b=rJGsWGY8+5HFVaxSKdmpp3IXGc6XpQiS9Yj0IT1auU0BGS+KaLV/2wvEZ3SNaFOZ2e tkbcFeCijq3ix7Msldwvb9AULL/f8sc4gJ517trq4UItpbmSwoAC+tIyU/eG+HXOm2KG KWLVSfDLfAl8ddAnfaGY4z18ZmsSbdeHAT9GMsOxIMsA/qvMm5/SxJG/zfZKAB7GJwTh 7eRXzCkriEf5/RAu1HqmAHn9U7xueUDDBOjLf7qRChnWj/8y+PUNiOYa+UU2L/twMNaN BVVIP7WNtG0cMdxL23KlCKFEyMJkxmzDvYf350C6IaUNgZpj1Gtjbj42iZRkD2N++I+G /d0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678393223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qZKMbGBHLUIPIIhsEHnttx2TLeNVjws2XpIpxHi8cLQ=; b=3y+uGrXF4/1XKnqFZKW7+rm94vD6NQusueXXwivFsvObxtvs0lJ/txaAxliANNvMbL mTkWPQBIiuxNsLHnFT6+xq/RNvPnjExKLGJFbOKH516IubIVehoXKcKq0Lulpk0zaDnH ugxsTYzqEJBX9QVM58O7HICha5Na2Pv0ZM3Fa70zW06KDiupy1XQ460GcG7kwbwoh2RP jndssFlxJUYTm0a4uyM7bcVlJUi3m6bRYkhZ55AK0PF0sD/mUPtrH1UFTwoZ61JoAsr/ nKAkduh/ZLHqg/ELmt4509kL0gzrkjYd0Bw03OOBZidR9aZKhs1/4Orq/aG3Vf3K5t+9 FWhg== X-Gm-Message-State: AO0yUKVUKy9U78jEdADNxoiycmn+trWEZRjgtvdnIxIEcXlHJW/aHIwH 3tIaBl5ZSi+O0o1nuikE8lhPA9pyae0GDCEu7kw= X-Received: by 2002:a62:4ecb:0:b0:593:f191:966 with SMTP id c194-20020a624ecb000000b00593f1910966mr17981199pfb.1.1678392788436; Thu, 09 Mar 2023 12:13:08 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:bf7f:79a0:a976:bdaf]) by smtp.gmail.com with ESMTPSA id v15-20020a62a50f000000b005b02ddd852dsm11867744pfm.142.2023.03.09.12.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 12:13:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PULL v2 84/91] target/ppc: Avoid tcg_const_* in fp-impl.c.inc Date: Thu, 9 Mar 2023 12:05:43 -0800 Message-Id: <20230309200550.3878088-85-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309200550.3878088-1-richard.henderson@linaro.org> References: <20230309200550.3878088-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::132; envelope-from=richard.henderson@linaro.org; helo=mail-il1-x132.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All uses are strictly read-only. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/ppc/translate/fp-impl.c.inc | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/fp-impl.c.inc b/target/ppc/translate/fp-impl.c.inc index d5d88e7d49..57d8437851 100644 --- a/target/ppc/translate/fp-impl.c.inc +++ b/target/ppc/translate/fp-impl.c.inc @@ -348,7 +348,7 @@ static void gen_fcmpo(DisasContext *ctx) t0 = tcg_temp_new_i64(); t1 = tcg_temp_new_i64(); gen_reset_fpstatus(); - crf = tcg_const_i32(crfD(ctx->opcode)); + crf = tcg_constant_i32(crfD(ctx->opcode)); get_fpr(t0, rA(ctx->opcode)); get_fpr(t1, rB(ctx->opcode)); gen_helper_fcmpo(cpu_env, t0, t1, crf); @@ -368,7 +368,7 @@ static void gen_fcmpu(DisasContext *ctx) t0 = tcg_temp_new_i64(); t1 = tcg_temp_new_i64(); gen_reset_fpstatus(); - crf = tcg_const_i32(crfD(ctx->opcode)); + crf = tcg_constant_i32(crfD(ctx->opcode)); get_fpr(t0, rA(ctx->opcode)); get_fpr(t1, rB(ctx->opcode)); gen_helper_fcmpu(cpu_env, t0, t1, crf); @@ -541,7 +541,7 @@ static void gen_mcrfs(DisasContext *ctx) tcg_gen_andi_i64(tnew_fpscr, tnew_fpscr, ~((0xF << shift) & FP_EX_CLEAR_BITS)); /* FEX and VX need to be updated, so don't set fpscr directly */ - tmask = tcg_const_i32(1 << nibble); + tmask = tcg_constant_i32(1 << nibble); gen_helper_store_fpscr(cpu_env, tnew_fpscr, tmask); } @@ -681,9 +681,7 @@ static void gen_mtfsb0(DisasContext *ctx) crb = 31 - crbD(ctx->opcode); gen_reset_fpstatus(); if (likely(crb != FPSCR_FEX && crb != FPSCR_VX)) { - TCGv_i32 t0; - t0 = tcg_const_i32(crb); - gen_helper_fpscr_clrbit(cpu_env, t0); + gen_helper_fpscr_clrbit(cpu_env, tcg_constant_i32(crb)); } if (unlikely(Rc(ctx->opcode) != 0)) { tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr); @@ -703,9 +701,7 @@ static void gen_mtfsb1(DisasContext *ctx) crb = 31 - crbD(ctx->opcode); /* XXX: we pretend we can only do IEEE floating-point computations */ if (likely(crb != FPSCR_FEX && crb != FPSCR_VX && crb != FPSCR_NI)) { - TCGv_i32 t0; - t0 = tcg_const_i32(crb); - gen_helper_fpscr_setbit(cpu_env, t0); + gen_helper_fpscr_setbit(cpu_env, tcg_constant_i32(crb)); } if (unlikely(Rc(ctx->opcode) != 0)) { tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr); @@ -733,10 +729,12 @@ static void gen_mtfsf(DisasContext *ctx) gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL); return; } - if (l) { - t0 = tcg_const_i32((ctx->insns_flags2 & PPC2_ISA205) ? 0xffff : 0xff); + if (!l) { + t0 = tcg_constant_i32(flm << (w * 8)); + } else if (ctx->insns_flags2 & PPC2_ISA205) { + t0 = tcg_constant_i32(0xffff); } else { - t0 = tcg_const_i32(flm << (w * 8)); + t0 = tcg_constant_i32(0xff); } t1 = tcg_temp_new_i64(); get_fpr(t1, rB(ctx->opcode)); @@ -767,8 +765,8 @@ static void gen_mtfsfi(DisasContext *ctx) return; } sh = (8 * w) + 7 - bf; - t0 = tcg_const_i64(((uint64_t)FPIMM(ctx->opcode)) << (4 * sh)); - t1 = tcg_const_i32(1 << sh); + t0 = tcg_constant_i64(((uint64_t)FPIMM(ctx->opcode)) << (4 * sh)); + t1 = tcg_constant_i32(1 << sh); gen_helper_store_fpscr(cpu_env, t0, t1); if (unlikely(Rc(ctx->opcode) != 0)) { tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr);