From patchwork Wed Oct 18 22:25:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735152 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1237128wro; Wed, 18 Oct 2023 15:29:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFl6BnHGbO4dy5TY2cPJ65KXocOSIMWtklemEFIvzTUb3h0294hFSy/HdNnWCElfvqpY66h X-Received: by 2002:ac8:5c04:0:b0:3f9:d1c3:cc45 with SMTP id i4-20020ac85c04000000b003f9d1c3cc45mr263242qti.28.1697668141920; Wed, 18 Oct 2023 15:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697668141; cv=none; d=google.com; s=arc-20160816; b=0CURYoj9T85NcQhiek/kd0P9pgpddMBD7boBvYUsGFC50qWb4B5G6pIwOhEDIPUbMK QF4ZRPbQ6YeYiparR+y5J9RlK7E/htzHIBjQSCWM1XCBPL/Xplkb8dUUKdTC2FNhU33f LAXN9s2AT8z1hws9JnockvXCxf5cyjMLsQHiEz3NhrNQ5R9kTySAGo9IpOI5ssd9CHGX MhCnxFk7des5yhGlAwWhtIOEJkelD+LVMpOTOi6c+eUyNZTitYBjs1dTQX0f2Rc7iFEh qYICvpYXHkMn1uPXYkXPYtsI2JW223FDmnThnp8Kq2CX4OXQRXHzmFrJudml7c1hQq48 6Aow== 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=O6ypWKYmP3E0vSS+zdR/mRhAnNRJOT7ENlr0UKfEKr4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bODoB1IAb2pxRXZaPo09ZFdxTUcwKX2mJ8IqRYBH0lH6Bk7zg6dmrSQfZcf5HgOKcH +tB5u+EBmkhKDC89MK2E/zUadZyutQ8LKDdgGcP2XhgaMkYdKIxjKSdWTCm84eTaKKbJ YFse5eOLfkm9jVUaCIBuwuAUQHP2pTvyprXke8NaAMp6PIaBh6ut6qNXNyM6RDVATR8W GWkprZBkUV5JWb/5IUC9LUNi1GY110YB9yko9dW+fTBQ85Qnip8Xn5IWNUYKbsKeBDZ3 P4D8cnDucKklXG4AF7pyEaI0a+ubl4KFeEG/TFvpgfEOG9KLh2WEIiDEWY54Q0yWT2W/ 3jCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YlGy25Ul; 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 m22-20020a05622a119600b0041b83bbd0eesi721269qtk.43.2023.10.18.15.29.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:29:01 -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=YlGy25Ul; 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 1qtEzR-00084f-71; Wed, 18 Oct 2023 18:26:09 -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 1qtEzQ-000849-49 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 18:26:08 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEzO-0002T5-AU for qemu-devel@nongnu.org; Wed, 18 Oct 2023 18:26:07 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c9e06f058bso1356735ad.0 for ; Wed, 18 Oct 2023 15:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697667965; x=1698272765; 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=O6ypWKYmP3E0vSS+zdR/mRhAnNRJOT7ENlr0UKfEKr4=; b=YlGy25UlYtYez2IRe3x6+HTjQESPoKzoZlWXDt6gNHuUUIQFV+rrUe3znLfiscYBO9 1OdQIvDfhyuha/OfEQvAcBqC+wOq4kms/zGHp/d/psyNdz7dIqYGCDe28MtRAvMG1U1Y li7YiJyZkZUGuSvQ1YIr2QmwYuQf2jWK0lr8xw7JNYIdixNtYfcDNIlBVdWN4nhqWJIk CkO5nInc7199YCdTiqlKE/ytsBNOPPmoW77WOUWcpAmv0dXhX5/mVn3gSBPiJKurhB5y JDhaOQK70/jfCQsUZCgehsbPHb1ufCFthp1qKAOxLK4KUYBUTkccFJ7cNJ0rHY2ivXRK IeVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697667965; x=1698272765; 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=O6ypWKYmP3E0vSS+zdR/mRhAnNRJOT7ENlr0UKfEKr4=; b=VMqBMCRQS/Do2ybCXwXEkor8Ax1tWSBDRBSJVCi9SojFXaPNozJdylspAgL2gyIRFR 2nARVZowN/M1sT8o3NF8yQNDWUH64YLs4afOVRtADLPXDYxkwOBIROjSRHKYuzVi7otk r8GShTMbVoIeCxc/aBj69VYzfQ9qqmfzwpPd5lSha+zOsD+HbNQrL7K/mDZA/ZOCMIGC SibEwKqdvrAEdrY6aaiAVPDPtoTS9Jf0ZTK7VuW3I7heoo+4ZLNBOdw6t5+dP872OI68 X3ubbjsGg9mOe/2btAoc3TS7Zy6NZrKNU6V2JBjKm0ZANDeH2G7neTZ138KZ4I8VaYOx ZiRw== X-Gm-Message-State: AOJu0YyMCx6mdjanqSFvueuZ2ofDZsxS7yRI64EJLHMyiAI908OZhucb bGdSO184XwXqxm+xQoAlBJLXjMlRey/wtZD8t9I= X-Received: by 2002:a17:903:456:b0:1c9:c3eb:6551 with SMTP id iw22-20020a170903045600b001c9c3eb6551mr252442plb.10.1697667964817; Wed, 18 Oct 2023 15:26:04 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c24d00b001b9d95945afsm431058plg.155.2023.10.18.15.26.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 15:26:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/29] tcg/ppc: Use ADDPCIS in tcg_out_goto_tb Date: Wed, 18 Oct 2023 15:25:35 -0700 Message-Id: <20231018222557.1562065-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018222557.1562065-1-richard.henderson@linaro.org> References: <20231018222557.1562065-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 720f92ff33..6337b1e8be 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2593,6 +2593,7 @@ static void tcg_out_exit_tb(TCGContext *s, uintptr_t arg) static void tcg_out_goto_tb(TCGContext *s, int which) { uintptr_t ptr = get_jmp_target_addr(s, which); + int16_t lo; /* Direct branch will be patched by tb_target_set_jmp_target. */ set_jmp_insn_offset(s, which); @@ -2602,9 +2603,15 @@ static void tcg_out_goto_tb(TCGContext *s, int which) if (USE_REG_TB) { ptrdiff_t offset = ppc_tbrel_diff(s, (void *)ptr); tcg_out_mem_long(s, LD, LDX, TCG_REG_TMP1, TCG_REG_TB, offset); + } else if (have_isa_3_00) { + ptrdiff_t offset = tcg_pcrel_diff(s, (void *)ptr) - 4; + lo = offset; + tcg_out_addpcis(s, TCG_REG_TMP1, offset - lo); + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, lo); } else { - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_TMP1, ptr - (int16_t)ptr); - tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, (int16_t)ptr); + lo = ptr; + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_TMP1, ptr - lo); + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, lo); } tcg_out32(s, MTSPR | RS(TCG_REG_TMP1) | CTR);