From patchwork Tue Jan 5 17:19:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 356896 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp312066ejs; Tue, 5 Jan 2021 09:39:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpHcKhdcwHEFi9acV4RoFXwZZsodRGfAgjJaNe2Ay0S6DA1E1PuZZNA/BfTcPJXLzeK5Xz X-Received: by 2002:a25:d44:: with SMTP id 65mr757988ybn.260.1609868367207; Tue, 05 Jan 2021 09:39:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609868367; cv=none; d=google.com; s=arc-20160816; b=gqxiaCiLBkr8Cn9fcNq8NTpl6OZcBg0kEZQcB8KZCqAM8m++Hh/i3ef/dJnLK/6fIN J6etgqZRda323z3dUS5NLuzQZzq7mju92OjM8dr56ZpLcuo85KWLi8HoCrJ6DaTbqXgs 328J73To5QdiTIJZxLNkXNe4rhwVxeCgafTCnPQX/PyAloIGpKoCu4jOSEnr7gFA1vXq xEbRBfE2dW7tnfMqTZ7Jj68LMozFskKBeApT6ex4Wru2lZ7TN1R4eaUo2lnz7EmiBbha /9nNweHp+y73oQX4rpgzkNLb/WLeLQBPBIL8BtbWbtynE/DGTRCF9rUju/28HgSCEZFH 4Dig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=1C9DAauAp7ESr+w+Jngt35D1tFX2Zjw12yc74O3Eyt0=; b=hht4qSaAQQlhsARpaB+pUAoQPVQbFFVPIpTaHV4y15XmoMCVsP0N9f3PSQ5NXEwvaa 7ILRQPaF4prT5fYQNP1/VUpw1LLVJiVL3r41shfUueFh48DL4Fs2rjG4X7d4kw8wYZZS sqhC3IT2S4Ij5OHcmWMFTqxFkLRv/7uFhsxR1STc3QOXQBzTq3sl3SFRz3U1XW+Hm8Vr m3y81qktFtJEJIZCbYLqRBcCVNTKLEsgfP8XS9+deoKXUo3bvufB09DEZlvMg0GTMOZ+ XrBpzqCD/HVbr7SfkKFwbBn+kyQGl90+dnr85+fpPjm2JGcflQJgSeNSb+NN5HAwdSM+ Vi3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="I/V1vPVL"; 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 p71si471607ybg.346.2021.01.05.09.39.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jan 2021 09:39:27 -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="I/V1vPVL"; 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]:56342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwqIo-0001bg-Kg for patch@linaro.org; Tue, 05 Jan 2021 12:39:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwq0i-0002WS-TS for qemu-devel@nongnu.org; Tue, 05 Jan 2021 12:20:46 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:54340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwq0g-0006db-Fr for qemu-devel@nongnu.org; Tue, 05 Jan 2021 12:20:43 -0500 Received: by mail-pj1-x102f.google.com with SMTP id f14so13056pju.4 for ; Tue, 05 Jan 2021 09:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1C9DAauAp7ESr+w+Jngt35D1tFX2Zjw12yc74O3Eyt0=; b=I/V1vPVLQVR13pOrXFmUuyTiGilNIhZtksqtSRL7gNAHju7Jh9XllBuiZ7UlVUATrA D0pW9yukKSvm0O5s4pni4eFn9UE1eVBJGOFE98CVge+i4o+bVsXoMS4vGE06la7DXb8S EAJiuXMS1kY9sNAeGV1MyQ5RcHaAlM8YJcL3rNr7A20H9TmDQCeEu4uRpGoqKjE1Yk6N SVXlGcuNpyrTqdrKfKxGRFfzDh3iaPkBgXtXu4IYCbj41SrlrhqOfhs86nn2kX6yWE8k Jo+jXg/74CBTdXRwhLy+e1h0DcClFLciPmlujSPr6Ze8VVsFUCLsL0LeBjt0JbR69Ccv nEXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1C9DAauAp7ESr+w+Jngt35D1tFX2Zjw12yc74O3Eyt0=; b=J7M3hTNSPtP4wg+8TV1gDvjxGbGuXpi9hElLy+Jf2x0J5jdSXIgq8Vht7iVrc19IIt AFl+REIYudJOcZ0SgMAJt0w+ZJ0NplP2CCg+O8NxiPnlBi16TEqXqp0dB4v5tcQOdQhm B0Wh1KiLY8oG2sEw+d0cRSz8hdo+PKR/NefkeHJpGysMBYnMWUcFJE2YruU9FNv5zjRi N3i18usBMpHXELQAt3fAcPpt+FlXswsoWzPriTgF8ZIs4YYASQSjf5Lk2BIJW5olE0nS RNyE3qUsDCO4w2E/FegodC7ABOkLZdVmGyCTA19uHDZEP4HyRXpMssuKSNRDecgH30UJ xGSw== X-Gm-Message-State: AOAM533dv88vZEFoGoKyO93pMKrFRHn5pMVEDFdJTV/GokWCcnFJIpyq Y8p3Nt7EaZ6LWCwZW+xQ3hCWP4QVi2rK+Q== X-Received: by 2002:a17:902:6a82:b029:da:fc41:bafe with SMTP id n2-20020a1709026a82b02900dafc41bafemr649510plk.20.1609867240301; Tue, 05 Jan 2021 09:20:40 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id u12sm2010pfh.98.2021.01.05.09.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 09:20:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 26/43] tcg: Introduce tcg_tbrel_diff Date: Tue, 5 Jan 2021 07:19:33 -1000 Message-Id: <20210105171950.415486-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210105171950.415486-1-richard.henderson@linaro.org> References: <20210105171950.415486-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joelle van Dyne Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Joelle van Dyne Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.25.1 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e744a1ce02..e6fce9a049 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1146,6 +1146,19 @@ static inline ptrdiff_t tcg_pcrel_diff(TCGContext *s, const void *target) return tcg_ptr_byte_diff(target, tcg_splitwx_to_rx(s->code_ptr)); } +/** + * tcg_tbrel_diff + * @s: the tcg context + * @target: address of the target + * + * Produce a difference, from the beginning of the current TB code + * to the destination address. + */ +static inline ptrdiff_t tcg_tbrel_diff(TCGContext *s, const void *target) +{ + return tcg_ptr_byte_diff(target, tcg_splitwx_to_rx(s->code_buf)); +} + /** * tcg_current_code_size * @s: the tcg context