From patchwork Tue Dec 6 04:17:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 631318 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2935224pvb; Mon, 5 Dec 2022 20:23:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TPCWfD11J+K478EyrRRcCL0WFtcuiyhgn+TSVDFVXOWvypQ0Zli8wsFirT/wAMurvM9vQ X-Received: by 2002:a05:6214:2dc1:b0:4c7:63c0:a357 with SMTP id nc1-20020a0562142dc100b004c763c0a357mr7846642qvb.123.1670300624363; Mon, 05 Dec 2022 20:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670300624; cv=none; d=google.com; s=arc-20160816; b=al9SSYIfWBi+t4JoySvGgvYLnqUuT2sibPhI/EwoATFXYUrox95AHR13+oIR59P6fx HnEWikLDoOoAVcRFj5B630sr6Yb1RoULc+jJQ2N/i7Ax8sp2L6MSkVDpq0+h6lv2YPAx ujCsKsUFe9G2xYeff8dYnRVmQvIUqXk1p4Gi5fQPY80vXC4KKExECs7dbZ+MRF47941N WxfsrNOqSE3WH0xv6893+EhQXSJIsy40/hgAjuXATdvyzkHlgMd1PYVAtfi4HnXRTsZf 5ibZxK/J/PT4WiGe9c1E+vh8q2DBaYqA3MPjIZQp9W3URcbtPzRMcaT9Mx8q0shrdlTO 0lpg== 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=eHbWZNc2e37AaQzsCP2Rz1slFzFOy+tMFTM0BqvuSPQ=; b=YObVMU9AXlfNV6U0tB1drcp8GDy0y2Jsoxbm2Kh3AuUNgbGP6UFFVOwS495GR1L023 NB31EplDQhGsihkhyvrKgBkm45S3H4Jie9cVHq0hNBTM0zOx3f4IyH7u0GaAZ+OTEXGq FjvPEpHDf1+kxg9yqDQYJBqYrQRNqhkgBS4kNDz++THb7XafZzwYu9vVIrUfxlb3kBq7 eWlW1+YlibRSTiWhnnK37E2vu28+cP61jqDZIoeNCcnahrZ1dDHIM724o7mQzDFlPObw e8zCkdfPVHgnK4XZyRFWJPos5YwPBLsdYJfy94ZRCUN8R288KR3EmFgreQJOrFfVhYlj j6Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gRu/lVny"; 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 t9-20020ac87609000000b00398f4bd7c06si79305qtq.50.2022.12.05.20.23.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Dec 2022 20:23: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="gRu/lVny"; 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 1p2POr-0003T8-WD; Mon, 05 Dec 2022 23:17:46 -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 1p2POp-0003SJ-Fz for qemu-devel@nongnu.org; Mon, 05 Dec 2022 23:17:43 -0500 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2POn-0006wa-Os for qemu-devel@nongnu.org; Mon, 05 Dec 2022 23:17:43 -0500 Received: by mail-oi1-x234.google.com with SMTP id c129so15647967oia.0 for ; Mon, 05 Dec 2022 20:17: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=eHbWZNc2e37AaQzsCP2Rz1slFzFOy+tMFTM0BqvuSPQ=; b=gRu/lVnyATgEVBYnNYc02ey5JDwMPFgHnGt8TuaeAv6/RETNF1KSVoujWhjt9cafZ6 WsErLl/qWG4xPeCapSxI4UuimM1j9q4LYzs6UeIqnrOP4BRfPL5NWNqDJlhr6xGHM7bp oSq9x+7aMKPutnO/IqT9vknRGCM2lOmtLTrHIQZqxwVyTWmjipvvEUyUnwVECLaa6JqS TCjCKq+JH3zN/P/vBqmMKD3ONNOfzNGan74qU4puDFZMnrzmKDXr/5cJeRh63GsWXT6g iRM37otQigdLFcR/ZVgiPB9mZpPTRBC8InwLJNwkpYWEMk8FmEeK/zDb8wtLxmVGY/Fl U6JQ== 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=eHbWZNc2e37AaQzsCP2Rz1slFzFOy+tMFTM0BqvuSPQ=; b=e+40tpcl02jSq35iDrQ5HJWxqPpXFxpglWBjBuRHkYBIp/GgES/ENKbwmkAn2L0wmH vOSTp+3X0nHYIh/xK3+rn/HuGjhPt9Adlh9eWMfPYPdAuSz7aLriX8JITUdv+MKEcqyx RKUjzfytGZI4ApSvLTqJ8KwyTVTO9bWU6KUL9bArJyCCRBDkUhY7wd+rwaCRqrIDXLPX RgA/nt+dM3LXwuLcPo5uR//2VYYyxLdI2Hb8tF7n40GRWU8SaqG5v/oUKdOZ5xSPVPRi +hvtbdt/bOPve7/x9cENvEeONhDybL/8Qk3VX8iNapa0nhp8Y5x52catdQs67fu+cUXF VEOQ== X-Gm-Message-State: ANoB5plFjZLsi0/Ko8Adn1zie9FWdEC6HCzHGY67HPUBifp+8/qrqAjX iFO9ndgWkbUSuVLwQXjTecjP4vRMxxB92KDw7IY= X-Received: by 2002:aca:b504:0:b0:35b:4b8c:9f87 with SMTP id e4-20020acab504000000b0035b4b8c9f87mr31281939oif.188.1670300261017; Mon, 05 Dec 2022 20:17:41 -0800 (PST) Received: from stoup.. ([2806:102e:18:70b5:d104:21c2:8c7e:77e6]) by smtp.gmail.com with ESMTPSA id o35-20020a056870912300b0014185b2b3d5sm10162018oae.18.2022.12.05.20.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Dec 2022 20:17:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: r@hev.cc Subject: [PATCH 18/22] tcg/sparc64: Remove USE_REG_TB Date: Mon, 5 Dec 2022 22:17:11 -0600 Message-Id: <20221206041715.314209-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206041715.314209-1-richard.henderson@linaro.org> References: <20221206041715.314209-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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 This is always true for sparc64, so this is dead since 3a5f6805c7ca. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/sparc64/tcg-target.c.inc | 57 ++++++++++++++---------------------- 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 96d58f30b1..1ae9615ef0 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -92,7 +92,6 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { #endif #define TCG_REG_TB TCG_REG_I1 -#define USE_REG_TB (sizeof(void *) > 4) static const int tcg_target_reg_alloc_order[] = { TCG_REG_L0, @@ -439,7 +438,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, } /* A 13-bit constant relative to the TB. */ - if (!in_prologue && USE_REG_TB) { + if (!in_prologue) { test = tcg_tbrel_diff(s, (void *)arg); if (check_fit_ptr(test, 13)) { tcg_out_arithi(s, ret, TCG_REG_TB, test, ARITH_ADD); @@ -468,7 +467,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, } /* Use the constant pool, if possible. */ - if (!in_prologue && USE_REG_TB) { + if (!in_prologue) { new_pool_label(s, arg, R_SPARC_13, s->code_ptr, tcg_tbrel_diff(s, NULL)); tcg_out32(s, LDX | INSN_RD(ret) | INSN_RS1(TCG_REG_TB)); @@ -1014,10 +1013,8 @@ static void tcg_target_qemu_prologue(TCGContext *s) #endif /* We choose TCG_REG_TB such that no move is required. */ - if (USE_REG_TB) { - QEMU_BUILD_BUG_ON(TCG_REG_TB != TCG_REG_I1); - tcg_regset_set_reg(s->reserved_regs, TCG_REG_TB); - } + QEMU_BUILD_BUG_ON(TCG_REG_TB != TCG_REG_I1); + tcg_regset_set_reg(s->reserved_regs, TCG_REG_TB); tcg_out_arithi(s, TCG_REG_G0, TCG_REG_I1, 0, JMPL); /* delay slot */ @@ -1422,7 +1419,7 @@ static void tcg_out_exit_tb(TCGContext *s, uintptr_t a0) tcg_out_arithi(s, TCG_REG_G0, TCG_REG_I7, 8, RETURN); tcg_out_movi_imm13(s, TCG_REG_O0, a0); return; - } else if (USE_REG_TB) { + } else { intptr_t tb_diff = tcg_tbrel_diff(s, (void *)a0); if (check_fit_ptr(tb_diff, 13)) { tcg_out_arithi(s, TCG_REG_G0, TCG_REG_I7, 8, RETURN); @@ -1438,36 +1435,30 @@ static void tcg_out_exit_tb(TCGContext *s, uintptr_t a0) static void tcg_out_goto_tb(TCGContext *s, int which) { + int c; + /* 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); - } - set_jmp_insn_offset(s, which); - 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 { - set_jmp_insn_offset(s, which); - tcg_out32(s, CALL); + /* make sure the patch is 8-byte aligned. */ + if ((intptr_t)s->code_ptr & 4) { tcg_out_nop(s); } + set_jmp_insn_offset(s, which); + 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); set_jmp_reset_offset(s, which); /* * For the unlinked path of goto_tb, we need to reset TCG_REG_TB * to the beginning of this TB. */ - if (USE_REG_TB) { - int c = -tcg_current_code_size(s); - if (check_fit_i32(c, 13)) { - tcg_out_arithi(s, TCG_REG_TB, TCG_REG_TB, c, ARITH_ADD); - } else { - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T1, c); - tcg_out_arith(s, TCG_REG_TB, TCG_REG_TB, TCG_REG_T1, ARITH_ADD); - } + c = -tcg_current_code_size(s); + if (check_fit_i32(c, 13)) { + tcg_out_arithi(s, TCG_REG_TB, TCG_REG_TB, c, ARITH_ADD); + } else { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T1, c); + tcg_out_arith(s, TCG_REG_TB, TCG_REG_TB, TCG_REG_T1, ARITH_ADD); } } @@ -1487,11 +1478,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, switch (opc) { case INDEX_op_goto_ptr: tcg_out_arithi(s, TCG_REG_G0, a0, 0, JMPL); - if (USE_REG_TB) { - tcg_out_mov_delay(s, TCG_REG_TB, a0); - } else { - tcg_out_nop(s); - } + tcg_out_mov_delay(s, TCG_REG_TB, a0); break; case INDEX_op_br: tcg_out_bpcc(s, COND_A, BPCC_PT, arg_label(a0)); @@ -1897,7 +1884,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, tcg_debug_assert(tb_disp == (int32_t)tb_disp); tcg_debug_assert(br_disp == (int32_t)br_disp); - if (!USE_REG_TB) { + if (0) { qatomic_set((uint32_t *)jmp_rw, deposit32(CALL, 0, 30, br_disp >> 2)); flush_idcache_range(jmp_rx, jmp_rw, 4);