From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0F95C433E0 for ; Tue, 5 Jan 2021 17:40:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7582C22D01 for ; Tue, 5 Jan 2021 17:40:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7582C22D01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwqJs-0003Hx-Kx for qemu-devel@archiver.kernel.org; Tue, 05 Jan 2021 12:40:32 -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-Google-Smtp-Source: ABdhPJxmAxsb3BlWjwvE+QvDAYV/qsoyBJa4QnxyYC2Dry7sLvueyNtcRs9rJlAI9Jzgkz9FOIf1tg== 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 Content-Transfer-Encoding: 8bit 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+qemu-devel=archiver.kernel.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(+) 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 -- 2.25.1