From patchwork Mon Dec 14 14:02:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 343538 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3040199jai; Mon, 14 Dec 2020 06:24:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJztNg3VbyyMECezB1tBVkyVPGUvRYBLXZKHydbHRvpGRzRWCtrycaaKaxhYv7bu3I5W+b+4 X-Received: by 2002:a25:3897:: with SMTP id f145mr34400593yba.2.1607955898398; Mon, 14 Dec 2020 06:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607955898; cv=none; d=google.com; s=arc-20160816; b=bNdbPqgGLYn5gxJsZ0vGqfNoLpJq8nP8ImlB5H+tjWJfCiM97c61k5sUZsSPClhIYO Qlt3K2z1RqdVmFwG87Mban/iO4T+ux2eT5cXlMc96trTz9rJcopEetZg/WOuVqsVBO15 HXZlEJGc8F0SVWSOHix8lrUCJsn0HkWdvaBpo4HyP0fat5thgxgSbIrwFiigtMUGEXvC cuQ9xA0ZLJ9XDgYMpGuNYNcZ/Kym79Lsc4p0wpQCS5XvqXk7AGci9nSHIKjUmb3/Zdfv E+UB0hd2vQ6Jb8pBA5CZhrkqWqrW6Pa6L731M7AT18x/7ARwqxSdMPrVppn5fph40vh4 sFew== 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=UM21CD1mNWN7mJCqUB/udHXRZq9uSUYW+rGuZNQcpWU=; b=MYuquy+OoPQRTLTYvW3bRt3IW2j1OPCV94QhgjYegENGd4Ut2xntSGI6oJ1iMx6at+ kZ2Z45JDO+egbrLJkix3Z7HadcOVWgCkeSlk8MVM4w2qi6W5RQc5QRatSUb9D+XnK58J V3nZIUGeecAR1NciNXpcOCN4HjNJ+RzTPjI4MP7dzzz9WLhLkW1eABD9nuyKrUB30FlJ Qm3pd6/bkM9tu/Zwqx3jo1NOAHuv/TxKhnLmFxT9F91cRfCBF6azb2XXXJbeHeMLH3Id 66it+RcuCqH4CudC9EkD9ELCgDiECF8KtMzMBG+AWNXwTlyEmKodooV9n1tiwGKmWQYa /qjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mmYnb0iu; 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 g97si13685524ybi.391.2020.12.14.06.24.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Dec 2020 06:24:58 -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=mmYnb0iu; 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]:49164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koomX-0002dV-Sx for patch@linaro.org; Mon, 14 Dec 2020 09:24:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kooSO-000242-4q for qemu-devel@nongnu.org; Mon, 14 Dec 2020 09:04:08 -0500 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:40048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kooSG-000406-Vz for qemu-devel@nongnu.org; Mon, 14 Dec 2020 09:04:07 -0500 Received: by mail-ot1-x342.google.com with SMTP id j12so15758533ota.7 for ; Mon, 14 Dec 2020 06:04:00 -0800 (PST) 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=UM21CD1mNWN7mJCqUB/udHXRZq9uSUYW+rGuZNQcpWU=; b=mmYnb0iurTs3YTRolqgx0ntpwaogURR1wm85OK6tz3yxSeYjRy3WeK+sOWvQbCCRke CZ+dIANJHXj2NDAvLNYLaPMWR9bO58cujfI6i6DmAk2lfrhkVuvw1o+w0JoNBYK6TpPW JmWqo33aM4ioC9y9Fsl3+mPHm2UjFFFGSQxPL2kZJd3yFEclGNM4RGlqzMcEPDlx7pMD 0owaT0Oe+nfZWFYjBJql3Ii4q1pa0oS/eRpimU/M17v+Zjcx0A70GaXx/dFnXEHU9xUp Km8PBHLQVn05oPSWxHEyGPgKf8SOA3lMI9nPwowglZZS3dkG2BH/cllaCbSxCl79wEfW md+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UM21CD1mNWN7mJCqUB/udHXRZq9uSUYW+rGuZNQcpWU=; b=XJRv9vnCozvO3v/kT3BLH93VQ4cQeeIqsosabL4iNvl+V4SJOBY5JrZNTcFWjk1XKF 3sje16Rw/QmRjzkpK90eWFjVkYUNUqqOewyg6O0PHchzmHUJ9QuRCYKgHoKm4p7rf9vj C6xUJzH9l2Mu/Lemh/7DGhhL61YiEP81ooWTwJqnoyn4J7Bj3x1bU72RRBYw8MQz3rPj GYNW5FrutVm3z1x2BZ+tRjOnp6VTp5htMsBNb6EjhWAlJLVHS2rmtgX0tMxe/7GDDl/X HcRMChzNHPQsH+tqgQTM+yTg8kPspZQPeMUlU716P0dvN3F5urKxhmjklOjUKO5/5qVT EVhQ== X-Gm-Message-State: AOAM530CFk8A9e3Wc8OfwMH0rVd9lunmyqsho2aijH0QEXNhA1XdEa64 vZhdo92EyBiQFb0GqLwoCjl/40I23+MAGDew X-Received: by 2002:a9d:650a:: with SMTP id i10mr8081997otl.341.1607954639138; Mon, 14 Dec 2020 06:03:59 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id t24sm3940146oou.4.2020.12.14.06.03.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 06:03:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 26/43] tcg: Introduce tcg_tbrel_diff Date: Mon, 14 Dec 2020 08:02:57 -0600 Message-Id: <20201214140314.18544-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201214140314.18544-1-richard.henderson@linaro.org> References: <20201214140314.18544-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x342.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: , 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 Reviewed-by: Joelle van Dyne 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