From patchwork Wed May 3 07:22:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678789 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp917091wrs; Wed, 3 May 2023 00:51:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6CSpw6dECtZupI5V3aDEol/WFSqlnJUy/ar1McQYfHyb8JPaDIcig2KfIqXjMxoGAm6zf6 X-Received: by 2002:ac8:5fc2:0:b0:3db:9289:6949 with SMTP id k2-20020ac85fc2000000b003db92896949mr1685841qta.3.1683100264371; Wed, 03 May 2023 00:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683100264; cv=none; d=google.com; s=arc-20160816; b=M4fxWpER4IqzgmRZzx5nrlbCYmejmMXnH1xRYd677XLJrDPNcLVwVD7wi9qKkZrGd/ UeeXUYKipctsu/ahYnfShbbWmpaB0HmYtn4Pijhq432dez2MzstnCjZ+0OrhyvuM2mby vbm90BNZJFVzwDDpplnl8t7MwJEQwBTBqcbGuDHz/ZK0ScTjCmncFvM3VtTuDWVxQrQt sbtqTP+qZT1GuWwh3Uq5CwDZpGr3D5eoaSfq3KsPIH8gJwADx2mAnePDvvM72FhU5RTi d6wCth8Vjd9x4mfzehJVeOrH5gbhw7hvJVnLIKEYkYtzqfStU0r4Q9ffZ40bdlAg1R/5 1dNA== 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=xd2AyLWHfL7nMXWfsFoMvsK6i0qMKcBbZmk4IdtvNsM=; b=PrjjiAw2N7E+7dgnN/Nxx7WByb5LhnAyjyKN+p1WenGogrOmZkHQ3IeNB9Rc6A/PPv SM6ns4nSnGT/CKu9sr4vQ3pR2JCh0/4N3g9yiXUqza179QwPmDYAsKk6jk1vG7jKqITZ ypSPj9DTM9bXIN91OIpxzFRnnhfbEVkL1E35Vri2/glO9kzfuYsXPx08JMCNynelPHZG P7UuskHCKFzv+v7q8doiC6igZkHZeU/LvsVujewA9gYNB0IZy2zhC0wvfKYcRp3g6C5w ENT7gQnylYhJMfdPUhkRbUpwmrIXKJc76IXOsi/e6BbqVlB9iohsPEGm7IzVbows886w WQfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wE44yUeH; 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 13-20020a05620a048d00b00751324d4fbdsi7281583qkr.379.2023.05.03.00.51.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:51:04 -0700 (PDT) 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=wE44yUeH; 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 1pu6tV-0004Ye-LB; Wed, 03 May 2023 03:27:21 -0400 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 1pu6tN-0003xf-6T for qemu-devel@nongnu.org; Wed, 03 May 2023 03:27:13 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6tL-0005ce-1O for qemu-devel@nongnu.org; Wed, 03 May 2023 03:27:12 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f1738d0d4cso29149925e9.1 for ; Wed, 03 May 2023 00:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683098829; x=1685690829; 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=xd2AyLWHfL7nMXWfsFoMvsK6i0qMKcBbZmk4IdtvNsM=; b=wE44yUeHbqWR8Jb0P0N0wZ+UaeQwSFrInRzHDtsItoduMMCYFWNp22Db987HKsoaKJ cY8ACIqJ3xEHnVEYBeMZHX9FWlMONUmCSOdJ5PGBK5jpTBAjzj7bQEvbU4LL4w7G1K2B WPM35CSzIpBBHzB5zBquqC5u70SCxr5awAUwMqFoDRxZ7kCBl9c12blUrNGdJmz4s1w4 oPgDysDD6hUXFiv5trPxI3IlZBMShKcP70A/hNGFi+7ruDTruR9qbb6y5aogFgC2uFlm CAPiW4u2u/DlL2R9nJAtw4aX1Vam6tyzZ6lkmI1e5Er2QC5rEUqcDI0KTwQoY20M9CD0 dzeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683098829; x=1685690829; 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=xd2AyLWHfL7nMXWfsFoMvsK6i0qMKcBbZmk4IdtvNsM=; b=E3Ql9PDfHvlIDSPPptxlMxZ+0RxB/LrwtGv7m1ER6f0OLaGWxdXoz1nKCc3FrCgjRT 7k5r3U8PCQzGVgiZ3d9eqJBBEH8UrRrDxnmky+8QkyHa6E1/+/kT8fl6MKJoj7DtH0ek LLkASr3QC2I14iOoqLuBQgXlxd0SS03J/ejln89+FkFfMAPLY351LtQsy0Kp2vHq06sM eov/QEipbUrMtnRkU0jge49RorCsoI4AKaXw8IFa+6wEHC+bxmpOHbP/aLaJbjAv3wYR ScPP/VVvZkxr4PATciz1hW+kRV7PjClheRYxmwCjUlHfBzaybjmpmzp2pEkLYiLJChSM JRbg== X-Gm-Message-State: AC+VfDyJNzW6SaGxI6PnqcehkEqIJOa+UX1ATUxqwTEXN0ryqjrKIC9G wMkarcuoafpoUypWylBfY01CUjYUVrNxKnvs9GeCbg== X-Received: by 2002:a7b:cbcb:0:b0:3f0:310c:e3cf with SMTP id n11-20020a7bcbcb000000b003f0310ce3cfmr13355611wmi.37.1683098829148; Wed, 03 May 2023 00:27:09 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id t4-20020a7bc3c4000000b003f1745c7df3sm974315wmj.23.2023.05.03.00.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:27:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: ale@rev.ng, philmd@linaro.org, marcel.apfelbaum@gmail.com, wangyanan55@huawei.com, anjo@rev.ng Subject: [PATCH 48/84] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info.h Date: Wed, 3 May 2023 08:22:55 +0100 Message-Id: <20230503072331.1747057-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503072331.1747057-1-richard.henderson@linaro.org> References: <20230503072331.1747057-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x329.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, T_SCC_BODY_TEXT_LINE=-0.01 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 will be required outside of tcg-internal.h soon. Signed-off-by: Richard Henderson --- include/tcg/helper-info.h | 59 +++++++++++++++++++++++++++++++++++++++ tcg/tcg-internal.h | 47 +------------------------------ 2 files changed, 60 insertions(+), 46 deletions(-) create mode 100644 include/tcg/helper-info.h diff --git a/include/tcg/helper-info.h b/include/tcg/helper-info.h new file mode 100644 index 0000000000..f65f81c2e7 --- /dev/null +++ b/include/tcg/helper-info.h @@ -0,0 +1,59 @@ +/* + * TCG Helper Infomation Structure + * + * Copyright (c) 2023 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef TCG_HELPER_INFO_H +#define TCG_HELPER_INFO_H + +#ifdef CONFIG_TCG_INTERPRETER +#include +#endif + +/* + * Describe the calling convention of a given argument type. + */ +typedef enum { + TCG_CALL_RET_NORMAL, /* by registers */ + TCG_CALL_RET_BY_REF, /* for i128, by reference */ + TCG_CALL_RET_BY_VEC, /* for i128, by vector register */ +} TCGCallReturnKind; + +typedef enum { + TCG_CALL_ARG_NORMAL, /* by registers (continuing onto stack) */ + TCG_CALL_ARG_EVEN, /* like normal, but skipping odd slots */ + TCG_CALL_ARG_EXTEND, /* for i32, as a sign/zero-extended i64 */ + TCG_CALL_ARG_EXTEND_U, /* ... as a zero-extended i64 */ + TCG_CALL_ARG_EXTEND_S, /* ... as a sign-extended i64 */ + TCG_CALL_ARG_BY_REF, /* for i128, by reference, first */ + TCG_CALL_ARG_BY_REF_N, /* ... by reference, subsequent */ +} TCGCallArgumentKind; + +typedef struct TCGCallArgumentLoc { + TCGCallArgumentKind kind : 8; + unsigned arg_slot : 8; + unsigned ref_slot : 8; + unsigned arg_idx : 4; + unsigned tmp_subindex : 2; +} TCGCallArgumentLoc; + +typedef struct TCGHelperInfo { + void *func; + const char *name; +#ifdef CONFIG_TCG_INTERPRETER + ffi_cif *cif; +#endif + unsigned typemask : 32; + unsigned flags : 8; + unsigned nr_in : 8; + unsigned nr_out : 8; + TCGCallReturnKind out_kind : 8; + + /* Maximum physical arguments are constrained by TCG_TYPE_I128. */ + TCGCallArgumentLoc in[MAX_CALL_IARGS * (128 / TCG_TARGET_REG_BITS)]; +} TCGHelperInfo; + +#endif /* TCG_HELPER_INFO_H */ diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 67b698bd5c..fbe62b31b8 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -25,55 +25,10 @@ #ifndef TCG_INTERNAL_H #define TCG_INTERNAL_H -#ifdef CONFIG_TCG_INTERPRETER -#include -#endif +#include "tcg/helper-info.h" #define TCG_HIGHWATER 1024 -/* - * Describe the calling convention of a given argument type. - */ -typedef enum { - TCG_CALL_RET_NORMAL, /* by registers */ - TCG_CALL_RET_BY_REF, /* for i128, by reference */ - TCG_CALL_RET_BY_VEC, /* for i128, by vector register */ -} TCGCallReturnKind; - -typedef enum { - TCG_CALL_ARG_NORMAL, /* by registers (continuing onto stack) */ - TCG_CALL_ARG_EVEN, /* like normal, but skipping odd slots */ - TCG_CALL_ARG_EXTEND, /* for i32, as a sign/zero-extended i64 */ - TCG_CALL_ARG_EXTEND_U, /* ... as a zero-extended i64 */ - TCG_CALL_ARG_EXTEND_S, /* ... as a sign-extended i64 */ - TCG_CALL_ARG_BY_REF, /* for i128, by reference, first */ - TCG_CALL_ARG_BY_REF_N, /* ... by reference, subsequent */ -} TCGCallArgumentKind; - -typedef struct TCGCallArgumentLoc { - TCGCallArgumentKind kind : 8; - unsigned arg_slot : 8; - unsigned ref_slot : 8; - unsigned arg_idx : 4; - unsigned tmp_subindex : 2; -} TCGCallArgumentLoc; - -typedef struct TCGHelperInfo { - void *func; - const char *name; -#ifdef CONFIG_TCG_INTERPRETER - ffi_cif *cif; -#endif - unsigned typemask : 32; - unsigned flags : 8; - unsigned nr_in : 8; - unsigned nr_out : 8; - TCGCallReturnKind out_kind : 8; - - /* Maximum physical arguments are constrained by TCG_TYPE_I128. */ - TCGCallArgumentLoc in[MAX_CALL_IARGS * (128 / TCG_TARGET_REG_BITS)]; -} TCGHelperInfo; - extern TCGContext tcg_init_ctx; extern TCGContext **tcg_ctxs; extern unsigned int tcg_cur_ctxs;