From patchwork Mon May 30 16:05:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577211 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp391754mag; Mon, 30 May 2022 09:31:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzycgvYrP6Qx3jgwXIcc0QhenE1va11Yew660JGqKIsO+XUcvb+sxCkG1VuB2rviWvW5Qq X-Received: by 2002:a05:622a:1a21:b0:2f1:f29e:40a with SMTP id f33-20020a05622a1a2100b002f1f29e040amr43960495qtb.235.1653928314206; Mon, 30 May 2022 09:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653928314; cv=none; d=google.com; s=arc-20160816; b=MqkuAZ/O7D4nszLxAH2VEWhnmTNcr2k/j/O/0zx7dqt+c93eT6UrQVU6kBVTXCudjJ w5Jmv0HGlF6dhqLt3t9eSjHpsKW3JG7pZQ1Y+IeWvvAxqg8d8phegq41eeg5TEdQA/u2 u+aiZlsPnfGKrXk3+MrYtb9j2M3+WIVPWOUowiRvip2hc6PXYfQq6yWgonlmO6sJRX9H 1wmGOIzZDUOi3AgHAxpTrtDG5w0YH+eBaJGaUcCW2sQR+20J8N+a2zMzOlQb7gC3vwxQ ihZrxgtoIoQzwmrXcy4KNEb9kTQ9x9sGO+CjaHlc8FCglwZclvcCVjfhMa3pSxW7uJ9F 9ATQ== 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=uhQoBBJ/7iTjtvKeEpgab8YkXq728EARbWasfrH6vg8=; b=jq48YyzYAhpFqkAkRED+izFo8C9LqRuYzVl9oLJc1LkIV4JtRctOcd3i6mpcWHs1Fs b60aLxVnShCFCveF8nKyblaYKm8mxPymVd8YEf8/II7P3UxmU3UFHLql8Sup6EPgpLo9 HoO62EYa2E7udZLxfGBzA+W35NCa6dfimQRQ07PQlzMJc7/FWAZLnt999EPPKNvLyLeP sipnAnPr2Va08JHTnipBZypDbvnpVo73LArXJ49TikY8FUl+XeDcTc13D4gTUMHAyzah g3WRnsp4byYxJz4WRvqUNzT3p4yI9dHZEQbEmdoJQ6zj0J3kFc95GYIU5WNep7Rc8sKs zJUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XqSlHNQo; 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 if7-20020a0562141c4700b0045646468813si8446874qvb.116.2022.05.30.09.31.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 09:31:54 -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=XqSlHNQo; 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]:33108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nviJ7-0003WN-Ot for patch@linaro.org; Mon, 30 May 2022 12:31:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhvW-0002rf-U4 for qemu-devel@nongnu.org; Mon, 30 May 2022 12:07:30 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:34538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhvH-0007Aj-14 for qemu-devel@nongnu.org; Mon, 30 May 2022 12:07:30 -0400 Received: by mail-wr1-x42b.google.com with SMTP id e2so15314489wrc.1 for ; Mon, 30 May 2022 09:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uhQoBBJ/7iTjtvKeEpgab8YkXq728EARbWasfrH6vg8=; b=XqSlHNQoyp4RqJKgZZ33cI7BrJQV7ENarKuMSRmMG9kBOXItdqG8dYFnzR/EED28kt sg5Y1uYtJhOKJ5lV5C7qpbFoWe2zmyub/1kDV3MrIS3fqncCRNtQQova44jSMAUYiwBQ hz6mhw7iIOev4KKdQHzv3CUesjtjx6Ht4IMyunj4JyDB6Pd91Dk6Wd3PHBjNWkcOK0/2 5A6zOJRSF7QJjiPZfZF7bsERt9OANpJD3Q2UtfN2h/szUUrcwNbiJ1m4145vhkEearYE o3K7n2Zd+KuswOyaJhpry6CCa2jgfGO9EfF6qSQzOw03SBWb1QwRu5hpi0j6AiBYLVeR n2bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uhQoBBJ/7iTjtvKeEpgab8YkXq728EARbWasfrH6vg8=; b=xG8ZHUbGn/zSW/SsMJgrGcOyRT3HnBiVLPr6DNb/50Hj2BEv2hJQrBN6TZJCpSM98t 4a6FF/PeN8NBt3aMmz8zV5BNRsgZQ2txz7NAuEEXtf7tuevI+87V4fTKStJ/ZOPmJsY4 KzcV1MMhBJbofyyjcVTuDQOGIEFucPz5eX38/Jao7lFNWvvtlxumY9/HfyxO1Ch30Yy1 fcandDNLK9rUmlBJsbY5lE4aU9FQsoBZuYxiheUbCqbX7H0YozMcHm5DgJsj7pqnb98J cXexzzo0dOAKA8z6TSCBlCYrfq2a03/pJQ8tIWnAHENCvHqgJPUSz8XNNEmTXs9iYiM/ N9/g== X-Gm-Message-State: AOAM531nVeJAAUacehUugsAS2zlzKhz/a4mnGtFACKaA2783+DM0YLIO hU2rX5nvgLJPG6IdZyXwsKh6ZzlrbZVnvA== X-Received: by 2002:adf:e0c3:0:b0:20c:5672:9577 with SMTP id m3-20020adfe0c3000000b0020c56729577mr45678404wri.466.1653926833319; Mon, 30 May 2022 09:07:13 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi12-20020a05600c3d8c00b003974b95d897sm10232152wmb.37.2022.05.30.09.07.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:07:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 004/117] target/arm: Introduce TRANS, TRANS_FEAT Date: Mon, 30 May 2022 17:05:15 +0100 Message-Id: <20220530160708.726466-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530160708.726466-1-peter.maydell@linaro.org> References: <20220530160708.726466-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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, 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" From: Richard Henderson Steal the idea for these leaf function expanders from PowerPC. Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/arm/translate.h b/target/arm/translate.h index 6f0ebdc88e5..9f0bb270c5b 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -576,4 +576,15 @@ static inline MemOp finalize_memop(DisasContext *s, MemOp opc) */ uint64_t asimd_imm_const(uint32_t imm, int cmode, int op); +/* + * Helpers for implementing sets of trans_* functions. + * Defer the implementation of NAME to FUNC, with optional extra arguments. + */ +#define TRANS(NAME, FUNC, ...) \ + static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \ + { return FUNC(s, __VA_ARGS__); } +#define TRANS_FEAT(NAME, FEAT, FUNC, ...) \ + static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \ + { return dc_isar_feature(FEAT, s) && FUNC(s, __VA_ARGS__); } + #endif /* TARGET_ARM_TRANSLATE_H */