From patchwork Thu Mar 9 20:05:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 661067 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp497841wrb; Thu, 9 Mar 2023 12:11:01 -0800 (PST) X-Google-Smtp-Source: AK7set+6dvvA4KxXk4yYPrrKcBkZibfAlb7wSg3tlPZQomx4azvMb5mjY7M3Th9EAWMJmmY8E6Ux X-Received: by 2002:a05:600c:3506:b0:3e2:c67:1c7f with SMTP id h6-20020a05600c350600b003e20c671c7fmr493546wmq.10.1678392661687; Thu, 09 Mar 2023 12:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678392661; cv=none; d=google.com; s=arc-20160816; b=vZAeirFd7NfXSOP0JDw7ByyG/bZlLLfqTNbKi0OKmQiyMWERSWlPx1j3LeVnC8uXIR 7D6rCHWlxLoWuCN9q0j5NeY1Cem1VczisYLE5ncAOQBl5jFhptasFEB3CmSow8dc6kbG szQgOSbJ4BE+fepWJE9DqnY7zpO/slqrx8SUD/2vqXI47bRq6k85o4HdMm+FDD/AKpky nXVzY1Ms0YTCYwxGw171M2PbzxW9GUrn5MYVT/genWvpgwzDnj6/f59O2Lyp5Zs25CJQ wWSRzXORo5MKdEKgJl5pmt01htEVFDVzwlfxRfggJwo4R1J4+EgFZWx+qakDrwQHHoRV W/eg== 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=RlofParYytqAgbUH4z7lWfQOfWujbdI/uISCzvLaxQz7OAuZobE5ZMZvy1WiYvWLQE emQu6crFaU+usDkf+dGas/3aX6vDsKKy1mIDMVME/dlKKedLypK2K7K1mYWd52byNzQk POJ0qyap8uEreizoPJfZZksAsFj9MIM2nhKdozx1xhVe5fLsfajyymHGqDMyHducwwny 6Oostqz4rGVOd+1aBaqPTA/EVbU2IAolhhD0+6Ly26Cyopg+rXgmXZM3rEXp72H2vKnO J0JUjYUqlYkzzo58XVjWdvXnv5BSm0/OGmmOfMj2ljRFYlx10HAF9+9ESHWnlRZPanwF 6UGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yvpync0B; 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 l14-20020a05600c4f0e00b003e21b56d7d4si51479wmq.12.2023.03.09.12.11.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Mar 2023 12:11:01 -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=yvpync0B; 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 1paMa1-0003XC-8D; Thu, 09 Mar 2023 15:09:37 -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 1paMZx-0003Ft-84 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:09:33 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paMZv-0001V9-I2 for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:09:32 -0500 Received: by mail-pl1-x629.google.com with SMTP id i3so3213342plg.6 for ; Thu, 09 Mar 2023 12:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678392570; 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=yvpync0BOdY6b474bVQSKKzLuW/NLcKAhz9gCr1FWnTqGdofysBuYHBAx4zrfchbPI oNA54PEfT+qGV/HaElvcJdlSFtZaNiNNGDivCAsY9oXrZZiRIvwQyj0JbIaxNkGjr9tJ goT8aVkhLbPw0BfJFF21F+d8JR4Gse0a8H38ZFNcFRq1h6VSFml63g+VRevRLfOSAP1F U6En3uBXJbtfIWPWEynOJfFuAVBpE4cl4t8dY2dbN9RbF6WSuCz8stdyeC9K1weYgcZw l49fiQtNiEa0MsD58x7p9U5/DoeevfcRuF2Ode/WVroXEALlRoP/cvuZgLw9qUFu9qBr n5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678392570; 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=2G8KDy0vtR3CIj8sfufrJUgDMdWDW2cL9wf0mUeWcU2w3d9iGDijR7vv8UJAUuyy4T B8JizwMwp6hhRjyUob9bxTegNn7tXnM26jXRrYBY8ZZsyf3cdDXdGMXIfQf5mpc1nhah ffFBZieyeaFXdC2IvId++1GWqkl+RxvXhDZSujx6Um3vHUNUpnWAVgqZMX53udWijvhe 2yZ+UrYP5HaQkeLxvgpkpBECuZUu9DJQ2UXQ7GcHExJA8kZ2ZiJU67p+9GfT25+H5gd/ 5Jmvt1Uz3fOPePGkPUdBH6p63B3lI9TtrJUNJeasEk8uN1owO+wG46nsR7KNNxXekBGO 2shg== X-Gm-Message-State: AO0yUKVembhNtU6+vbm9UlccEPqFkUsFeMXIqW5gUpqxrSl/YvBsNXs0 ewJmJAobEaxU/GYC5lFltoQtFIBBa0rdCOjndG8= X-Received: by 2002:a17:903:11c4:b0:19e:f315:98d with SMTP id q4-20020a17090311c400b0019ef315098dmr8388644plh.43.1678392570300; Thu, 09 Mar 2023 12:09:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 12:09:29 -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 43/91] target/hppa: Avoid use of tcg_const_i32 throughout Date: Thu, 9 Mar 2023 12:05:02 -0800 Message-Id: <20230309200550.3878088-44-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::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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);