From patchwork Sat Feb 25 09:14:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656520 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp1359506wrb; Sat, 25 Feb 2023 01:28:27 -0800 (PST) X-Google-Smtp-Source: AK7set8feWaAdzSrtkMPRZY7vgigf+sUaHHcLtOElsKYbyzqDAd4s9FA3WTeEbXawE+KKmIIK2vj X-Received: by 2002:a05:6214:27c3:b0:56b:377e:88a7 with SMTP id ge3-20020a05621427c300b0056b377e88a7mr30933546qvb.21.1677317306951; Sat, 25 Feb 2023 01:28:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677317306; cv=none; d=google.com; s=arc-20160816; b=n4fOESLzLTiNt4YN69zHmUIjXYOtr8yzyuvcU/6J03UWh5XOh+F43ausKpbbLU5Mph O7iyT5vwY3X2V19VhKYNUYhdUmQtsV7XmOdSiBKoHFK4z7t9niD/XepNtyMYHNasoRH5 UB1ysvqCIFXhznqBn4HVvfehVp0mX2SSlL+0vtbHVvx6nKqMzQXw6M6wXxXx3iCTAC+O mgoYHVc2ZxOAvaHaNj8iQQEd0JNEUnARFEUaaBNvqFVfac7hK5QVJqAQ7p09OD2yOTxo oacmTjzvbsSRbXcwF6FWm8ncaonzOAWwIaRh0Ox+SpXF6i3w/TAHfaKCExsEmOYMx6hF MpqA== 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=x5RhcaUXSQ5MfMxq0C6EBN7haRQoUvmPfbIAZ3PLMW4=; b=olFAqOk7uJlCJWlOI1pUlsdeJB0zC5WHvSEs2qh25+rqbKUKIZryFhw9AZUBNh8hyF XLLAdFG6evYu/9RvDtLMNkZcftJ6OqOcJYQwGcZ5HUVJiYjd7PWSSYHOcb/PfCjl6hCW rlru8+XFXd+1I8uwlI3UqXBXxr+IoQv/mrSMfIro9qZIHk4POtF36E4r4oB732It+Rt7 JPtfulHydLH0ObEnJA8SfCcTmJHpQtygnxdDqncJwCO0LFDYj2o97LXbPrihdE3R4ehK SQ15e/l+fE6osFOHVV7Ch5s4OG5hOySV4VqJKwlXAlwbkEG9uJ8lakRF6R6r18fp/eJv tKIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUJ7RFfR; 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 p20-20020a0ce194000000b00571d10fc7cdsi1467391qvl.191.2023.02.25.01.28.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2023 01:28: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=VUJ7RFfR; 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 1pVqjy-0000iG-9p; Sat, 25 Feb 2023 04:21:14 -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 1pVqjN-0006Vl-7q for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:20:40 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVqjH-0003Ue-Fj for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:20:36 -0500 Received: by mail-pg1-x534.google.com with SMTP id 130so934727pgg.3 for ; Sat, 25 Feb 2023 01:20:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=x5RhcaUXSQ5MfMxq0C6EBN7haRQoUvmPfbIAZ3PLMW4=; b=VUJ7RFfRVwbXo1RBt+nRsutOHLuWIV/8OqTOn2/rV6UeFM1DYBPojTr92lXn8ZMv55 Z7jYSoKAbotdxwH+vWoEqNGjZKwvtTueCqnjzqdcieDUGNv84+DNyVdTWjF4UtZbsgUy mGlFVmk5CnQup8FHZeGrb0ZTD9+zTLxudo0n3mjrgB8mbyiMREHgVMsbnDByjZSIamgX jRPq4IPqSN2g5DFOgOqnT5b/8G7DIxXBOrkXSUlWjjV2qCgDi5Gy4T+i+vGpvyWCJJIb ZMVCcvHhd4hVzkTI0kwIvvUBW4OulJACgY/KZcuYq+9VVvR4qBKH6LREERWhKEyzouhf 80Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=x5RhcaUXSQ5MfMxq0C6EBN7haRQoUvmPfbIAZ3PLMW4=; b=EbOG4+27hc1PfaltgP89rnvCOxw2XI48iJTa240gRenQvyJii0Q/e6/O65myQiPPiH N1miM9EO8YjzJ/NJSlG1mrbzJ2GltLm+2taTsfTuHBkWRKVoqyb/aKw5f3coGcWA0/L8 t8exZzxM4L3m9p+AQ1YKrOOznO1RGrx7wJ2BuXQzp+33tCzOoSLdkniL/zDx7MI6Fgit /DOnVuSQrv+WR2MYTSWB79d22hyB7zVLrPTXE0Wj6fCQyzH8s5BQ9VTtc0SVDOeY6ZZp SOKIDoJQJ0tgQMoIpsxG/7uOX+dDb+5pe0X8C2qTNILxRp/oD0SYU9T2iLPQZOpb9Vnd SZgA== X-Gm-Message-State: AO0yUKXvF/JovvCX3M93lSQeZQymWRzRJ2LEtXn6m51XX5X7kyUIgoEW 1RfVzYI8gjY+tT77Wz6JmStCQ1Ezp4E37wxwH9I= X-Received: by 2002:aa7:8f11:0:b0:5df:3aa1:10c5 with SMTP id x17-20020aa78f11000000b005df3aa110c5mr6774524pfr.14.1677316829736; Sat, 25 Feb 2023 01:20:29 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id 26-20020aa7921a000000b00592417157f2sm843114pfo.148.2023.02.25.01.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 01:20:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, jcmvbkbc@gmail.com, kbastian@mail.uni-paderborn.de, ysato@users.sourceforge.jp, gaosong@loongson.cn, jiaxun.yang@flygoat.com, tsimpson@quicinc.com, ale@rev.ng, mrolnik@gmail.com, edgar.iglesias@gmail.com Subject: [PATCH 68/76] target/sparc: Drop free_compare Date: Fri, 24 Feb 2023 23:14:19 -1000 Message-Id: <20230225091427.1817156-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230225091427.1817156-1-richard.henderson@linaro.org> References: <20230225091427.1817156-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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=unavailable 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 Translators are no longer required to free tcg temporaries. Remove the g1 and g2 members of DisasCompare, as they were used to track which temps needed to be freed. Signed-off-by: Richard Henderson --- target/sparc/translate.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 560fb32e28..f32f237051 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -93,7 +93,6 @@ typedef struct DisasContext { typedef struct { TCGCond cond; bool is_bool; - bool g1, g2; TCGv c1, c2; } DisasCompare; @@ -1066,16 +1065,6 @@ static inline void gen_op_next_insn(void) tcg_gen_addi_tl(cpu_npc, cpu_npc, 4); } -static void free_compare(DisasCompare *cmp) -{ - if (!cmp->g1) { - tcg_temp_free(cmp->c1); - } - if (!cmp->g2) { - tcg_temp_free(cmp->c2); - } -} - static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, DisasContext *dc) { @@ -1135,17 +1124,14 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, cmp->cond = logic_cond[cond]; do_compare_dst_0: cmp->is_bool = false; - cmp->g2 = false; cmp->c2 = tcg_const_tl(0); #ifdef TARGET_SPARC64 if (!xcc) { - cmp->g1 = false; cmp->c1 = tcg_temp_new(); tcg_gen_ext32s_tl(cmp->c1, cpu_cc_dst); break; } #endif - cmp->g1 = true; cmp->c1 = cpu_cc_dst; break; @@ -1167,7 +1153,6 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, if (!xcc) { /* Note that sign-extension works for unsigned compares as long as both operands are sign-extended. */ - cmp->g1 = cmp->g2 = false; cmp->c1 = tcg_temp_new(); cmp->c2 = tcg_temp_new(); tcg_gen_ext32s_tl(cmp->c1, cpu_cc_src); @@ -1175,7 +1160,6 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, break; } #endif - cmp->g1 = cmp->g2 = true; cmp->c1 = cpu_cc_src; cmp->c2 = cpu_cc_src2; break; @@ -1192,7 +1176,6 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, /* We're going to generate a boolean result. */ cmp->cond = TCG_COND_NE; cmp->is_bool = true; - cmp->g1 = cmp->g2 = false; cmp->c1 = r_dst = tcg_temp_new(); cmp->c2 = tcg_const_tl(0); @@ -1258,7 +1241,6 @@ static void gen_fcompare(DisasCompare *cmp, unsigned int cc, unsigned int cond) /* For now we still generate a straight boolean result. */ cmp->cond = TCG_COND_NE; cmp->is_bool = true; - cmp->g1 = cmp->g2 = false; cmp->c1 = r_dst = tcg_temp_new(); cmp->c2 = tcg_const_tl(0); @@ -1342,8 +1324,6 @@ static void gen_cond(TCGv r_dst, unsigned int cc, unsigned int cond, } else { tcg_gen_setcond_tl(cmp.cond, r_dst, cmp.c1, cmp.c2); } - - free_compare(&cmp); } static void gen_fcond(TCGv r_dst, unsigned int cc, unsigned int cond) @@ -1357,8 +1337,6 @@ static void gen_fcond(TCGv r_dst, unsigned int cc, unsigned int cond) } else { tcg_gen_setcond_tl(cmp.cond, r_dst, cmp.c1, cmp.c2); } - - free_compare(&cmp); } #ifdef TARGET_SPARC64 @@ -1378,8 +1356,6 @@ static void gen_compare_reg(DisasCompare *cmp, int cond, TCGv r_src) { cmp->cond = tcg_invert_cond(gen_tcg_cond_reg[cond]); cmp->is_bool = false; - cmp->g1 = true; - cmp->g2 = false; cmp->c1 = r_src; cmp->c2 = tcg_const_tl(0); } @@ -1391,8 +1367,6 @@ static inline void gen_cond_reg(TCGv r_dst, int cond, TCGv r_src) /* The interface is to return a boolean in r_dst. */ tcg_gen_setcond_tl(cmp.cond, r_dst, cmp.c1, cmp.c2); - - free_compare(&cmp); } #endif @@ -3268,7 +3242,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) l1 = gen_new_label(); tcg_gen_brcond_tl(tcg_invert_cond(cmp.cond), cmp.c1, cmp.c2, l1); - free_compare(&cmp); } mask = ((dc->def->features & CPU_FEATURE_HYPV) && supervisor(dc) @@ -3827,7 +3800,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) cpu_src1 = get_src1(dc, insn); \ gen_compare_reg(&cmp, cond, cpu_src1); \ gen_fmov##sz(dc, &cmp, rd, rs2); \ - free_compare(&cmp); \ } while (0) if ((xop & 0x11f) == 0x005) { /* V9 fmovsr */ @@ -3851,7 +3823,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) cond = GET_FIELD_SP(insn, 14, 17); \ gen_fcompare(&cmp, fcc, cond); \ gen_fmov##sz(dc, &cmp, rd, rs2); \ - free_compare(&cmp); \ } while (0) case 0x001: /* V9 fmovscc %fcc0 */ @@ -3901,7 +3872,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) cond = GET_FIELD_SP(insn, 14, 17); \ gen_compare(&cmp, xcc, cond, dc); \ gen_fmov##sz(dc, &cmp, rd, rs2); \ - free_compare(&cmp); \ } while (0) case 0x101: /* V9 fmovscc %icc */ @@ -4713,7 +4683,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) tcg_gen_movcond_tl(cmp.cond, dst, cmp.c1, cmp.c2, cpu_src2, dst); - free_compare(&cmp); gen_store_gpr(dc, rd, dst); break; } @@ -4745,7 +4714,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) tcg_gen_movcond_tl(cmp.cond, dst, cmp.c1, cmp.c2, cpu_src2, dst); - free_compare(&cmp); gen_store_gpr(dc, rd, dst); break; }