From patchwork Tue May 23 13:52:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 684969 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1737670wrt; Tue, 23 May 2023 07:05:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CBtT9g7khByRMwVkmd5NE9cYZrDRjhwlxvsoObNj2RFSEPH87IvfE7JvNNsQUfuYJ7loq X-Received: by 2002:a05:6102:f88:b0:434:8540:377 with SMTP id e8-20020a0561020f8800b0043485400377mr3982380vsv.17.1684850720325; Tue, 23 May 2023 07:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684850720; cv=none; d=google.com; s=arc-20160816; b=jrHIWeVF8zD7LNs8YZYLOHT4yVwrqStLF0at3pLByRcEOFN1DFq1O9gJ7MNtsJbF4J De/leQwWkQn4bJEWKqyGCvz6McoNCrPswfgFxC6FJQ7SIJ4gwTZdFg9pCdwutBJzz6Ck r5aCzAR+KAdfWuyVJ7Z3UfZg1rIR42rqddE6ukSrTd5kYKempE6nekbSQbRfU+8XggrE IzYhbH+Bcoaw+Bp+botmSjqsYa2B5/P5A/hgKkltLWJWMknNLeo6+uLBsB2jRVfnSLYT ckoipuYvVSx8niL25OM+bBrf5OCCX/hnegGXwzi3a2P6oeRnuIhj7/QsQHBQYwFp6VoK I4Fw== 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:to:from :dkim-signature; bh=xd2AyLWHfL7nMXWfsFoMvsK6i0qMKcBbZmk4IdtvNsM=; b=zd8qh+4iHkAv2ECCniTAxeZ7tw4DxIy6yG21s+5X2jaFQhBv2O2fozajG22F0KkRxd 0Wl/5i6IYsrqcgHDBFuLMcQtM82YyNd8/TbT6njxAUdaScynGb0E2qKvx9/cjVXbcbTC dfP6bXA2QnW7Kx2iVmge3JAZYnZotyoATUeIKQ2YCgmIe/L6uJvJ+DwAS3MKP/mBQUZy /XenNmumOGumLvBL9olrpYu/SV0IotaDTvzLtEfLMuKQc5Ot2dWeZbmHDH2a140+TzjN O7sqMjeENwlHIM+HCFGZ1imU1cHSNJH80n6pKFQsX2z5xpW9Ph72Ia7MqCFyqpXFAgex JR2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N6EAj0dT; 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 g9-20020a67dc89000000b0043475e6d2bdsi784634vsk.88.2023.05.23.07.05.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 07:05:20 -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=N6EAj0dT; 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 1q1ST5-0006U8-Bc; Tue, 23 May 2023 09:54:27 -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 1q1SSO-0004zc-9n for qemu-devel@nongnu.org; Tue, 23 May 2023 09:53:45 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1SSM-000344-33 for qemu-devel@nongnu.org; Tue, 23 May 2023 09:53:43 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-64d57cd373fso2121930b3a.1 for ; Tue, 23 May 2023 06:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684850021; x=1687442021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xd2AyLWHfL7nMXWfsFoMvsK6i0qMKcBbZmk4IdtvNsM=; b=N6EAj0dT8RVX36gl57F8SVJxaAvf92l6swqOEW+BwPfafKlxMnD+bDGsCET4mr57Js tDkf8SBXaZ4LxxVZpdgkgyt5GXN6zldRNLtiqawlEL+5QfRB7nm6h1SWccHmE+erpX+E hrE104bKspdSYUMQuWWXdX/iQXUhp52OPfDhNYR1MuNn168NmqODlUQURvBFcaC18ly5 WkVzcVv/svw4briMsr7vlPpluGm87CDW+arRkO2ZdaQ9KjBS6VxQnq9C5TGhzetBtN6r sR33cJ+wHWPV7kKO7QorC+55ViSjtGpp4Bzu6P+GUA4NmYfmPjvlTvNEGa8Bp1ntRUPy NVzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684850021; x=1687442021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xd2AyLWHfL7nMXWfsFoMvsK6i0qMKcBbZmk4IdtvNsM=; b=E7mrmtOVUC21jfPvvI3ezXh1D25oICKfMwyGl57At2IE/r513YGKAvdcLmqO6E9MJA T6BlTq8YdnqvwJy3GrN1NrqCtyb7fQ+Iwhty+BMN3bZBoehyrov9CVcu464ODo9qp6ts nOlro234LpNiJP1hC7qtYmapKlgMt9PrEgT4syYTqV6iKeokgFm/7oVrTq8X0ZGkf4xi 6YFUg7dciu5dg9qmSDH3c1gEuLhVCPmWagwdU38AozEsIPWWaoR6FoajV12/5zC9f97T BPMa9QPH22IgDPAFtub0ztK7eXVsR6nbKmJk/f1APJXoODW+gnVgR1qiz332/AW4aPnS QFbA== X-Gm-Message-State: AC+VfDxL5N6wxZaP0uWZZG9ZTvEdv33+7N0Zt7wP+u35PwGa5myhn5av ItdEmCH2xk978mdcGmoSadel2vpvVTZ5LMQ/uaI= X-Received: by 2002:a05:6a20:938e:b0:10b:60c1:2999 with SMTP id x14-20020a056a20938e00b0010b60c12999mr8071407pzh.22.1684850020785; Tue, 23 May 2023 06:53:40 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:c13a:d73:4f88:3654]) by smtp.gmail.com with ESMTPSA id b8-20020aa78708000000b0064d27a28451sm5796111pfo.100.2023.05.23.06.53.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 06:53:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 20/52] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info.h Date: Tue, 23 May 2023 06:52:50 -0700 Message-Id: <20230523135322.678948-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230523135322.678948-1-richard.henderson@linaro.org> References: <20230523135322.678948-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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;