From patchwork Fri Nov 6 03:29:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 320739 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp979915ilc; Thu, 5 Nov 2020 19:38:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJywVD7VSZTyj1wux6hr9kOPgDcUzDrRNhGqfsXKKTFADK0oBqBSO9TFlbY3PmaovUBYO6g4 X-Received: by 2002:ae9:e414:: with SMTP id q20mr5074023qkc.291.1604633921190; Thu, 05 Nov 2020 19:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604633921; cv=none; d=google.com; s=arc-20160816; b=ifipv4uUDz+GvJeZXYfg5xvRAjS8DrxzMaiX7G+yRdkY1lOz6Cec1GbzTT5xEa42AP nBi1XXs8kxSVUMcKNCIal1chguIm3U+UziJUSwzfl6QuhnL5ELy4ZRCNBeLhcKfrZ0Uu tGHL3bWwmsLjFbN4WX0OGKP6zej1OBbOFBxYtVt1Rf2Yi7gP4q5+Iujyf0bBFjxMTDnn KUshIYyRMKGelmhhcgJJRsoDPTdRRCddn7JXPNlNERUTsrJEL9MCP6hTogRrEjHYpbC/ WFxT7ogJQwWKVsziXH8PMVzE7gOFnbPTX2i9e75TP80K/JMRVUUF5pdnm0HLK2yod5W7 wB9Q== 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=UM21CD1mNWN7mJCqUB/udHXRZq9uSUYW+rGuZNQcpWU=; b=yjm912RS5CS4D3RWTzrPMvMHz3l2P4iFhaks2bI3tnA9VWPaY8rw48XJAeWCQcaG9f jGxy+ZDrrXZbE0/IrLmmSXZzUyqllOMum0OpkP41PIhqCZ2PCGftOb75jsZQDLCwouYJ xnsi3ExnTjwdd/iwnEvJI+E95MrgM1qsPvqtHwlvmcTMLCvC6tJqlfA9VwlqbgL589+e d+uhpfogHffd10ZcpLUPKUOJwxyJQAa5kROunLD5CoAakq5NH+VA3NV7TeUBnvn8xzAY h6GgHXtp1QtvTzbmI39Z/Ia+1n3HLvNeLmhy1Yyoa12gdIL05oPF/Z72LAW/YbjEK/BU vbzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mWN4lVou; 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 fc2si1840786qvb.30.2020.11.05.19.38.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 19:38:41 -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=mWN4lVou; 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]:50902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kasaG-0001TM-NN for patch@linaro.org; Thu, 05 Nov 2020 22:38:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kasRs-0005Pq-2p for qemu-devel@nongnu.org; Thu, 05 Nov 2020 22:30:00 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:45385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kasRq-00073g-DX for qemu-devel@nongnu.org; Thu, 05 Nov 2020 22:29:59 -0500 Received: by mail-pg1-x543.google.com with SMTP id 62so2859345pgg.12 for ; Thu, 05 Nov 2020 19:29:57 -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=UM21CD1mNWN7mJCqUB/udHXRZq9uSUYW+rGuZNQcpWU=; b=mWN4lVou6WXoGKcq3p7fbPc6jIhkoS5I3k1g4rfo41b8DG9GYUmtR7LustisERj0PC f8tO7MZLvWkfmRUROWILIjfnDoDOiIF8vSViuG9XEZsjBg0Ei/Xe5/P22kOehKmPH1+A PJSQWauqbzhb2VG3EAKTM5toZq2U0dfVq3wDrANw25eIFFcvS/38MAAUBYt5GWPaxXWh KpfjFIAlIQPivuPEUztGP2uDVmKqGFIx4VIBdbazP6gZz+D6InT/+MqCxvgbCXNmytS/ IBjQpumlFzt6lJocQukUcrZsi/u99na3Kyi0G0zSYloJAqFB0e0EhnUxUaJG3sZpxe9t uEFQ== 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=UM21CD1mNWN7mJCqUB/udHXRZq9uSUYW+rGuZNQcpWU=; b=k2AdQShZG+5FMUt0yEWnDvZzlm8GAq51lNvaj/s/iSB90pTAynZ70pY83T/Pkg1cC8 ykJyHLrG35CbtDxLrmEyvX3LE9QAWwxINW1CIAKPBqgInwq5Z19lhnhgWfjBxEuAP9AL eC5aRNtUKujcpwDR9xSpyh5aRgDOD7bwr6WAN8YEgwJmQmz2txJZupb0VjKYbZAhF4x/ LLtPNG/47wSi4uCSWAvfe0Mnx/tFPFc/m/hpZ66BVmFTxvfSt5kurFcQvpVzVk79mhQX S31K/Iel85sH3udfGfHNcMAPLjVdA2PxHLCTIW9svrPIrfBQD/mRl4YdC8JTbhHui+II ANKg== X-Gm-Message-State: AOAM530rbCeCgc8s1UUTugUVG8YO2S4m5Hy7+T4nPDSsj7woXzkbk0Y1 CNGF+FQH+UEA3nhb6bHwy8wpmcvkQ2s1dQ== X-Received: by 2002:a62:1408:0:b029:18b:78d:4c4b with SMTP id 8-20020a6214080000b029018b078d4c4bmr105881pfu.25.1604633396758; Thu, 05 Nov 2020 19:29:56 -0800 (PST) Received: from localhost.localdomain (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id i10sm40773pfd.60.2020.11.05.19.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 19:29:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 24/41] tcg: Introduce tcg_tbrel_diff Date: Thu, 5 Nov 2020 19:29:04 -0800 Message-Id: <20201106032921.600200-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201106032921.600200-1-richard.henderson@linaro.org> References: <20201106032921.600200-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: j@getutm.app Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 67d57695c2..90ec7c1445 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1141,6 +1141,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