From patchwork Tue Jan 17 23:10:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 643434 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp1443803pvb; Tue, 17 Jan 2023 15:13:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXv9aRZfWyS2WSo6rO04T+y+hZsudrRxGPtYM7AZnv31CEh4+kpVvPcM6MD+ZAPtN3H95EnV X-Received: by 2002:a0c:e343:0:b0:535:2830:18ef with SMTP id a3-20020a0ce343000000b00535283018efmr5833541qvm.12.1673997224084; Tue, 17 Jan 2023 15:13:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673997224; cv=none; d=google.com; s=arc-20160816; b=Cd714buKrlyNqTVTd15WtL/HVW9tKayEj/A4RU9gbUR6S+rjyPmk4myUxlrmRoUxnd hqtTM+5Oltweisde9rjSXuCYlwawgc5pAG1HX2PxL4KAjiznHY0SVkbrXR30bf+hZwNT N0IfVnqhUYXuhUFUPQSVlMD/ywZkul6IEn+4m+gVxc/ykVFs6gfRxxN9rsQuY+7M3R3N yMsWtAfgbc4qFGVkwTl1SlsafAZYtS1z5mZUpbzmTG1Iuts/kwe079kAZoqrAa8DTf/h nPuTDN0WfDmdad9JfnCR4pIAVCwWKPSR3tcwMwLLmufpDXyEEF3aX3Ak3bTcJpfOQT0X midw== 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=OhlXNm9D8DQ2mjuxBN4Ft6JpruPMQiHKfihtVFgq2XI=; b=VWez1PrtO15ZGP2oBFI1Byl39J2CRVjMzTNCdH6LFNabQ08Hb3wSsgGUwMcl3UP2s2 dy1Zb9eBSPSu7Ctkk/rzjExQVxjijhGkEPZEBjbnQEj8YCAfVglXD32UN+Oi79zqI/qr n0jALE0Vd7ZWZM6W47bPF+U5OPcPkbmtOSZTZ66nPQJFuVdwlpbU4bJrWkf7R6tlofWG i8StIAP19RI2sw4eHCx5ZgVknLdM8TtqOcgZzbTKl+aTr0mrPOLwz7chRKELQxhTXVDB vyRLTj8zlZts8AiAqQWSin/g0RBi9gVQbYVpjWR9IZS6yaFJrcmr/KQwT5RVU2eCjXV8 ELKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="w7Ij5+/H"; 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 kc22-20020a056214411600b005214df9a7ecsi3475717qvb.576.2023.01.17.15.13.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Jan 2023 15:13:44 -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="w7Ij5+/H"; 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 1pHv6l-0003Rd-AP; Tue, 17 Jan 2023 18:11:11 -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 1pHv6e-0003N5-UW for qemu-devel@nongnu.org; Tue, 17 Jan 2023 18:11:05 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHv6d-0001Iy-6W for qemu-devel@nongnu.org; Tue, 17 Jan 2023 18:11:04 -0500 Received: by mail-pl1-x630.google.com with SMTP id p24so35078261plw.11 for ; Tue, 17 Jan 2023 15:11:02 -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=OhlXNm9D8DQ2mjuxBN4Ft6JpruPMQiHKfihtVFgq2XI=; b=w7Ij5+/HjF2usqrcsqYvLMBTaJETfPqBBKyDK6FuRvyJbZ/+T3GVuNJCnYoAH8udzo oNILjeotS+U4iuTrG7C5TPIiSRZdgzVkp5CywYLkavD+ay5UskKQJsaP9TVSrmJkbBnj soB2uATd7yFoz6KbhLD9qBMHUoYo63ToBYhlPzOyt0K1pydbnTtx5CjXmz6ySVToqFIs lbZbtG2i1BE5Iv5DIa3wdPbkbzJUt+hjXd6DAeiSTsSk1h2UTrYtdvI/OsyJchUA/w6U Uuxut1e/UMKLbc5hFMsvZR66KvU1IAGreo0CckVUnyRPwXdtSSdbGc+MZtJQXENI1aiL mdlQ== 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=OhlXNm9D8DQ2mjuxBN4Ft6JpruPMQiHKfihtVFgq2XI=; b=amQjKGHsPY9Hra7ZOISi6MESrGLXN0W7+7XfJU9imirDOrTZzajjWdX2KDa5mLPxfh oHNKolHFy9qWHiNj5qizlREiQy5T6Rb4ujsBHOxmKzv0OjeVscewYZhPS4WN4KVvPC8h nzKbdpcUqOJ+vUQQ3Fn7B+isnjlVjoDjtJyASmQ2lraIE1bbWOKSO5kQclxpr/Si20YR loUxcagd2MClqUSv8pMhv2OovDPI8mxcnOMKGtTn5lfYrjjNTtr7/TajTVLNla0c7Anj EynH0bwNRUwzD04NgwIrvAj+75f1atmcly3h/xJh4aLU95qpb2xNRYe0Uhiluye7Wf/6 7iGQ== X-Gm-Message-State: AFqh2kqWXtYSAdKLMpulG/CLw3sB7ioB4+/+nRN0Mo/e+T0dzgtDsQDb FoYSmfOaoKLcSfrJiAuXxH2NSUwAz14hWBrn X-Received: by 2002:a05:6a20:ce43:b0:9d:efbe:2066 with SMTP id id3-20020a056a20ce4300b0009defbe2066mr4315396pzb.28.1673997061768; Tue, 17 Jan 2023 15:11:01 -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 b193-20020a621bca000000b005810c4286d6sm20747070pfb.0.2023.01.17.15.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 15:11:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 04/22] tcg/sparc64: Remove unused goto_tb code for indirect jump Date: Tue, 17 Jan 2023 13:10:33 -1000 Message-Id: <20230117231051.354444-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117231051.354444-1-richard.henderson@linaro.org> References: <20230117231051.354444-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 41 +++++++++++------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index d2d8b46815..26b00d1638 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -537,17 +537,6 @@ static bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, return false; } -static void tcg_out_ld_ptr(TCGContext *s, TCGReg ret, const void *arg) -{ - intptr_t diff = tcg_tbrel_diff(s, arg); - if (USE_REG_TB && check_fit_ptr(diff, 13)) { - tcg_out_ld(s, TCG_TYPE_PTR, ret, TCG_REG_TB, diff); - return; - } - tcg_out_movi(s, TCG_TYPE_PTR, ret, (uintptr_t)arg & ~0x3ff); - tcg_out_ld(s, TCG_TYPE_PTR, ret, ret, (uintptr_t)arg & 0x3ff); -} - static void tcg_out_sety(TCGContext *s, TCGReg rs) { tcg_out32(s, WRY | INSN_RS1(TCG_REG_G0) | INSN_RS2(rs)); @@ -1463,27 +1452,21 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, switch (opc) { case INDEX_op_goto_tb: - if (s->tb_jmp_insn_offset) { - /* direct jump method */ - if (USE_REG_TB) { - /* make sure the patch is 8-byte aligned. */ - if ((intptr_t)s->code_ptr & 4) { - tcg_out_nop(s); - } - s->tb_jmp_insn_offset[a0] = tcg_current_code_size(s); - tcg_out_sethi(s, TCG_REG_T1, 0); - tcg_out_arithi(s, TCG_REG_T1, TCG_REG_T1, 0, ARITH_OR); - tcg_out_arith(s, TCG_REG_G0, TCG_REG_TB, TCG_REG_T1, JMPL); - tcg_out_arith(s, TCG_REG_TB, TCG_REG_TB, TCG_REG_T1, ARITH_ADD); - } else { - s->tb_jmp_insn_offset[a0] = tcg_current_code_size(s); - tcg_out32(s, CALL); + qemu_build_assert(TCG_TARGET_HAS_direct_jump); + /* Direct jump. */ + if (USE_REG_TB) { + /* make sure the patch is 8-byte aligned. */ + if ((intptr_t)s->code_ptr & 4) { tcg_out_nop(s); } + s->tb_jmp_insn_offset[a0] = tcg_current_code_size(s); + tcg_out_sethi(s, TCG_REG_T1, 0); + tcg_out_arithi(s, TCG_REG_T1, TCG_REG_T1, 0, ARITH_OR); + tcg_out_arith(s, TCG_REG_G0, TCG_REG_TB, TCG_REG_T1, JMPL); + tcg_out_arith(s, TCG_REG_TB, TCG_REG_TB, TCG_REG_T1, ARITH_ADD); } else { - /* indirect jump method */ - tcg_out_ld_ptr(s, TCG_REG_TB, s->tb_jmp_target_addr + a0); - tcg_out_arithi(s, TCG_REG_G0, TCG_REG_TB, 0, JMPL); + s->tb_jmp_insn_offset[a0] = tcg_current_code_size(s); + tcg_out32(s, CALL); tcg_out_nop(s); } set_jmp_reset_offset(s, a0);