From patchwork Tue Dec 21 16:47:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 526613 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp5234779imb; Tue, 21 Dec 2021 09:04:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNI+rTYkCu61VPVTp6l/euSwCBfaZ5N1pCypWg2mGbhMYYcwBO37B2TAhHA3phu4akvJvn X-Received: by 2002:a05:622a:110e:: with SMTP id e14mr3030597qty.419.1640106252806; Tue, 21 Dec 2021 09:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640106252; cv=none; d=google.com; s=arc-20160816; b=SMvxGhT/vQzPDjbdkNaghPDF4mzE+bTQ9vVzSE+vnCP2dRdxF9yYg4z1IQ2EqKDVxc 9jFIAOUXpRJ+Cy9CEUq8eW6ZeU7zndWWS+pONyO1s5pbhuSORrSpv045PT0u+FEoldRq 8OLF4E7g8yGjAE9Z+kyOA8NoiEbHtff4qQNo6k4ALkdNw5LkcY6B4IfDJZhLiSlktaz/ lXwgElVjFBcTm95EQBVUhVf5twiQ7i3YHq9n8Yco/SNuIjzf5DWEmM1ErtEa8isYmhxp ubQUI7s+R9vMv/wIt5QNTsfEEDBiKltDP9rCs5E+Ci3qpSDG5WZIpvt4RxiyvxLpfPUX 7O7w== 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=aRDFGEdRx4gKiMYB6nK14fb+uw0O+ZvZTgYpZPI8a7w=; b=FkPO6CJd1KAaPSEp0nIxLOd5icO/i9RTABjduRvMfDUu6zMdw8f+wPAgayDt7CO5W/ jzXO9/gmaBRn8R6UkZI21GIs77f2xUeWDR0KHJE+wRu9J95dj3avXNWlwWOc9+k1dy5X ezaA3UVEBxR69IselwVY757zYl1QBpXmfsGxy5Cwx6pUgsP2PGLUXCm4L1AMiDOSOPOV 3OP0IlUdZ+PuhYo52DE6itKvBTt+8SqYa8jk9pKzaidjA/e2v2qhS4BL8i/sa7lnR1Pu eKzaOhZB6rHIGDKtIVmS5WFpN15pRs/TG1jqN1BVajrLhBaKIkAi3DZIjVEt7CQxyF75 NHPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MGaSxePd; 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 az30si7779964qkb.487.2021.12.21.09.04.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Dec 2021 09:04:12 -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=MGaSxePd; 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]:46570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mziYe-0000GW-9O for patch@linaro.org; Tue, 21 Dec 2021 12:04:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mziJ6-0000n9-GY for qemu-devel@nongnu.org; Tue, 21 Dec 2021 11:48:08 -0500 Received: from [2607:f8b0:4864:20::536] (port=42676 helo=mail-pg1-x536.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mziIo-0007cT-Oj for qemu-devel@nongnu.org; Tue, 21 Dec 2021 11:48:08 -0500 Received: by mail-pg1-x536.google.com with SMTP id g2so10253043pgo.9 for ; Tue, 21 Dec 2021 08:47:49 -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=aRDFGEdRx4gKiMYB6nK14fb+uw0O+ZvZTgYpZPI8a7w=; b=MGaSxePdYAS/uXlXuM0qZlv8vJBVxV1z90+Sv7DOmk6i37ypInUejUYZgytpU71qG+ cM8GFtAb4cebn7tu4mbX7oFhCtN+dh0skr863kd9jnO7Wl5U4po8eo4B6L0CFT2oCmZb 55KdzeBqwjHqUaPTXKeRHuihvprlLYhPfwTI+DFmpNI6lDRTZKLXwJlm+D7cQcgPC9M+ pvQbq69rMZOuSDl7172AbOO1qh2hLfxZZfnpIeSVAZ/yMdIUC9rVzQ/Hlw0eO/Fbko0o NhiO1nDheLkOnk4yS10NFvv5D3aaLgaScxkcFPKfbd4zTPb5pUuT6RiZVemh+KCvArSi StjQ== 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=aRDFGEdRx4gKiMYB6nK14fb+uw0O+ZvZTgYpZPI8a7w=; b=KtD3s0e1a0KloODmNyAhkooI1gopnoXVacX6DmQgoCWHEHVAoROTRfhEDQuHYuHg1p x0HnG05WhVHWhJgClsAsWZiUiqWvL0brySzqdZ1FQlN9JeW3oInsmFtv+dI2ViKG+5iP 29Sd43P6sVmPTJEByh3P9+Gq/uHzlkl1FwF1U0IbiY4c5XRfJkxNJMR7myYD0WAaDIW0 dqTx4wYcQC2rQKmVx87ZKeWbLZkpnAm4rszugTDK9RDiJfiF0zcxvXS/IBGuD0gE86w2 bbThd0/s6T0q+WOihBwukheou7YFyy2bNd4OWUZjmm6jfRt+rkwGWfXxSoE9BLOXFEpT 3vvg== X-Gm-Message-State: AOAM530ckuZZGuS/oCmmZ+CIFO7nMoUF0gNX3SIFePSuDFaqHgvpjIMK x44FnJPuIsXLKisWCU2IlXnhe0EQMLNdVQ== X-Received: by 2002:a63:f30b:: with SMTP id l11mr1453872pgh.272.1640105268253; Tue, 21 Dec 2021 08:47:48 -0800 (PST) Received: from localhost.localdomain ([156.19.246.20]) by smtp.gmail.com with ESMTPSA id b192sm2256818pga.35.2021.12.21.08.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 08:47:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/31] tcg/loongarch64: Implement goto_ptr Date: Tue, 21 Dec 2021 08:47:16 -0800 Message-Id: <20211221164737.1076007-11-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::536 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, 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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211221054105.178795-11-git@xen0n.name> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 17 +++++++++++++++++ tcg/loongarch64/tcg-target.c.inc | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tcg/loongarch64/tcg-target-con-set.h diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target-con-set.h new file mode 100644 index 0000000000..5cc4407367 --- /dev/null +++ b/tcg/loongarch64/tcg-target-con-set.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define LoongArch target-specific constraint sets. + * + * Copyright (c) 2021 WANG Xuerui + * + * Based on tcg/riscv/tcg-target-con-set.h + * + * Copyright (c) 2021 Linaro + */ + +/* + * C_On_Im(...) defines a constraint set with outputs and inputs. + * Each operand should be a sequence of constraint letters as defined by + * tcg-target-con-str.h; the constraint combination is inclusive or. + */ +C_O0_I1(r) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index bb45ea0fcf..3a8c52465b 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -397,9 +397,24 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_mb(s, a0); break; + case INDEX_op_goto_ptr: + tcg_out_opc_jirl(s, TCG_REG_ZERO, a0, 0); + break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_mov_i64: default: g_assert_not_reached(); } } + +static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +{ + switch (op) { + case INDEX_op_goto_ptr: + return C_O0_I1(r); + + default: + g_assert_not_reached(); + } +}