From patchwork Tue Dec 21 16:47:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 526620 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp5242635imb; Tue, 21 Dec 2021 09:11:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyySVfr6SY2VsnWV5P+PjPfWun7NHcOq5X/NKr2t7B0D+BWCQq7r5yUEwIecTW6O5BYpwx/ X-Received: by 2002:a1f:a68a:: with SMTP id p132mr1643751vke.31.1640106698161; Tue, 21 Dec 2021 09:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640106698; cv=none; d=google.com; s=arc-20160816; b=M1ncLZQEC0ZMRJxfBttYZpCw2Vyt1TI8+4kxVoOT9EN01qJ7g4OxSGSXZiJa8JX+oT A6jNujUfD887Lj/YgVEpT3fwWo3Fgh2EeBDgMzf7m27EO/zTBYLmCCuCxiBr75JWqt+R ZSWewYAkLWbEt95hgqA35rbVWSzv50o+fm/N5Oyd7nglG9++BiWTEzzq6DX53bLI0ydv iK1hGm+CDF44JAim7zkJspOBbsKCi04EKNI+DBRhHaaTEZDmAyQic5XWZCPxpk2mHpH2 +0FLKTV2pMGBNL1OgJxzlit2lMVFgYjlZJ6tjZAOeTEixG9DhMCC2/mY0RyLjZM6ntOP po/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=NtulYz0vZ5KnXAsfRYqp5VTF0oSZb47z69E1p8MpidQ=; b=D0S5MGDUFwW+yuX02KxtBoC7tFRzLgbblgxBTj5rHzAgWqBGFgGzJAfWH3FlfMKfXg 0tfoQHgy+id3+6zMusP4G77L/hCpJMOxZXpqovLLM/YrUzaDp8cMj8D+cUjviJJHQYPP HlKwhXTpqpG/6YtCzgytgZg9CR4OEuO62RjWSuUv0HA4NruXDBBMQjMomT4x31Q3/Gob sGQcfiPBPuZXbQNpVIdfkXYAezdPzskGzFkq7HBDN5WoE+c7poT7XnoJTVBNXegHSsBo r5ypUd9rsx0UoWHbpOiFC5Leil6mQXM8nU/Tig/MjMURu8Y8d4XeH1PV31aN1NrPxhra imag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tv6V0O3f; 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 i3si1829294vkp.19.2021.12.21.09.11.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Dec 2021 09:11:38 -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=tv6V0O3f; 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]:37974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzifp-0005Bu-KJ for patch@linaro.org; Tue, 21 Dec 2021 12:11:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mziJC-00014e-2T for qemu-devel@nongnu.org; Tue, 21 Dec 2021 11:48:14 -0500 Received: from [2607:f8b0:4864:20::1032] (port=34536 helo=mail-pj1-x1032.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mziJ1-0007f5-Ac for qemu-devel@nongnu.org; Tue, 21 Dec 2021 11:48:13 -0500 Received: by mail-pj1-x1032.google.com with SMTP id v13-20020a17090a088d00b001b0e3a74cf7so2365064pjc.1 for ; Tue, 21 Dec 2021 08:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NtulYz0vZ5KnXAsfRYqp5VTF0oSZb47z69E1p8MpidQ=; b=tv6V0O3fpElQYZGFQcY/jgwB8BAyP/RpdYjZJ6IOF7Jt9m8F8bpC2ky1tZG01a/cNl I9LD2ZG72yRXn7yh+ymOK4JixE1LPmDDJRKO2X4YjzRelfnR5HKUQrgJdmttbMB65AMO aylpirK1D4kcuVYF8YC35/1dRg2g/jc6l3saN2cXUoUdRorZ1gx/I+LJ5ZoOan8XLNMJ AE9XgxqPrpUPV7XKJBnKX+BFsVoU35dY1nCmEWjVhZwOXCnwPm7Sd/z6QDLmViXGZKKx o7qchZ0d1V06yOKwMKfm2f4HQkMkGBHCMYPXDahN72sJWny5a/LBMIM+v55mFcSNC1ex SgNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NtulYz0vZ5KnXAsfRYqp5VTF0oSZb47z69E1p8MpidQ=; b=F/nFkvF2j1TroELRvO1SX4FDuZttWlfqzKpOBYsJ7iwsiL6B69+fWdlCNOfH4LUPZw we5Qu1wfWO1AJKm0UEjYFzN0VFB1R3AYJhPfDr3kSHbknUUSLV2IS/7bH2ou5KP3csdN U82axKlTnktUkHCbPczti0EHjntHz6vtQ8H7D+DqJSikIZc4//F4QUeIe6q6vGlJ6E5u YsD4Zk+GT2121pwgCexlGK0dVXK1lfJVFD9Zzop89oq/Ld322A3si71YSqCLPl/Gc66m sMmn2inOEuBJTziaj5RNiWiWANbwkYGj6dq3jem0oCfxb1ND+DtXNGHN/vsqMNp61tGb ei6Q== X-Gm-Message-State: AOAM533t6xGUigSz9LyNSJwDQXrE3CpB7ONanGeyZ6SzoWFlPXx3zo3A fcN3WwfhsQzvWEwn2jJEUo7WYBL6lV152A== X-Received: by 2002:a17:903:1cf:b0:149:b6f:4e98 with SMTP id e15-20020a17090301cf00b001490b6f4e98mr4199167plh.118.1640105281913; Tue, 21 Dec 2021 08:48:01 -0800 (PST) Received: from localhost.localdomain ([156.19.246.20]) by smtp.gmail.com with ESMTPSA id b192sm2256818pga.35.2021.12.21.08.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 08:48:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 25/31] tcg/loongarch64: Implement exit_tb/goto_tb Date: Tue, 21 Dec 2021 08:47:31 -0800 Message-Id: <20211221164737.1076007-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211221164737.1076007-1-richard.henderson@linaro.org> References: <20211221164737.1076007-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1032 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: WANG Xuerui Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: WANG Xuerui Signed-off-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20211221054105.178795-26-git@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 0b7d6458c5..92a30b791a 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -980,6 +980,25 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, int c2 = const_args[2]; switch (opc) { + case INDEX_op_exit_tb: + /* Reuse the zeroing that exists for goto_ptr. */ + if (a0 == 0) { + tcg_out_call_int(s, tcg_code_gen_epilogue, true); + } else { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_A0, a0); + tcg_out_call_int(s, tb_ret_addr, true); + } + break; + + case INDEX_op_goto_tb: + assert(s->tb_jmp_insn_offset == 0); + /* indirect jump method */ + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, TCG_REG_ZERO, + (uintptr_t)(s->tb_jmp_target_addr + a0)); + tcg_out_opc_jirl(s, TCG_REG_ZERO, TCG_REG_TMP0, 0); + set_jmp_reset_offset(s, a0); + break; + case INDEX_op_mb: tcg_out_mb(s, a0); break;