From patchwork Thu Mar 9 20:05:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 661091 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp500358wrb; Thu, 9 Mar 2023 12:16:27 -0800 (PST) X-Google-Smtp-Source: AK7set/NXsHD40eWlplPKh6eEIQQTq7NQm6tG6jCGU4GZkduNl4cJ8D+gWEKWb71X6rO3AM6kkf7 X-Received: by 2002:a5d:4acf:0:b0:2c9:618e:d374 with SMTP id y15-20020a5d4acf000000b002c9618ed374mr15884646wrs.32.1678392986981; Thu, 09 Mar 2023 12:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678392986; cv=none; d=google.com; s=arc-20160816; b=ZY3Zjz/vOKCpQvHuiuJNnCEbI7whRCCpcGye1aF7UDzLjGLWCHcdbeP75nRbGkx0L2 sTEPjstZE79DK9t7hjuVBtZvkib+JwZOLSF8S71+b5OWy6B7IklfnF10Urxwe/XJAyfO 0g9L+oKpppU7lqw8AuASOL40FCxjeAKTz+xmjySHjXUbPT1d2JtPyxjk9hTeFSNoASxU EwDjohwls+IliNfDf/vGRxxScrAX+/wiS1Z4AjhdXhOT9SB4s/xx3Cqf8WlSvpLuxwDS BTzONbkjTansuGeT1WWe7imxYkTa2uGfovWGWTxTK0psc0Udi1vgKRs/mH5JBT8uAbTI y0Lw== 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=kyDPUGSbuCwhL3x+7jqoeSc7RPJbuWrbniQSOOD4ez4=; b=DZX5TP+vtjmiH9E1u92KjFCm5G1eJwtTk91DZqWdkg7zHVX8gwQWbIZRJhd1CXWJss neGeOopCIU1lHD8rCYiNIyCZf/qulaTFJP88vvxDZ7AedYQKI5eSwSGI86xo94Spy7vF b7XqV6C8gWhRI4bMSlFcXc0WvbLPFKKbIU97eLfJcexwEH+u13sRtjoSFprOYBBNS2vo V/sqwtguPnurBwROAqhkdELGVImwX28Vn+Q/oexUh9+i9m9LZPG8N9QQIyIJre/B78Va l9y+aGIos5CiSm8mggYr+BlSKMF2GgdNiUb9E1Fis2Uoa3VceovyPDjtJ8HprOngsAjJ TRdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q7gh12tF; 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 t18-20020a5d5352000000b002c58f199a4dsi278218wrv.852.2023.03.09.12.16.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Mar 2023 12:16:26 -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=q7gh12tF; 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 1paMaB-00045T-Cn; Thu, 09 Mar 2023 15:09:47 -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 1paMa9-00042H-5C for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:09:45 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paMa7-0001ZB-H7 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:09:44 -0500 Received: by mail-pj1-x1034.google.com with SMTP id p3-20020a17090ad30300b0023a1cd5065fso3054140pju.0 for ; Thu, 09 Mar 2023 12:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678392582; 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=kyDPUGSbuCwhL3x+7jqoeSc7RPJbuWrbniQSOOD4ez4=; b=q7gh12tFPmWqvM1en0qu+ls7Xge5qJACdMEp+ehrxA+LY6IGZI3hHm/qChg6OOG37F f9OQKiwi8Dm+QsE9aHsYj5yY3pdsW4eXn17Kf56aB+mnNh13voMU6glxQ9TcOTv8O++W rxD4oMPLodJS2a4ZaT3gV4eES3vKWvZue2SzM8KMjjQo2Iqg0Hfm+9lsdTKrZF/0ONEb pdglCV7cXPnZaXWJyv+Wa2LM+odbgfDCqLIWHkets5q3KpKFoWC7CJOokKrUQV+qr7sR +iTsur7CundEaWuVPSLqzg6cPs+l0QTNXpqBO5b1bKNr4ifDamWxLkre6zlGwSN6HFzb 6jHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678392582; 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=kyDPUGSbuCwhL3x+7jqoeSc7RPJbuWrbniQSOOD4ez4=; b=3l1a0wmqpVjSO5Eb11cldLAeM0pF6u3aArgfkyTZ1RnmLw+8Ly7Fw2LiNwdhqRACtz +DsbgaMSqt8DFcl3AW/ezGXsdtTlcM5uXaI8VRpDnVBgI+KJvyWK4IEM2ms6JIn9hDhD clexkv1sTXrs0d7SuFlokEY7Aa5DX2Lzym9tqW265dHseu3cxUQHt280RXWexpYQASPZ EDkRXSx+R5JeWxSawfepkFdcTaipaFScrxejFM8RXTDuneG5YuMIpI000T6lr9D7Ey6j QPpDkamYGlUGmgMpfID1NpVnComhxiENxS70QUUtReGMPuTSgiK2BFyqwP9uYvibPd/J EQXQ== X-Gm-Message-State: AO0yUKWVMdLHwORG3N8eplUU3l0bsVA6l8CECxo8FCtZ9QZ92/7TsqtY nTsPga3ueFJrRYJ7wcABu8YKXB853V1ULTyTnWs= X-Received: by 2002:a17:902:d2d0:b0:19a:a520:b203 with SMTP id n16-20020a170902d2d000b0019aa520b203mr29840161plc.25.1678392582027; Thu, 09 Mar 2023 12:09:42 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:bf7f:79a0:a976:bdaf]) by smtp.gmail.com with ESMTPSA id c2-20020a170902aa4200b001991e4e0bdcsm43797plr.233.2023.03.09.12.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 12:09:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 56/91] target/rx: Avoid tcg_const_i32 when new temp needed Date: Thu, 9 Mar 2023 12:05:15 -0800 Message-Id: <20230309200550.3878088-57-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::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 These three cases use a constant as first input, and then overwrite the temp in the output. Separate them. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/rx/translate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index c47aa26893..6b218d5d5e 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -1313,10 +1313,10 @@ static bool trans_SHLL_rr(DisasContext *ctx, arg_SHLL_rr *a) done = gen_new_label(); /* if (cpu_regs[a->rs]) { */ tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_regs[a->rs], 0, noshift); - count = tcg_const_i32(32); + count = tcg_temp_new(); tmp = tcg_temp_new(); tcg_gen_andi_i32(tmp, cpu_regs[a->rs], 31); - tcg_gen_sub_i32(count, count, tmp); + tcg_gen_sub_i32(count, tcg_constant_i32(32), tmp); tcg_gen_sar_i32(cpu_psw_c, cpu_regs[a->rd], count); tcg_gen_shl_i32(cpu_regs[a->rd], cpu_regs[a->rd], tmp); tcg_gen_setcondi_i32(TCG_COND_EQ, cpu_psw_o, cpu_psw_c, 0); @@ -1979,10 +1979,10 @@ static inline void rx_bnotr(TCGv reg, TCGv mask) cat3(arg_, name, _rr) * a) \ { \ TCGv mask, b; \ - mask = tcg_const_i32(1); \ + mask = tcg_temp_new(); \ b = tcg_temp_new(); \ tcg_gen_andi_i32(b, cpu_regs[a->rs], 31); \ - tcg_gen_shl_i32(mask, mask, b); \ + tcg_gen_shl_i32(mask, tcg_constant_i32(1), b); \ cat3(rx_, op, r)(cpu_regs[a->rd], mask); \ return true; \ } \ @@ -1990,10 +1990,10 @@ static inline void rx_bnotr(TCGv reg, TCGv mask) cat3(arg_, name, _rm) * a) \ { \ TCGv mask, mem, addr, b; \ - mask = tcg_const_i32(1); \ + mask = tcg_temp_new(); \ b = tcg_temp_new(); \ tcg_gen_andi_i32(b, cpu_regs[a->rd], 7); \ - tcg_gen_shl_i32(mask, mask, b); \ + tcg_gen_shl_i32(mask, tcg_constant_i32(1), b); \ mem = tcg_temp_new(); \ addr = rx_index_addr(ctx, mem, a->ld, MO_8, a->rs); \ cat3(rx_, op, m)(addr, mask); \