From patchwork Thu Jan 7 20:14:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 358273 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp789179jai; Thu, 7 Jan 2021 12:35:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxX6+GeFlSIKAI9nBtg3Yqn9pFr+hyLj+k3Y6ef/H0Rcy1uz/mYvfSo1rWMOhAjqBhVQh+ X-Received: by 2002:a25:d788:: with SMTP id o130mr833122ybg.245.1610051750430; Thu, 07 Jan 2021 12:35:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610051750; cv=none; d=google.com; s=arc-20160816; b=crnRRrE2kJxRvn9tpwB8sTNr5bUuYVshWh+U9gboUjMqsdLwmDCjg4sqqOLCyXMzL1 haAPPKvMisFDOrVhuA6su5VNmJaFa2ecM+wnCIa133Ul02eRqfqoO+hv2PQ4AVjHVoE4 W4vEmY1XGkI4JGdjM5PAoG94G8PAkASpP7KA8v7hx9/55wKAkV1W0DJXVe3MMaJGEd9b G1rpNyE5XPfzsUuHJH1nRBoHD9Og5BvGEk+rfoYTynXvtxQlEs9/uzqmSIXc6UreUJJQ 458Ki3eGOcaASm+2sG7vj1cXhjQTKMJk7wv9lOrXAu21w/k246a032xx0MU4EihycupK cNNg== 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=WTxC6GlsXwughAsEz3f16iPPttbc8vmHxGC5YXaaLXRKRTs3qEqny9US8fnO766A3f 9XtmWeIh9NJNVnV8pgbB1oIyKWeEISsoHAsvImsjwbb7ITg+mcLZkES6DW0aUECPumWM jwm7/yt2G8bv3weHVdfbBr5zN0+Q37CGywRqL5koJQYEOUkoNUPw/kj9Vx50YFpzsU2m DVSXhiOYIChnfQ4WROSaF9jxzOHrvrCg0noyrCwegoeZyOTwtNri2zsazy9i05P6rPf4 qgn/PQxqEAAcNrhTpnzCjmFtGyP+QVkVCtwuzFsLhH3/X7QD7MjSk7hSA90xpYpNt/SY lIuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JbL+zwzB; 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 a192si7325234ybg.427.2021.01.07.12.35.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jan 2021 12:35:50 -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=JbL+zwzB; 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]:50002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxc0b-00012Z-Tt for patch@linaro.org; Thu, 07 Jan 2021 15:35:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxbhR-0001VO-1z for qemu-devel@nongnu.org; Thu, 07 Jan 2021 15:16:02 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:44498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxbhE-0001gO-Re for qemu-devel@nongnu.org; Thu, 07 Jan 2021 15:15:54 -0500 Received: by mail-pl1-x62e.google.com with SMTP id r4so4140502pls.11 for ; Thu, 07 Jan 2021 12:15:46 -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=JbL+zwzBpEjWHm+q88jSzggyZVvivBjFJ4/DPrh79pZb9YeyFjDH2fnWiHiihqYgT3 Grjye7O7ZEG9ofQh9kQvCK5DScFl2u5BNtDgfLfUkCQ63xVA+Uqc1Lcx62kuv0TLg4Uj Z2m9i7RKtHEkTPU2L5bTcIqabSr1PnmptOGt/fJQPDJyTxG5x3zvkDcdErCvvnSEddVu rLD3k8QooflCltJKbxIMDpx096bMi3FYdXuAxwZxR7lRlm0eLUDrfBOcnosmjFkNLOrA YmxYtuIEf2InBggn2lZ5yxjCxkDr6WeNVNzPQ0bqCIKnhQzdX2fL2wbdzMOhrkHzAXr0 /7UA== 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=KzT/xrpHTDtdX5IbqkvfVQyKEm9VwQ8Fn6Egvk3UD1waNNe3we5f2Vic1QI4/Ks627 f7P+CHNKw6PAnuYLE84kbBLoOFV/2Q8f5CjoGsNu9N6j+9BnBN4xkVLXrcL7+pdvmJjF a2FLII6img21srlyCl+5Suh7IuEpk0aIljraeHCslkcCUTr1w65J8QsZREAsjJ55zDvm UmIiV0FgM82cSocK1Ov+UjvVgEsueIH7dUh+NK7/kgBi/CYZYztmIJj7Y56hA97B0Wsb biFlgv6GblPExZtuEbejA01jkzuHj9yBWtffmrEWXp9/44n7MnkqAvgDXtHQ1r2APFYz l5xA== X-Gm-Message-State: AOAM530Lfqi6SMQ5+2RhrMnBdC1l20DopNvM/xWaUKe88Mjh8CfuoOoF OML+wxcbXxA6tr7VUieEwwPQHMu1G7FcQQ== X-Received: by 2002:a17:90a:bf05:: with SMTP id c5mr166021pjs.95.1610050544925; Thu, 07 Jan 2021 12:15:44 -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 v6sm6516265pfi.31.2021.01.07.12.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 12:15:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 30/47] tcg: Introduce tcg_tbrel_diff Date: Thu, 7 Jan 2021 10:14:31 -1000 Message-Id: <20210107201448.1152301-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210107201448.1152301-1-richard.henderson@linaro.org> References: <20210107201448.1152301-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: peter.maydell@linaro.org, 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