From patchwork Mon Jun 5 20:15:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 689261 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp2288356wru; Mon, 5 Jun 2023 13:26:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48oBsesD6bNguOa0Bb4iLv4hcFnZFSuhnbZ8pR5egs/fmKnkSCQs3nXT23KfCvfJqZ9WO7 X-Received: by 2002:a05:620a:1b8f:b0:75d:59f0:faf with SMTP id dv15-20020a05620a1b8f00b0075d59f00fafmr978015qkb.63.1685996782584; Mon, 05 Jun 2023 13:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685996782; cv=none; d=google.com; s=arc-20160816; b=wd3LxiEsE5pY1/Kn+wlcM4w0q44dV1zHaS4bVPHUG3aeA/KYU3DqNTJo6Y8EQXzxAY mn7dSZW9QMEaG5hGbtcpNaib2pMPiv1H4p38tK/EC5jf8TNQfDDrlq6mZzBc4nvmeQzl jBczesDfzsL/6sdXREWtZ4wvp4Y1P7lOqSqAh02BQ3kGq7K7GtMZOKjd/RFg7cqF2jWI ZEXU/CkSLPjyHVAooxr8WR/eGMwZ8gvyAm4G4MDukSGPykihhDaO7cEgs92GbJQZCzK3 FmNqOQf66LO08g51bsIH4OsrKybSlI43R/NCiFwwKa5z6fvz9qHK69gO4ynXzMCt3b3u s8Qw== 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=mywdJxLuV7PbxTU1NspN1+FQdPIaeeESk+yMp9Ce2bA=; b=tF886zd/P7Uktr/KCFuzYBn4l1z3nT96KnfIQTjewl2G+LOZBEqF8M9G/GOrQA5uhP MuLFLkllCK9KWBAJ3n0D7TXwVCuibZPeUn2YqVRD0tIOc3GQzhHtLM58kEHpgcDstmwm T8P0EVsitkEomV3FDP0pnLVIoBfOD6rx3VrQxYH37XeAzcpVYnTeVuGdMCuik5mQXbEE OBsKQSEljWM6Qn/WJgL+G1WkLYD52z7hOMewBpSaAOA//mzUwgDGFLwWqgLY38OXaRS/ p87wfxjzi/T0OhThSwKk2QtWw5rf4bRWtPf+9hBeEtBx5Ak2gw91mpqppT3dwW9/8m3Q agKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ne2EJgQJ; 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 r16-20020a05620a03d000b0075eb9d6a047si1349528qkm.270.2023.06.05.13.26.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Jun 2023 13:26:22 -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=Ne2EJgQJ; 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 1q6Gcf-0001u6-Ru; Mon, 05 Jun 2023 16:16:13 -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 1q6Gcc-0001s3-3T for qemu-devel@nongnu.org; Mon, 05 Jun 2023 16:16:10 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q6Gca-0003wa-6B for qemu-devel@nongnu.org; Mon, 05 Jun 2023 16:16:09 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-651e298be3fso5056734b3a.2 for ; Mon, 05 Jun 2023 13:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685996167; x=1688588167; 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=mywdJxLuV7PbxTU1NspN1+FQdPIaeeESk+yMp9Ce2bA=; b=Ne2EJgQJc91woigRXHaEw6Hn1TEkPlABz93ZqqsimW7irJ1rFWXslUXDpxQf0EY/du /4T7rDbI6HhNjuA9ADtrzrj2P7ArgRpdZfOB8jfCeBQSaZbWB+cZ/L15a/xNAtAhNPgx bgaLqMbRxrf+CK6G6CvoW6yjOzrfx1jRQ49z8FIuJumPQUM2Yh8VubToD+6YQFvEy85t Lg5VW/Ul1M76LUW+1iPTZHRsmo+xPOxABMjf7GmB5R1o9hrO9VIWIXe8nigfqvPWuAUS 8/I3C8CXwqhy5vMbDYxyZm2mWeskf7PT5r+P3c57CiCIWhxLD/RmeGl7Yr12yQCtpDJ9 0LoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685996167; x=1688588167; 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=mywdJxLuV7PbxTU1NspN1+FQdPIaeeESk+yMp9Ce2bA=; b=UNBLoEMeCrfq0hlpteCWEN4knoa9NHL9coIjCqcg61iJlIlrgOdVOWe8CO5fuOAoeg eheRA9ISZWeTYUMDELmctTWaJBUPjL2yZrT71vYFxBspvKZ4fTBGAL4MTSpQkavhCuyx hmXoAjGERS3KNqleKTac79XObymlFdmKORxCUuzE2wmVokv6MkR7OTWr9XrjuCXZGolt hCnj1R2CJfARm1gaDjEHt9162smcGTPUY+QZDcvCwhMLHsEN3o/onxFZONBWXIocTJ94 5qzkVMur7WtW/ZoIvUr/NubXWoqNiUEaRq6zsnioDx9bJkvYWgBgqh6rhyX1/ZwcgV6/ J7wA== X-Gm-Message-State: AC+VfDx3Dl9vk39eskrVMYem0dykUKSAZgFJtjulIP7QznvYNlOcwZq7 gzQ3cL9+s+RWjpGJ4PyZROK5B9aqr5xAucZj0sM= X-Received: by 2002:a05:6a00:24c9:b0:64d:277c:77c3 with SMTP id d9-20020a056a0024c900b0064d277c77c3mr855607pfv.23.1685996166902; Mon, 05 Jun 2023 13:16:06 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:3f85:a600:6a3e:e465]) by smtp.gmail.com with ESMTPSA id f18-20020aa78b12000000b0064d32771fa8sm5552924pfd.134.2023.06.05.13.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 13:16:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 19/52] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info.h Date: Mon, 5 Jun 2023 13:15:15 -0700 Message-Id: <20230605201548.1596865-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605201548.1596865-1-richard.henderson@linaro.org> References: <20230605201548.1596865-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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. Reviewed-by: Philippe Mathieu-Daudé 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;