From patchwork Mon Feb 27 05:24:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656776 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2179227wrb; Sun, 26 Feb 2023 21:31:19 -0800 (PST) X-Google-Smtp-Source: AK7set8av8HAenBcmJd3GN0RgJRnGdffZLJz+hYcedHYgxVLgkNQyftqRMcRZXQsjA8TOKRpkvAY X-Received: by 2002:ad4:5fcd:0:b0:56f:4d1:cfbc with SMTP id jq13-20020ad45fcd000000b0056f04d1cfbcmr44995223qvb.33.1677475879710; Sun, 26 Feb 2023 21:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677475879; cv=none; d=google.com; s=arc-20160816; b=k3Nw9vZvS+5obTEWxZdcRbjjLk0Rer9BuGiqk9Axlj8j2CMg4l1KWKV/kpMWSie0Rc N5sCLtUS6dNf7L+0YJUm8SDcbBqDKTf2nN/gILH69hRthDC1H6aXIhWw+RhVhNpAHg4c L5lCwfnztUP9I0yI4AJU2Da0ONv9/zIfkMb+tL/JmAXt/3Pxo+mmKi1fPwMqQ++B2lwv Hd8HTdDhdbCeOCLpyBGAPUe1bdb1mrfgsVc+GNTEPNUMfD+TF9MGSz0epmd1tceLsKkF Ssg1B3LCO40ByXFsXCi5MfI0HD9+20WxAFXMqx8/cb4CBHIsSKr4b6hg89jA/rWtxkPl 3HXA== 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=PZT9JzGqWNeNM4srg9HjjFaakIhKs3s8GuAgd6TYYaQ=; b=CpZLvW029Er43194sQ53LMZhKMW7NUsEAH0OJ9ugyVWGikRdzEmiAhhVoCeb5FCS6v dGT1SjZQdfNixPadOm3TL9iRFT7mIxAL/iPnmuBzrYUv+t6tvJ/Z55ysFQAGjTQbC7iH x4JVTG+ApPsYRkOY2KjBF/hOZzRsMbLiYrkqTx122pIRcNoteQF/OteMpDv9x2TamAgL XGhXLKNnwr9SPiUMwvlY1Fx3r9jcABGijn2tvD+3HsJob5oO1/gk6/TalC8NCNggDQUn e0QJ/qbXr4mr+BvSaWN81Mb2tkzaumfPyYq4XDq3hdcR5QGFNnLVDXlzBqTRllhbVBC/ 7KwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Qbim//ou"; 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 r17-20020a0ce291000000b0056ebc103ec6si5677582qvl.200.2023.02.26.21.31.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:31:19 -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="Qbim//ou"; 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 1pWW2U-0000xs-HS; Mon, 27 Feb 2023 00:27:06 -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 1pWW28-0000GK-WF for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:26:48 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWW26-0007v5-38 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:26:44 -0500 Received: by mail-pj1-x1031.google.com with SMTP id kb15so4880672pjb.1 for ; Sun, 26 Feb 2023 21:26:41 -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=PZT9JzGqWNeNM4srg9HjjFaakIhKs3s8GuAgd6TYYaQ=; b=Qbim//oujTqfuRONSlXfVji0kPeSbYsrURvV2V1SdFx6VOZI072Gn1sITztlpn3mUU h/smZopUdtRDzE7vhzzjBy76s583oiaolQGN2r9Q9cdsiCAQDSEZsE1nB4nTTZVgkBGr /FfCBKOPUuCq7GjJDeNvcY2gzeZN1NbVuVGZgP1yjOIKmWzNHAijpYjS8exHoion3e4K 6js0cghUQSAsk6ffHPfhGJZsJnG7LRcIn8Mj5hSGudRl+U1S+RNzZweAfwSofVxpgCSN B7muJGwMCmaMG5mxa5b2XYJ5QwfR8OlXKYzC5IptNuymvl2YEze0YoCg33yoR9qsnKi0 g70g== 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=PZT9JzGqWNeNM4srg9HjjFaakIhKs3s8GuAgd6TYYaQ=; b=GFDDsjD01gjB/Cp83/ONpTfnxzoi++G0QCBpJ4knCuK8omZuGkQWmqIkf9C0ObbE3q qmCRl7CDpHEmGHkBQAFJUYBWbZ1OdVQRdzo0TDODLeuzmYeYq/CzW/09kCj4pGPTyB8z KnXrj7VRLffuhwUX5VINBC4dMeyd0OHfP3PrqAa2VNoJuxwpQgl9Q57WZslB1Mo1UnqB Se99W8O1PxCNx/71MljYMOEenfoXtuyp9DAsOmJ+73jBL+Wpm8Cks+MD58Lwgc7dmetk FOnVZd8TS5QdvCarINbZIW2uIVWnE6gwgy9+vhTkQJmwvkPXGF5ZPZOV5BaN9kEv8dnp 9PdA== X-Gm-Message-State: AO0yUKUe7mHfrJYtWrk0c27DpXFcEOXWmWXB81yujyoImEsiqURyqeCe Dvpp/wp8t85BCHyNJMfo6t5v1I+1/brWQXUs1qQ= X-Received: by 2002:a17:902:dace:b0:19d:c9f:44f3 with SMTP id q14-20020a170902dace00b0019d0c9f44f3mr3452349plx.21.1677475600708; Sun, 26 Feb 2023 21:26:40 -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 a14-20020a170902ecce00b0019a837be977sm3513341plh.271.2023.02.26.21.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:26:40 -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 v2 33/76] target/m68k: Drop mark_to_release Date: Sun, 26 Feb 2023 19:24:22 -1000 Message-Id: <20230227052505.352889-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227052505.352889-1-richard.henderson@linaro.org> References: <20230227052505.352889-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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, therefore there's no need to record temps for later freeing. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/m68k/translate.c | 55 ++++++++++------------------------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 157c2cbb8f..b3cd3e87e1 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -121,35 +121,9 @@ typedef struct DisasContext { int done_mac; int writeback_mask; TCGv writeback[8]; -#define MAX_TO_RELEASE 8 - int release_count; - TCGv release[MAX_TO_RELEASE]; bool ss_active; } DisasContext; -static void init_release_array(DisasContext *s) -{ -#ifdef CONFIG_DEBUG_TCG - memset(s->release, 0, sizeof(s->release)); -#endif - s->release_count = 0; -} - -static void do_release(DisasContext *s) -{ - int i; - for (i = 0; i < s->release_count; i++) { - tcg_temp_free(s->release[i]); - } - init_release_array(s); -} - -static TCGv mark_to_release(DisasContext *s, TCGv tmp) -{ - g_assert(s->release_count < MAX_TO_RELEASE); - return s->release[s->release_count++] = tmp; -} - static TCGv get_areg(DisasContext *s, unsigned regno) { if (s->writeback_mask & (1 << regno)) { @@ -396,8 +370,7 @@ static TCGv gen_ldst(DisasContext *s, int opsize, TCGv addr, TCGv val, gen_store(s, opsize, addr, val, index); return store_dummy; } else { - return mark_to_release(s, gen_load(s, opsize, addr, - what == EA_LOADS, index)); + return gen_load(s, opsize, addr, what == EA_LOADS, index); } } @@ -491,7 +464,7 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base) } else { bd = 0; } - tmp = mark_to_release(s, tcg_temp_new()); + tmp = tcg_temp_new(); if ((ext & 0x44) == 0) { /* pre-index */ add = gen_addr_index(s, ext, tmp); @@ -501,7 +474,7 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base) if ((ext & 0x80) == 0) { /* base not suppressed */ if (IS_NULL_QREG(base)) { - base = mark_to_release(s, tcg_const_i32(offset + bd)); + base = tcg_const_i32(offset + bd); bd = 0; } if (!IS_NULL_QREG(add)) { @@ -517,11 +490,11 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base) add = tmp; } } else { - add = mark_to_release(s, tcg_const_i32(bd)); + add = tcg_const_i32(bd); } if ((ext & 3) != 0) { /* memory indirect */ - base = mark_to_release(s, gen_load(s, OS_LONG, add, 0, IS_USER(s))); + base = gen_load(s, OS_LONG, add, 0, IS_USER(s)); if ((ext & 0x44) == 4) { add = gen_addr_index(s, ext, tmp); tcg_gen_add_i32(tmp, add, base); @@ -546,7 +519,7 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base) } } else { /* brief extension word format */ - tmp = mark_to_release(s, tcg_temp_new()); + tmp = tcg_temp_new(); add = gen_addr_index(s, ext, tmp); if (!IS_NULL_QREG(base)) { tcg_gen_add_i32(tmp, add, base); @@ -676,7 +649,7 @@ static inline TCGv gen_extend(DisasContext *s, TCGv val, int opsize, int sign) if (opsize == OS_LONG) { tmp = val; } else { - tmp = mark_to_release(s, tcg_temp_new()); + tmp = tcg_temp_new(); gen_ext(tmp, val, opsize, sign); } @@ -802,7 +775,7 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, return NULL_QREG; } reg = get_areg(s, reg0); - tmp = mark_to_release(s, tcg_temp_new()); + tmp = tcg_temp_new(); if (reg0 == 7 && opsize == OS_BYTE && m68k_feature(s->env, M68K_FEATURE_M68K)) { tcg_gen_subi_i32(tmp, reg, 2); @@ -812,7 +785,7 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, return tmp; case 5: /* Indirect displacement. */ reg = get_areg(s, reg0); - tmp = mark_to_release(s, tcg_temp_new()); + tmp = tcg_temp_new(); ext = read_im16(env, s); tcg_gen_addi_i32(tmp, reg, (int16_t)ext); return tmp; @@ -823,14 +796,14 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, switch (reg0) { case 0: /* Absolute short. */ offset = (int16_t)read_im16(env, s); - return mark_to_release(s, tcg_const_i32(offset)); + return tcg_const_i32(offset); case 1: /* Absolute long. */ offset = read_im32(env, s); - return mark_to_release(s, tcg_const_i32(offset)); + return tcg_const_i32(offset); case 2: /* pc displacement */ offset = s->pc; offset += (int16_t)read_im16(env, s); - return mark_to_release(s, tcg_const_i32(offset)); + return tcg_const_i32(offset); case 3: /* pc index+displacement. */ return gen_lea_indexed(env, s, NULL_QREG); case 4: /* Immediate. */ @@ -958,7 +931,7 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext *s, int mode, int reg0, default: g_assert_not_reached(); } - return mark_to_release(s, tcg_const_i32(offset)); + return tcg_const_i32(offset); default: return NULL_QREG; } @@ -6287,7 +6260,6 @@ static void m68k_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) dc->cc_op_synced = 1; dc->done_mac = 0; dc->writeback_mask = 0; - init_release_array(dc); dc->ss_active = (M68K_SR_TRACE(env->sr) == M68K_SR_TRACE_ANY_INS); /* If architectural single step active, limit to 1 */ @@ -6314,7 +6286,6 @@ static void m68k_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) opcode_table[insn](env, dc, insn); do_writebacks(dc); - do_release(dc); dc->pc_prev = dc->base.pc_next; dc->base.pc_next = dc->pc;