From patchwork Fri Dec 30 00:02:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 637860 Delivered-To: patch@linaro.org Received: by 2002:a17:906:1189:b0:7d5:1b03:224a with SMTP id n9csp4174739eja; Thu, 29 Dec 2022 16:23:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXuGIOPVsyAT+6lNXo7OSmDcK0rpHHV6vuc6XvRXi1kdy49jSMebwuCS4XEnxIPDFT+XUjoD X-Received: by 2002:a05:622a:250d:b0:3ab:5f5f:b7c4 with SMTP id cm13-20020a05622a250d00b003ab5f5fb7c4mr44757775qtb.24.1672359838210; Thu, 29 Dec 2022 16:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672359838; cv=none; d=google.com; s=arc-20160816; b=HocQi0HjZub3l2QvvzpkbK2cuPulLNE5SxlbXP0k7jkoqFRT3HpT1ly6VBHLz2Wul1 5E0YUkkHLiWdyJqcc+C2rouYge5St11Ib6QLF3V34BOSKpwdDIw5mmZkfQXIXLMHz0u4 egkfLqdP4lDjbtKIC7/fO+5gWx9/DMeuDlCJtO/WJemb9uyORDpgdQd3l7MY1OytrGFv f+Lw1Z2DgcByDB6J+RMJ+2hTeqM1yhszp3Efm13tYJngg9hKnGphI2c65PoQT0PpvLZB NGfGq8jta5jJ88ohCte5mvVSDqTNMGof5A25wtQnII/KzNxhWO5TCQEqfYl/T5FXicjD Soog== 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=tz8pxyjZBQm1+qEjyv1TGYW3iZ6MjviUhbwrA5+bw+s=; b=KCPlhl9VL90gIOMaOnC2O1B698y0C0O09ZcX8NM7fVR35iWYp+CPjJKXVE/F7ZqmJq NNsr8bhCtMz4cE4uTpMyHMBBFPihueC2euAM2muQataAadS7his1CcmqYFUZffRfCY27 wjWEmFnaMOHpGHdVCuOLTi4r9zQXbdz4jgwaAXmH7K667g/wHW497zg8QizTQw2GSmQZ ZcljW91rjiyzwGeCwKcV9NTESUrAAhfYR1bLh3SLhUCKAn92T72VUGl2HBE8iAATEpCR vwRrBJQu+bzuL2LDjKLSQaqziJlv2rx5SD/VuJ/ikNKWgyPm7SDx+qwxgUt9ec5kQoPn /5EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jtjyBhhY; 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 x5-20020ac87ec5000000b003a7e516e60bsi8835670qtj.643.2022.12.29.16.23.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2022 16:23:58 -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=jtjyBhhY; 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 1pB2sP-0003uT-Nb; Thu, 29 Dec 2022 19:03:57 -0500 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 1pB2rU-00039C-Gz for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:03:05 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pB2rQ-0002hC-75 for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:59 -0500 Received: by mail-pl1-x62d.google.com with SMTP id m4so20371210pls.4 for ; Thu, 29 Dec 2022 16:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=tz8pxyjZBQm1+qEjyv1TGYW3iZ6MjviUhbwrA5+bw+s=; b=jtjyBhhYno77HM+F5eUBjZ1SuFTej2CgJ2OxswNr/q3OM0VwdYq6OViQLsSvh5Sxoy xCUHZHUDQ6d69Cqi4ob4aM6qoLtXQeuKZD/mxuVtcBwmK13u4OYalfXQKZTbY4Y34+jF bwFbBC30kj+Wowrz4EdS2HXBj2JdH2GXi7DSo3/EJX509If63sRObPREkImSaKfVj2Jf 0sLQsQg4FA9vECcG8xcEvsax0+zNtL4OMU6ejn5EG1O9CvZ/RoRZJCwYerpII9EQ8sxt TVgvQIESgHAYi/LPy+ylbgwQf5pyYgiLSw+bOpXK38QVkwNtPf//bLh17150hnpf3ML7 bpWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tz8pxyjZBQm1+qEjyv1TGYW3iZ6MjviUhbwrA5+bw+s=; b=bwdgdapTQAWwenu/3mCfQPQYNKKFHnq/Dl5dm20w3h4gOW2wtYjmOtUPSZvhAQkBrD Iq5Ke6udLy9y7N8Wp07yJjRku4a2UrQC7eSu/UWs6dKK5hjq/8Xyvii2Zeux2+g76zYc 4IETnz76pIVHRaN4Xkng5VnPyVrPKy/BuvTHsggemqkSnqeT5Xc4+PgECslsUYaj5NV7 JeV+X7KNsQzz5nXd072dgWpKJUxJGshuTvIGBwNuuLPoDqvKiewGJku12DP2WQf81FU7 jlZHp7cndql6hiH0CgdcZuzsWtJgMzZa3Jg2M3j3PN5ZrzGvdMH1QpQIAFv+mK4EKiUk Pzcg== X-Gm-Message-State: AFqh2krIrXWMHbDkSnI9ROeX3ix9aG0xHNelwlrrfBAANigWDLAkekMx tMCIFB9mDGxd6MffnlxofBWG/TjKc7SsLwpE X-Received: by 2002:a17:902:7805:b0:191:bb:c207 with SMTP id p5-20020a170902780500b0019100bbc207mr29946525pll.37.1672358568802; Thu, 29 Dec 2022 16:02:48 -0800 (PST) Received: from stoup.. (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id j14-20020a170903028e00b00192849e1d0asm7343953plr.116.2022.12.29.16.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 16:02:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PULL 28/47] tcg: Introduce TCGCallReturnKind and TCGCallArgumentKind Date: Thu, 29 Dec 2022 16:02:02 -0800 Message-Id: <20221230000221.2764875-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221230000221.2764875-1-richard.henderson@linaro.org> References: <20221230000221.2764875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 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 Prepare to replace a bunch of separate ifdefs with a consistent way to describe the ABI of a function call. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 2c06b5116a..f574743ff8 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -27,6 +27,21 @@ #define TCG_HIGHWATER 1024 +/* + * Describe the calling convention of a given argument type. + */ +typedef enum { + TCG_CALL_RET_NORMAL, /* by registers */ +} 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 */ +} TCGCallArgumentKind; + typedef struct TCGHelperInfo { void *func; const char *name;