From patchwork Mon Oct 23 18:12:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737287 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1665139wrl; Mon, 23 Oct 2023 11:16:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHM9wwAJiPT+zlZrjg/yIWE8w+q2NPhkTDIE74k78x6DyKonkKndZ9XtgR21hGVfr6Is3k/ X-Received: by 2002:a05:6808:3b0:b0:3ab:929e:c5e1 with SMTP id n16-20020a05680803b000b003ab929ec5e1mr9789232oie.39.1698085014352; Mon, 23 Oct 2023 11:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698085014; cv=none; d=google.com; s=arc-20160816; b=arUOIrPHFx7OIEHcXdbZ9gE4Xc1UI/t7H+jp6IfuqVCRdOli3laKEX6Ek91RJSXXE7 /ReL/G57+BESbTNKmEBf0S4Vz2EGT+dpZRzOXHBq2woqU1/65+xoB0+La8eO04ZbNBxR SxeJTx/YlYLM+jHq68/pHC/JiKA6wy7ar62PKWs0lCRBFgfOvZrpFYiLHAAPiAGKj8b5 p3YmPjTQgd9sZ9bm0ajHT4Z2phjuw7cBy2QhRiNofTEIzwzWFyv/DdkSss4ftbbJ4z2J hcTYRbJ7GKyYf2LbXHGHQmJPljGMvD8t4CdKigz7c9cilnbYIV8ixnKffxwgHcNq9Qg+ nInw== 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=kj+TKk2K3WfpkaNPPr/v3KoLmzqb4EREhy9sjMrwx20=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=pColIg90skWcsYxhdRta4Iy4j8trka1y5LcJF5JnDNT58SzYaNl4P+6TuQ2k6X+ML3 nPWyxE4dITPOS2vcoFbMxkqviQKy61F1bP/vxrFwFnWfVSflI70Gt8tCl7wkzyn1DP9M k8FSIvNiNI481oNFhZpDTOFgLUIxBniyGF6G5f9/7wBAE36XI9iUaPxrpa/6kZ49mQgr GY9rXr3TuFdyxzNC9BXmeGGpZHr+ftBogvb441Ux7/35fH30iQ43uu0CYGtos50SSLZG VICyT6DbZ0ydv7PFFc6yBK3bQkiKSyAM/8xHR1Ly+D1yk3cos/lv2fNea6LhPbTlbfxu D+iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=one66qpi; 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 bo2-20020a05621414a200b0066d0f75bd1esi5735481qvb.80.2023.10.23.11.16.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 11:16:54 -0700 (PDT) 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=one66qpi; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quzQy-0005X8-4O; Mon, 23 Oct 2023 14:13:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quzQs-0005UN-DL for qemu-devel@nongnu.org; Mon, 23 Oct 2023 14:13:42 -0400 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quzQm-00085H-Cq for qemu-devel@nongnu.org; Mon, 23 Oct 2023 14:13:41 -0400 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5842c251d7cso1760757eaf.1 for ; Mon, 23 Oct 2023 11:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698084815; x=1698689615; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kj+TKk2K3WfpkaNPPr/v3KoLmzqb4EREhy9sjMrwx20=; b=one66qpi95XCTW+FH9knVwkLj8dYV74LKPb15HOGn4Z5OwzkaJC8QeXbQGZtJqL9jo tVVzUZMuZo6oxxz4edWDIo2zjfQPkomEZErtT7aClnEv3+1PC757rrhieM6GZPnke23g zndSSKS8OtiiQw3amCjKIz0drEPa87MIPjwmN4ARyFGmNpetB257XYX3XMNII/t6PUDY QzUaIHEgzlFE6JhJU8vICRg8EiyQXTXTix7b9dBugeqRUR1GcXMHiYdk0DZ2ZlkNe9z5 pm8PDYrRIhxQ0hyeLhuLNNws+3baLUlpm58KyxhLswshMXH+9kvXZYESgRwoZH2vXs9+ pnQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698084815; x=1698689615; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kj+TKk2K3WfpkaNPPr/v3KoLmzqb4EREhy9sjMrwx20=; b=YNKMA+PAkEinXuNcB/hqMAQzntnXQtPrzJFe1DRWK5rVVLS3EEndH7qDiIJzY9jUFF QdJts7ijyfmzOly9HPjTX1FMQLsQFVSulg7mGIno1kOR5ljKkhTZB2w9WJVHkhdyjotL RVG0SQs6DOtGi2HM6cYp173ZuxoN9YE68DIojlgKweByjyuk7qOU4A5OSCX6N/whrPlf g2i+6ZP99tPXj+iWFFJ8GcIxZeMYt5lJU7ElTWUu7WLq8YxbxFWmVd2fIwgWEUwtUgoX /aBZ90hEXw1ZXDN8Z2ajU7MGESwGqgj/NGyqaUEBNF+wpJx9Oq+DcXK2MkOHOOp7Dqws rdfw== X-Gm-Message-State: AOJu0YzcqDmAwiO5MgeOOmjfNWW55Wfqmix7EEmkr+T8cfOgqX4cj+KV qFV7jICcuHKOb6s7zmw7pgbUn6uFYFSu++NJbpw= X-Received: by 2002:a05:6358:6e93:b0:168:e592:f8d2 with SMTP id q19-20020a0563586e9300b00168e592f8d2mr2405493rwm.25.1698084815312; Mon, 23 Oct 2023 11:13:35 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v10-20020a65568a000000b005b83bc255fbsm5205137pgs.71.2023.10.23.11.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 11:13:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v3 05/38] tcg/ppc: Use ADDPCIS in tcg_out_movi_int Date: Mon, 23 Oct 2023 11:12:56 -0700 Message-Id: <20231023181329.171490-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231023181329.171490-1-richard.henderson@linaro.org> References: <20231023181329.171490-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2b; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2b.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.29 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-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index b0b8cd2390..226b5598ac 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1055,6 +1055,19 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, return; } + /* Load addresses within 2GB with 2 insns. */ + if (have_isa_3_00) { + intptr_t hi = tcg_pcrel_diff(s, (void *)arg) - 4; + int16_t lo = hi; + + hi -= lo; + if (hi == (int32_t)hi) { + tcg_out_addpcis(s, TCG_REG_TMP2, hi); + tcg_out32(s, ADDI | TAI(ret, TCG_REG_TMP2, lo)); + return; + } + } + /* Load addresses within 2GB of TB with 2 (or rarely 3) insns. */ if (!in_prologue && USE_REG_TB && tb_diff == (int32_t)tb_diff) { tcg_out_mem_long(s, ADDI, ADD, ret, TCG_REG_TB, tb_diff);