From patchwork Tue Mar 7 17:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659778 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2524193wrb; Tue, 7 Mar 2023 10:02:43 -0800 (PST) X-Google-Smtp-Source: AK7set8FdnWftrnWrdj4YSC4UN6B9TPnBhuHfloa5g+k1/Qn704TFaecPwhyccL+YPzyHn2pdko5 X-Received: by 2002:a05:6214:20eb:b0:577:5560:5b6c with SMTP id 11-20020a05621420eb00b0057755605b6cmr26418172qvk.41.1678212163135; Tue, 07 Mar 2023 10:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678212163; cv=none; d=google.com; s=arc-20160816; b=XWQdSrHRuYNn5Tzno1CtceCW8fzMFP782jJPMzH2tpzyqoh8+9aZ3psnRtkFOBvIyC FmIvyiAIOjcDENs96IHi17nf34/DYecoTFIW99QcZv0EsSlViw5kJYcXa7/kWF99W4KD PrrxzTR4zTHfEqPbVXX3v7ueNf9pzarldktfcA30J0FUXwWCJAFBLJkb+qL1NInDQLdb ev8ZZMhcpeImRszhHLWNg0DqdIJcVdqZJOGbs2ekp0Y43JmB2tSyjLVABQLLe7/cgSHt 4uJRxDiyTFsXLswXwwInlvVcUvQK8c0lcRbB5Zndqu0uVI3v2S5JkkXFGWNbg+DUAIlc ie+A== 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=AhVatxhyEldE+yYtq9OhUIXdN3LtIGdHxXg5mFLB9H0=; b=OHHWnk5mOD7Y0HUB1Yn4v3a2g0jORXWRoZEJ5zh6gyy4JXB7qN1GOyS0UX38sya4+N oUaDv30whiEepcKbuwkX+mPuDDEj+4aMawnIGvwd/mNpoTI3Eo70YpSnsl7eZyKo7iV1 3+ilXUBt2WQJIaLwc8NdG2d/cLfrLkCnNa7q1BNef3ECcQLT6Fi4IL6J74YeO1J05shB 7rU5IF5CpAefEo1D7fzdWrjwgRlNgfJ8kk89m84l9S7FPq74yU6Q/DVQTJG+QWUcBtwf gvVZFCSO4MpLewy6flW7O+M1nDZIHJYVY5ebSX//LscClD0SKXhoymxorpLAjNwowWCK jTUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J2w4MD8Y; 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 p12-20020a0c8c8c000000b0056eddf67079si9946092qvb.549.2023.03.07.10.02.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:02:43 -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=J2w4MD8Y; 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 1pZbdw-0001vq-8V; Tue, 07 Mar 2023 13:02:32 -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 1pZbdr-0001C9-RX for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:02:27 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZbdp-00014U-Oz for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:02:27 -0500 Received: by mail-pl1-x635.google.com with SMTP id n6so15026828plf.5 for ; Tue, 07 Mar 2023 10:02:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678212144; 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=AhVatxhyEldE+yYtq9OhUIXdN3LtIGdHxXg5mFLB9H0=; b=J2w4MD8YL00tLftTYN3ML/dGGwwWqDQn+HPW7E7ZbJjj6Qad52MsTySUyl9pKaWtIn xI2lPQZ5Lslww/UG6IWB1PwFIpKQkIUoo1uOkrmYppY9sVx/jl5s24J/Is1mXTDpns0i cr5LIhNtBjuzyWPQvJ09cyqwbDhaXZk42nSZYIn0mzyhyKCD1jFWbXRF/z882BTN6/F8 YKX1IKfdnQ3xbAsoGv0hCx6Y/CvAtijfecuwO7/IqL5V94RzJ25bCpJx2Qo5ynS3lr9e oW2yjn8FzJtJHhwHE7C5nEZzlUICxSDxQrSZa9syztzZqX0+kKCtQM0fgjbRlCwRbiIe u0rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678212144; 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=AhVatxhyEldE+yYtq9OhUIXdN3LtIGdHxXg5mFLB9H0=; b=PHApYud8YLtg1HT8dUH/L03AR1Bgvbjax6Mq2DcVId1if/fP3LPl1c0somYPH7swu8 ruhS5PMBX9g1gIcpFiAaGUdOI+3RFUX80OMdii0/JUE0yVFmbzvnosGS+Xp5dq6aF32e iJfF0VwGCNFpdDI/rsXdiKSYfnAi0n3Qh5NCu5K1zagi+OILpjomFuFt0fk/PffOGLwo hrnQSdnzeCkZqLz7oCZ9z9g0Zn7N4IekAOksPeh2yBawlQ9MtmX/KeY5Fatuj5dBVV6t bYY6LhfX/Z8SwFvnEZNj7ysHhWAzOZRlTLPo+5YkoD2qF76MfovqT9yql+3aS6PlnsZx 9UJQ== X-Gm-Message-State: AO0yUKXcFPtGEe9AtMlbYoDIs9U15CpyFcR0lHs2QFHDg/k03Hl9BK2w 4q2h2qdgm0I6sVLpivmmesSnKvoUBmzbU5XVzPg= X-Received: by 2002:a05:6a20:6922:b0:cd:a334:a52b with SMTP id q34-20020a056a20692200b000cda334a52bmr12571663pzj.30.1678212144222; Tue, 07 Mar 2023 10:02:24 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm8080441pgj.52.2023.03.07.10.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:02:23 -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 43/67] target/hppa: Avoid use of tcg_const_i32 throughout Date: Tue, 7 Mar 2023 09:58:24 -0800 Message-Id: <20230307175848.2508955-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307175848.2508955-1-richard.henderson@linaro.org> References: <20230307175848.2508955-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 were read-write, so replace with a new allocation and initialization. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/translate.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3ea50d0cec..6a3154ebc6 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -135,8 +135,6 @@ #define tcg_gen_extract_reg tcg_gen_extract_i64 #define tcg_gen_sextract_reg tcg_gen_sextract_i64 #define tcg_gen_extract2_reg tcg_gen_extract2_i64 -#define tcg_const_reg tcg_const_i64 -#define tcg_const_local_reg tcg_const_local_i64 #define tcg_constant_reg tcg_constant_i64 #define tcg_gen_movcond_reg tcg_gen_movcond_i64 #define tcg_gen_add2_reg tcg_gen_add2_i64 @@ -228,8 +226,6 @@ #define tcg_gen_extract_reg tcg_gen_extract_i32 #define tcg_gen_sextract_reg tcg_gen_sextract_i32 #define tcg_gen_extract2_reg tcg_gen_extract2_i32 -#define tcg_const_reg tcg_const_i32 -#define tcg_const_local_reg tcg_const_local_i32 #define tcg_constant_reg tcg_constant_i32 #define tcg_gen_movcond_reg tcg_gen_movcond_i32 #define tcg_gen_add2_reg tcg_gen_add2_i32 @@ -574,7 +570,9 @@ static TCGv_i32 load_frw_i32(unsigned rt) static TCGv_i32 load_frw0_i32(unsigned rt) { if (rt == 0) { - return tcg_const_i32(0); + TCGv_i32 ret = tcg_temp_new_i32(); + tcg_gen_movi_i32(ret, 0); + return ret; } else { return load_frw_i32(rt); } @@ -582,15 +580,15 @@ static TCGv_i32 load_frw0_i32(unsigned rt) static TCGv_i64 load_frw0_i64(unsigned rt) { + TCGv_i64 ret = tcg_temp_new_i64(); if (rt == 0) { - return tcg_const_i64(0); + tcg_gen_movi_i64(ret, 0); } else { - TCGv_i64 ret = tcg_temp_new_i64(); tcg_gen_ld32u_i64(ret, cpu_env, offsetof(CPUHPPAState, fr[rt & 31]) + (rt & 32 ? LO_OFS : HI_OFS)); - return ret; } + return ret; } static void save_frw_i32(unsigned rt, TCGv_i32 val) @@ -613,7 +611,9 @@ static TCGv_i64 load_frd(unsigned rt) static TCGv_i64 load_frd0(unsigned rt) { if (rt == 0) { - return tcg_const_i64(0); + TCGv_i64 ret = tcg_temp_new_i64(); + tcg_gen_movi_i64(ret, 0); + return ret; } else { return load_frd(rt); } @@ -3330,7 +3330,8 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Convert big-endian bit numbering in SAR to left-shift. */ tcg_gen_xori_reg(shift, cpu_sar, TARGET_REGISTER_BITS - 1); - mask = tcg_const_reg(msb + (msb - 1)); + mask = tcg_temp_new(); + tcg_gen_movi_reg(mask, msb + (msb - 1)); tcg_gen_and_reg(tmp, val, mask); if (rs) { tcg_gen_shl_reg(mask, mask, shift);