From patchwork Tue Aug 15 19:57:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 713797 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp1968252wrp; Tue, 15 Aug 2023 12:59:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkkv8L421yBlwfsEOI2M4T/T8NKyPC8F4oPAYX/VuCrOF+ZrJzM4oIH46pTCsLvyv+H+nw X-Received: by 2002:a0c:c40a:0:b0:636:afa1:345d with SMTP id r10-20020a0cc40a000000b00636afa1345dmr10110653qvi.17.1692129551636; Tue, 15 Aug 2023 12:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692129551; cv=none; d=google.com; s=arc-20160816; b=W/mTzQHs/fY9JzaturjxoOmcVEV6pvYmLPIER1hRJ9/gP9uml0Pq1DNwzErPXF5ObX nAFPN32rTYdHz1w6//IfCY6fTCTGpLfZixoK57H8zrqTrfaoQwNvXlJE9N+AywjB46hw vT1lhE/26WucPncy7kbo8RqNzG25OJgbb9iIcDmj6BnZEQkh8Wd+//Nu1NY+/3I0WJse 2huGhbSwOdhac4qYf1NRBsM3y+iRKZgAUdPc2V6vLbUgRyVxkruBw65aeagvKGaWB+EJ wAGku89OUDNXto4OB2eevF1d9pUXGR1mMouS3+q/XIiPwdovjNPUhrK1SqO007oH/hKF LhAg== 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:cc:to :from:dkim-signature; bh=CAfW4M/c3IgeounQPta3hLHkVcqc5lVrdvZ/euSX+U4=; fh=1LlI9qg4dDC6jzYzk4mr2RaPQDh8MKMNLXu5CCRW41Q=; b=KecRX59eRs1X4+pNDLhM2KX5gRDD6LASbamT4+JVukBXs+KQESU7KQYKL/hXfIBkEZ 4hvbAMORDyaUxU9dFzzjUMyEzAFSp2beFTm5/cbjXyYABMgIHvd5oaiuKgH4ff8yyqZC AoOh7goaD6yaiRmUXs0CtZKOMtrDFJmQf4g1VezIXH8RswsXdwMgKH3jH+oQ1SFW8mL2 fM4/OSnxxo+KSPOYx0K7vYZvCmQ2exh1fZ5RPMklQYTIGzUcYEGqDid/4qCwcf2ebXRV QnbE2jYyyW5CS0YD84Pp0h5lWbSqqCss2ymF5b+E5ku8kKjyMy9AkrfiFu9Aje/gOGsE 24FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h5CL47Fi; 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 h21-20020a05620a245500b00767b7f31104si8094943qkn.147.2023.08.15.12.59.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Aug 2023 12:59:11 -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=h5CL47Fi; 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 1qW0Au-00058K-7X; Tue, 15 Aug 2023 15:57:56 -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 1qW0Ar-00056G-4B for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:53 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Ao-00014D-ON for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:52 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6884310ee75so1651081b3a.1 for ; Tue, 15 Aug 2023 12:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129469; x=1692734269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CAfW4M/c3IgeounQPta3hLHkVcqc5lVrdvZ/euSX+U4=; b=h5CL47FiV2u4P7YnWBM6bs06tw4WXbhEiXmdOc4CYpGKNpZffJgdEyDnosb21XP6/5 P60QT6rKkDmr74C6No4eXqGbFiOK28aQp1bgGcgqGVhVJGnB2VUR82JOt4BnSx4N6oF5 S5RZruVQDiMSTGr4LS/KYPTRGmTnMr6NAgWf3O4AOCrZCL152Yzd/M07io8z3RNFMgzQ T4yNSzfVGff3jg2gHyNllZkc4SvZDMcqSiWk5piQXHe2c5J3Q4WlCn97egp9sPEiXmTy BjrzGClO5GtgO8Ua7aCFVCFqo7Z4A/CwrxXhYqJf0d/Y0AjOer9VMtKdAFw+76NRdifr 7UIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129469; x=1692734269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CAfW4M/c3IgeounQPta3hLHkVcqc5lVrdvZ/euSX+U4=; b=D9eIOhTdqG921tuLGd7BLDFaGm7UjlRUeY/C5bhuamDWDXNbESuW7LvbGTFJdUkIXH mTaN++gaOj8FA2hfL/2QTrUyHGB2fEwBKoKqKfR1EMM6xODav+8BrGL6+RXKK2zDDk1v 8SxmXv5DsTTVkrVsSjEhzD5JWYR4qo82wW2VOcAjDnil0TJ/JPXULI4nQwYRUMx1RyjC aoz3qTl7pTZWrL1L64ugM3jxPsHc7f5lggwoLCQm8SL/Ybsp43xqveCnYCKI3cChgwTo pVUgRstT8VpMztcynOYazlYvLEMKPiI+dTowwYfU+5j46hrs4COaZCUqioRLhMxYnmP7 GXmw== X-Gm-Message-State: AOJu0YwliyC8ea/MRXOUTsTVDpmXQfFGeVkSRLZVtDgbf6fvICGHWRKK nmYyP9VdsubzpSlVUvmnBGqeLbCTQe7k3SjZB6s= X-Received: by 2002:a05:6a20:324d:b0:137:a3c9:aaa2 with SMTP id hm13-20020a056a20324d00b00137a3c9aaa2mr14896424pzc.30.1692129469425; Tue, 15 Aug 2023 12:57:49 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:8d06:f27b:d26c:91c1]) by smtp.gmail.com with ESMTPSA id n7-20020a62e507000000b00686b649cdd0sm9667699pff.86.2023.08.15.12.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 06/14] tcg/ppc: Use ADDPCIS in tcg_out_movi_int Date: Tue, 15 Aug 2023 12:57:33 -0700 Message-Id: <20230815195741.8325-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230815195741.8325-1-richard.henderson@linaro.org> References: <20230815195741.8325-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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=unavailable 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 36b4f61236..a302bfff2e 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1050,6 +1050,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);