From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129566; cv=none; d=zohomail.com; s=zohoarc; b=dGssWaJLPND314SKUeSv+kZxgo+l7slXi2/BTWEak5GN/6ikmjRClo7/t5nBcCt0p0uvU3iSEt/Pn/qYDf04GLLKSEB5IJ9XIxfBjLljxT5LmgJZrGxgRLktTK1o2u3uy3t7TFwd6E1fegJYJMsE0xuEcnkM6SWBOMP16SDFjSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129566; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PZZSZu8M5U/PcU0xDddsAwmIrS1Z0aEmfJuCGCmTsdA=; b=V24wHWZooiQPM42DUGD1jk6nZM9WjPSrqFLUkzlgiKjrvSS9Ws2ZOJPfM9/Y9CQjj9KcrG7Ki+YCpeh2RPW5iZFYwlerlph39qAChwpH4+zJLPHboGdsuE/mo6Y+SPMaPaBZdTQJpem7sVi7N1TWS1Dd9K5mmw3SUsX0ep27fNg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129566448509.2723688964471; Tue, 15 Aug 2023 12:59:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0An-00053O-Rb; Tue, 15 Aug 2023 15:57:49 -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 1qW0Am-00052Q-Nv for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:48 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Aj-00012Y-2h for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:48 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6887059f121so586475b3a.3 for ; Tue, 15 Aug 2023 12:57:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129463; x=1692734263; 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=PZZSZu8M5U/PcU0xDddsAwmIrS1Z0aEmfJuCGCmTsdA=; b=n0Z6Cu6ZV7rmZah9JdMSjq6mIdC1qR4M4a4aWFe9U52OIBflhWADyfCn1b0qaDbGO9 2OVQg5YGC5kamq4YUm5LnOkuBBZdoJkHp1fb+/SfHZiHOvx1NrrRkd4HM+epfVHiU+lz Dlezj4sTuvN+3Uz09brVGJf2RKeQHvLxWs+KPn9YmZ6Db4oOWKth6Q63Gy5ZFlxgCUMM bkc3lfQmMjtF48j7pNvqlQRiUeJyV7O3lzqgHRDQ9SSVGxjcWxGaP6yDy6T2GqRaEbI6 BwyfWlVLlqT9MU79TDl9rZq2mufolp3k70ztNh7IcOomZw7yU7OBqDiaS2NvSaAkWAn/ /w5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129463; x=1692734263; 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=PZZSZu8M5U/PcU0xDddsAwmIrS1Z0aEmfJuCGCmTsdA=; b=gRR1YK16sXqBeApujxapEDs/trm8F26B9Lzb89S9DhtD7SHg0Na7y+LsnJNadU4n+F Q4MrZ9mfcum/9XS6wzyBoalY8LotPdc1drtZf7rwq60Q+jd/EgPnpn84+7mgZmRoBjnV tCZp46Atf9fOH836Y486JgHSxH8UXA20bfBzKI9P5a6rctPteMiXvWjDSrxjn/3ePLb+ MvyMPviZ5b+j8207U6YJpLMvQg9tlXG4QviiNfk+F4+FIC8j60AgGF5ZxoOYbxlsRXX1 TczxoXNo5O8s/EuuksU0WTX4KTBhjHgB8yKTKO2pnUc077yFpOZJZYNSMX4D4iBKXheK 7uXw== X-Gm-Message-State: AOJu0YxHSBmiTReYb+aCcFfRtzeVmhCG/J5IlGhJQ00aq+R+CvedzyIE cipati85ZsXgeE4DVdsCtD+TWk1nS3tDjqdYokg= X-Google-Smtp-Source: AGHT+IGukj38lkHvHU+zGwDyy8mP5ioY1yQbpHjotJHn5raXFUoKiNWSiGqH5M03NzZRs3LQQW/9jQ== X-Received: by 2002:a05:6a00:10c7:b0:688:535b:717d with SMTP id d7-20020a056a0010c700b00688535b717dmr2132919pfu.30.1692129463505; Tue, 15 Aug 2023 12:57:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 01/14] tcg/ppc: Untabify tcg-target.c.inc Date: Tue, 15 Aug 2023 12:57:28 -0700 Message-Id: <20230815195741.8325-2-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129567043100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 511e14b180..642d0fd128 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -221,7 +221,7 @@ static inline bool in_range_b(tcg_target_long target) } =20 static uint32_t reloc_pc24_val(const tcg_insn_unit *pc, - const tcg_insn_unit *target) + const tcg_insn_unit *target) { ptrdiff_t disp =3D tcg_ptr_byte_diff(target, pc); tcg_debug_assert(in_range_b(disp)); @@ -241,7 +241,7 @@ static bool reloc_pc24(tcg_insn_unit *src_rw, const tcg= _insn_unit *target) } =20 static uint16_t reloc_pc14_val(const tcg_insn_unit *pc, - const tcg_insn_unit *target) + const tcg_insn_unit *target) { ptrdiff_t disp =3D tcg_ptr_byte_diff(target, pc); tcg_debug_assert(disp =3D=3D (int16_t) disp); @@ -3587,7 +3587,7 @@ static void expand_vec_mul(TCGType type, unsigned vec= e, TCGv_vec v0, tcgv_vec_arg(t1), tcgv_vec_arg(t2)); vec_gen_3(INDEX_op_ppc_pkum_vec, type, vece, tcgv_vec_arg(v0), tcgv_vec_arg(v0), tcgv_vec_arg(t1)); - break; + break; =20 case MO_32: tcg_debug_assert(!have_isa_2_07); --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129607; cv=none; d=zohomail.com; s=zohoarc; b=Wg3h8U37CixLiUlqYpg93jkK/e/ITOwZqaMZeri6BVY0iKHesfFscKL22zOQ1m7x3PC2ORlxpmv3L50MDzF/gsxkvN5oh9MGli14g38p3odR1XSzMZciph1qePJ/gARTuM80eD2Q8T0pqRrvnL/Ku/0TXTqEReRtpn6p8CzmgLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129607; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3Hu8xuNnDAHTDqTBUhJjYGuMUXSC+Qs+gzIxHF/zrlE=; b=epX8trRj3UJJrH6Sr1vk+SqxwwzkqoS4PMcT+10bN/AYEIwa3opjt3RU4Bg4vAAWBo8PXnFkOdci42XXoeVvHm+HBAu63MOyOCz/RkRVp4O0klynhsxzr16m7jNJ1JX+4rSn5k5wj7GRsN9MBCkUVtRT4F9K2cYiEf1XITqMGcA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129607064568.4144145317458; Tue, 15 Aug 2023 13:00:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Ao-00054D-OL; Tue, 15 Aug 2023 15:57:50 -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 1qW0An-00052m-7F for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:49 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Aj-00012k-Tt for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:48 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-68859ba3a93so602386b3a.1 for ; Tue, 15 Aug 2023 12:57:45 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129464; x=1692734264; 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=3Hu8xuNnDAHTDqTBUhJjYGuMUXSC+Qs+gzIxHF/zrlE=; b=AYYBe0lfD2Lt/zch4WP35v/tZhp5fIfxxeuHsd0sBQlMeHGKkDw2SMK9qaq2+yF2K+ pKkhtcb0eaU05uAMNrBHpbBE2ZSzrrqQ4mX2e7VS+s8swV86cUkvvlFrh0ccva/JBXOD uwOwWx9Yvh4CZUk5pP9Uiyb5IBDxh+kqciuZTmiDh1wJC/Ck2jeUYZed8/ihX5IbPVl2 qT2rZHZnoUNLUT0250meCGF0SsQqhNRW8zX4lp9oXkADLyTW6/3QHwcWR8yTXILRGzuF WNpv9YYa2ByMsCBxmOjCKWXJgQYbNQIIaimIZqKJugAobLuPB9/+nxQJuY2nAse9X7hP Jy8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129464; x=1692734264; 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=3Hu8xuNnDAHTDqTBUhJjYGuMUXSC+Qs+gzIxHF/zrlE=; b=OPMtZmHdMx/n3vJoaBb0YpuTB+L1sot7qo3yCSCdqqYpIpbX5YN3VJ3azwQke12SMl mEG3fxY6fSoI9kpFzjNg00RAriFkK/+2KmQpoo5CyIhcV+i0ePDpHwRwfEJaB3EFhJ0S ocbHn4XdRQRHfEx5Uy6AxUIPS9oj0AcSW0vq/EQjzU1Shy1sLQLg7XqLG9Ty/HP5pa30 zVhUbaFXomhroT4XqzaUuoW2sQo/sofs13pf4utOAxjp43eAaVb7VRZJflRDgxSEoVV7 2f04ziRJNybpvGjNiKoWQPHvIWhHikTk42Vwd8K8vQPuVjR7lwh9xsLJvHwv2XseJmxy z5Yw== X-Gm-Message-State: AOJu0Yxp7YmFDYTLZpN7rrm5Vu1dBv/B9O0PdEIXLoZOiYt5jG7wggd0 i0EMQby/a+kMY1D/75TpzJr5dyE5kT5Qm7sPcJw= X-Google-Smtp-Source: AGHT+IFAjbW0smhHsPKx8ZFkmLZCrJ7kaWjwsplXYPKG8f8Q0sAHANvPg2VPJ84LKwLcJp6JYseFSA== X-Received: by 2002:a05:6a20:6a10:b0:132:cd2d:16fd with SMTP id p16-20020a056a206a1000b00132cd2d16fdmr13416246pzk.38.1692129464547; Tue, 15 Aug 2023 12:57:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 02/14] tcg: Add tcg_out_tb_start backend hook Date: Tue, 15 Aug 2023 12:57:29 -0700 Message-Id: <20230815195741.8325-3-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129609409100003 Content-Type: text/plain; charset="utf-8" This hook may emit code at the beginning of the TB. Suggested-by: Jordan Niethe Signed-off-by: Richard Henderson --- tcg/tcg.c | 3 +++ tcg/aarch64/tcg-target.c.inc | 5 +++++ tcg/arm/tcg-target.c.inc | 5 +++++ tcg/i386/tcg-target.c.inc | 5 +++++ tcg/loongarch64/tcg-target.c.inc | 5 +++++ tcg/mips/tcg-target.c.inc | 5 +++++ tcg/ppc/tcg-target.c.inc | 5 +++++ tcg/riscv/tcg-target.c.inc | 5 +++++ tcg/s390x/tcg-target.c.inc | 5 +++++ tcg/sparc64/tcg-target.c.inc | 5 +++++ tcg/tci/tcg-target.c.inc | 5 +++++ 11 files changed, 53 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index ddfe9a96cb..1e9b7433bb 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -108,6 +108,7 @@ static void tcg_register_jit_int(const void *buf, size_= t size, __attribute__((unused)); =20 /* Forward declarations for functions declared and used in tcg-target.c.in= c. */ +static void tcg_out_tb_start(TCGContext *s); static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg= 1, intptr_t arg2); static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg ar= g); @@ -6009,6 +6010,8 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb,= uint64_t pc_start) s->gen_insn_data =3D tcg_malloc(sizeof(uint64_t) * s->gen_tb->icount * start_words); =20 + tcg_out_tb_start(s); + num_insns =3D -1; QTAILQ_FOREACH(op, &s->ops, link) { TCGOpcode opc =3D op->opc; diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 35ca80cd56..8d71ac68f6 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -3123,6 +3123,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_insn(s, 3207, RET, TCG_REG_LR); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_out_nop_fill(tcg_insn_unit *p, int count) { int i; diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 83e286088f..7473b23672 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -2951,6 +2951,11 @@ static void tcg_out_epilogue(TCGContext *s) (1 << TCG_REG_R10) | (1 << TCG_REG_R11) | (1 << TCG_REG_= PC)); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + typedef struct { DebugFrameHeader h; uint8_t fde_def_cfa[4]; diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index a6b2eae995..05581dd89d 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -4114,6 +4114,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_opc(s, OPC_RET, 0, 0, 0); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_out_nop_fill(tcg_insn_unit *p, int count) { memset(p, 0x90, count); diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.= c.inc index baf5fc3819..29281e954b 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1698,6 +1698,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_opc_jirl(s, TCG_REG_ZERO, TCG_REG_RA, 0); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_target_init(TCGContext *s) { unsigned long hwcap =3D qemu_getauxval(AT_HWCAP); diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 9faa8bdf0b..b4da737dbb 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2628,6 +2628,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_opc_reg(s, OPC_OR, TCG_TMP3, TCG_TMP3, TCG_TMP1); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_target_init(TCGContext *s) { tcg_target_detect_isa(); diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 642d0fd128..97b7697921 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2482,6 +2482,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out32(s, BCLR | BO_ALWAYS); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_out_exit_tb(TCGContext *s, uintptr_t arg) { tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R3, arg); diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index eeaeb6b6e3..22834d087b 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -2054,6 +2054,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_opc_imm(s, OPC_JALR, TCG_REG_ZERO, TCG_REG_RA, 0); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static volatile sig_atomic_t got_sigill; =20 static void sigill_handler(int signo, siginfo_t *si, void *data) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index a94f7908d6..379aaef1e5 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -3457,6 +3457,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_insn(s, RR, BCR, S390_CC_ALWAYS, TCG_REG_R14); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_out_nop_fill(tcg_insn_unit *p, int count) { memset(p, 0x07, count * sizeof(tcg_insn_unit)); diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index ffcb879211..6458ca202d 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -955,6 +955,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_out_movi_s13(s, TCG_REG_O0, 0); } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + static void tcg_out_nop_fill(tcg_insn_unit *p, int count) { int i; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 253f27f174..95b3352f82 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -955,6 +955,11 @@ static inline void tcg_target_qemu_prologue(TCGContext= *s) { } =20 +static void tcg_out_tb_start(TCGContext *s) +{ + /* nothing to do */ +} + bool tcg_target_has_memory_bswap(MemOp memop) { return true; --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129528; cv=none; d=zohomail.com; s=zohoarc; b=Z3GPGrJ/VYB+3VvioygR62mIVr2wDgRV2uMyDYr8GStMMvueJeRpiTZP02gcoQGESsNQ5kTwqF2zAtgIMRh/ij0PUzxHzo/5+PYYLJuXwRUn13VUJaaj7+N5nlwrFk8d54fH3v0jhzU7cXLdFjbrUV5pFZD7Zdif0MdGt/fLPt4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129528; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RJZ6ogXJOw0J2MAEkk8rAYiluI26jV6bi5dyyeMPndQ=; b=clX2t8zYAEMzg8oVxMKq7f16lsSyrzlbt6SV/C81CzdtrKWKx4ha0lhTnCZfMcD8CJ8WjxBNVnGEyaXuNC/fBgb7sMkoFQyvnpRsrGWEa1aCZBlUGJklAhvXG5v9rRIH0AUBG3OJEZwsNfMmRyS7XLP7p7GluYFO0NGW0Z6Qf10= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129528357196.7836866279606; Tue, 15 Aug 2023 12:58:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Ap-000558-PC; Tue, 15 Aug 2023 15:57:51 -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 1qW0Ao-00054F-R7 for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:50 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Ak-00012w-Vq for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:50 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-686be3cbea0so4570515b3a.0 for ; Tue, 15 Aug 2023 12:57:46 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129465; x=1692734265; 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=RJZ6ogXJOw0J2MAEkk8rAYiluI26jV6bi5dyyeMPndQ=; b=N1rwoCLAkpOk1w3Q52F5mzB5eW4FeBZDJvV2mB7t55UNEodUfKbTMDVuhX/p/Rq84s weJhPxuCrLhpZW70b9dg6PlNe9mZQKA4A3VxvQFd3ev661LeIt27TwjomSWDqwP8srDp oYd5FBiI8qVk44FNri8iEhApbltB3X4/xnvMoh1e/6/7itBV3Baw1hO4cwM9Y0yxD5+G EhbDQfvbxZkfcBvKvQQJSTGYoM/rCUKVTGxSD5f7a0GSk5QWCQ1Q2BAoiBAGUydvtv+n 5KB66mUNMkxaDNR+6IU7CPGmp84ncpZXqWnREn8nMInd6vPRDR5Hk1Ma2utjbgWR/HFe 6gYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129465; x=1692734265; 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=RJZ6ogXJOw0J2MAEkk8rAYiluI26jV6bi5dyyeMPndQ=; b=EgoLyE5b5ZDupZOPPLH0FocdRIF7AOGWEG8CdvYMtJmKQdSt3HfBTcKffistaiSlEg q6hU50f5p/DuVkYhhZ/NJaglPXRn7S74ToWsqsLRbxBFLoFFJ5u3E2AMWSm2p6xRTdi0 P7WNEvTLsILL5Ht3gu1T5zsIehDywgIS/cT4jmAo4GgyB39O/zxKU8au3e4m0jYk6e7y 9GP5fV8e8YOftNuwYGE/ZWpv3Lfqz9dgyphDpbZ9KG/BPsz4TPt9jKyqFCbswpNuGlGo eg1Y5xDCUc3pBGnKazNxAMXLOPDKG5zIs7Uszkh8LEretwiaicTmKaaAIpGyhjiBSZJE 7j7g== X-Gm-Message-State: AOJu0YyqekGQIc6/jWMRiEp7xPwJWP3ZnyPifY5bYyz4SszYqaDO3cvj 1D/G89gMtso1SgwE/WVsrMyBDLKXShexWd5EWb8= X-Google-Smtp-Source: AGHT+IHZib8IuC9nI61INci0AIgBLbg743/dbiv7LnPGv44cVSstcdLeCxzk6tT38zy3PbFPI0g9NQ== X-Received: by 2002:a05:6a00:181f:b0:676:8fac:37 with SMTP id y31-20020a056a00181f00b006768fac0037mr3757658pfa.4.1692129465544; Tue, 15 Aug 2023 12:57:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 03/14] tcg/ppc: Enable direct branching tcg_out_goto_tb with TCG_REG_TB Date: Tue, 15 Aug 2023 12:57:30 -0700 Message-Id: <20230815195741.8325-4-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129529644100007 Content-Type: text/plain; charset="utf-8" From: Jordan Niethe Direct branch patching was disabled when using TCG_REG_TB in commit 736a1588c1 ("tcg/ppc: Fix race in goto_tb implementation"). The issue with direct branch patching with TCG_REG_TB is the lack of synchronization between the new TCG_REG_TB being established and the direct branch being patched in. If each translation block is responsible for establishing its own TCG_REG_TB then there can be no synchronization issue. Make each translation block begin by setting up its own TCG_REG_TB. Use the preferred 'bcl 20,31,$+4' sequence. Signed-off-by: Jordan Niethe [rth: Split out tcg_out_tb_start, power9 addpcis] Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 48 ++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 97b7697921..134a9bbcb6 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2464,9 +2464,6 @@ static void tcg_target_qemu_prologue(TCGContext *s) =20 tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]); tcg_out32(s, MTSPR | RS(tcg_target_call_iarg_regs[1]) | CTR); - if (USE_REG_TB) { - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_TB, tcg_target_call_iarg_regs= [1]); - } tcg_out32(s, BCCTR | BO_ALWAYS); =20 /* Epilogue */ @@ -2484,7 +2481,13 @@ static void tcg_target_qemu_prologue(TCGContext *s) =20 static void tcg_out_tb_start(TCGContext *s) { - /* nothing to do */ + /* Load TCG_REG_TB. */ + if (USE_REG_TB) { + /* bcl 20,31,$+4 (preferred form for getting nia) */ + tcg_out32(s, BC | BO_ALWAYS | BI(7, CR_SO) | 0x4 | LK); + tcg_out32(s, MFSPR | RT(TCG_REG_TB) | LR); + tcg_out32(s, ADDI | TAI(TCG_REG_TB, TCG_REG_TB, -4)); + } } =20 static void tcg_out_exit_tb(TCGContext *s, uintptr_t arg) @@ -2497,32 +2500,22 @@ static void tcg_out_goto_tb(TCGContext *s, int whic= h) { uintptr_t ptr =3D get_jmp_target_addr(s, which); =20 + /* Direct branch will be patched by tb_target_set_jmp_target. */ + set_jmp_insn_offset(s, which); + tcg_out32(s, NOP); + + /* When branch is out of range, fall through to indirect. */ if (USE_REG_TB) { ptrdiff_t offset =3D tcg_tbrel_diff(s, (void *)ptr); - tcg_out_mem_long(s, LD, LDX, TCG_REG_TB, TCG_REG_TB, offset); - =20 - /* TODO: Use direct branches when possible. */ - set_jmp_insn_offset(s, which); - tcg_out32(s, MTSPR | RS(TCG_REG_TB) | CTR); - - tcg_out32(s, BCCTR | BO_ALWAYS); - - /* For the unlinked case, need to reset TCG_REG_TB. */ - set_jmp_reset_offset(s, which); - tcg_out_mem_long(s, ADDI, ADD, TCG_REG_TB, TCG_REG_TB, - -tcg_current_code_size(s)); + tcg_out_mem_long(s, LD, LDX, TCG_REG_TMP1, TCG_REG_TB, offset); } else { - /* Direct branch will be patched by tb_target_set_jmp_target. */ - set_jmp_insn_offset(s, which); - tcg_out32(s, NOP); - - /* When branch is out of range, fall through to indirect. */ 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)p= tr); - tcg_out32(s, MTSPR | RS(TCG_REG_TMP1) | CTR); - tcg_out32(s, BCCTR | BO_ALWAYS); - set_jmp_reset_offset(s, which); } + + tcg_out32(s, MTSPR | RS(TCG_REG_TMP1) | CTR); + tcg_out32(s, BCCTR | BO_ALWAYS); + set_jmp_reset_offset(s, which); } =20 void tb_target_set_jmp_target(const TranslationBlock *tb, int n, @@ -2532,10 +2525,6 @@ void tb_target_set_jmp_target(const TranslationBlock= *tb, int n, intptr_t diff =3D addr - jmp_rx; tcg_insn_unit insn; =20 - if (USE_REG_TB) { - return; - } - if (in_range_b(diff)) { insn =3D B | (diff & 0x3fffffc); } else { @@ -2555,9 +2544,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, switch (opc) { case INDEX_op_goto_ptr: tcg_out32(s, MTSPR | RS(args[0]) | CTR); - if (USE_REG_TB) { - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_TB, args[0]); - } tcg_out32(s, ADDI | TAI(TCG_REG_R3, 0, 0)); tcg_out32(s, BCCTR | BO_ALWAYS); break; --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129580; cv=none; d=zohomail.com; s=zohoarc; b=lN3zT409A+05VW7xDbHeHDq17c1c97bGlBAO0AxREBP5oC7BklVRCfkLc0Nv1R2neAisKx/yepDDRsTjAumcwub+0UY8zZE8YlpVkN86gtFVP0H61GTUz/j5KUtPOh06xadbAtYIXTQZLbYbRJkaqJz4nuiTaEuVo6/Buv3BVp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129580; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZnRqmTnyTo64hM2Ux3fkk6v6JrhGQ8w8rDALkc8lD9A=; b=CjupQqEst8x386xxELXlG5M0SHnh21FQHuqNyuowKs+96vvZg5UXlHWFsyAl1Ei3qO8vbaVZO7qBIK8Sg6JInEh23Bka+zQUNOgY4r8noj3WD3ZmE2tL5dbyDDNDsHBTtNeLV2O/cAK7MjQuh5zr0h4ex3Kk9fpypfi2coMPe1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16921295800971017.3293321910506; Tue, 15 Aug 2023 12:59:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Aq-00055X-I1; Tue, 15 Aug 2023 15:57:52 -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 1qW0Ao-00054E-Qz for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:50 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Al-00013L-Lt for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:50 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-565e6a9ccedso417211a12.1 for ; Tue, 15 Aug 2023 12:57:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129466; x=1692734266; 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=ZnRqmTnyTo64hM2Ux3fkk6v6JrhGQ8w8rDALkc8lD9A=; b=aaXR0WkJlJNjkiOi40rV/P2zmuxkPDflFhvoDjg56kLau7kiZJu8LZ/nyQY2jSgede UpFgPL04nzAG8t6zpJ76xSSW38OKTEbAGhPlWR57rd6W7/hDtK+838ROHi776WB3x5Zz IV02RnQTFP+ELrSbZ9erIabH47Td0XNuHXirRefjZISMqLazL1vcXRZSc2RuIau4eCVT Qs/E2G7e7q/tubdTZPLvFIveo1Ez7YJmNFCfADDKSup8aTqrjV177iudXCJWmAQG7jf3 QTNvHIJ6UKcGWhePrpxuQP62RhdsKLqAxSsDZft5jMl0dr/dbHQLNEqKMG4oy2+8OPXr KZVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129466; x=1692734266; 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=ZnRqmTnyTo64hM2Ux3fkk6v6JrhGQ8w8rDALkc8lD9A=; b=QnLEN6Ot2EuVM8YX6XdPf+dqjzherhLCcZRLPzYKzKacC/5wdSfLvuGNRS1nwjokKj WJQ+NeW9CjSG11eMvdvPZtaaFBfVB9ZmdSjpAat1PzuREcR28KCxusXumsNyv0X3j6pa 9a/lG/Okkv21t/J6MzC0BWQtCQzqWvl9ow9700HpuJ9XY9XRq0f6K+/uNjlTmiBWqRBN YY0C7vzPx67q0EQRRmTyuhEPsbIvRski52bx+8nNNh9z1uuM5LrPmNaUGwF5LuXPiazl VGzXt1Gbz44RXw4bNhcv7C2ThywIYBsBpy37S907+kqGIe+ezslzvmahi5wEOpqTC2z4 pPcA== X-Gm-Message-State: AOJu0Yzc9Bkm/VkSC9Zv7uRAsdSCxld8PeYuhKO4I3cBlouEqugYF8v1 sUKqW4Bb3yiqK3VmsfQ8DyYJJV5cZEhcYgKnUwM= X-Google-Smtp-Source: AGHT+IE3uXH3yvrzTXQDuPntwAtZzw8hrxilut/VqemE2gPVeC/8YhZv1p5BEVm+wADHihOpL/nNbA== X-Received: by 2002:a05:6a20:4415:b0:13b:9d80:673d with SMTP id ce21-20020a056a20441500b0013b9d80673dmr16942774pzb.48.1692129466406; Tue, 15 Aug 2023 12:57:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 04/14] tcg/ppc: Reinterpret tb-relative to TB+4 Date: Tue, 15 Aug 2023 12:57:31 -0700 Message-Id: <20230815195741.8325-5-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129580448100001 Content-Type: text/plain; charset="utf-8" It saves one insn to load the address of TB+4 instead of TB. Adjust all of the indexing to match. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 134a9bbcb6..19004fa568 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -215,6 +215,12 @@ static const int tcg_target_callee_save_regs[] =3D { TCG_REG_R31 }; =20 +/* For PPC, we use TB+4 instead of TB as the base. */ +static inline ptrdiff_t ppc_tbrel_diff(TCGContext *s, const void *target) +{ + return tcg_tbrel_diff(s, target) - 4; +} + static inline bool in_range_b(tcg_target_long target) { return target =3D=3D sextract64(target, 0, 26); @@ -986,7 +992,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType typ= e, TCGReg ret, } =20 /* Load addresses within the TB with one insn. */ - tb_diff =3D tcg_tbrel_diff(s, (void *)arg); + tb_diff =3D ppc_tbrel_diff(s, (void *)arg); if (!in_prologue && USE_REG_TB && tb_diff =3D=3D (int16_t)tb_diff) { tcg_out32(s, ADDI | TAI(ret, TCG_REG_TB, tb_diff)); return; @@ -1039,7 +1045,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType t= ype, TCGReg ret, /* Use the constant pool, if possible. */ if (!in_prologue && USE_REG_TB) { new_pool_label(s, arg, R_PPC_ADDR16, s->code_ptr, - tcg_tbrel_diff(s, NULL)); + ppc_tbrel_diff(s, NULL)); tcg_out32(s, LD | TAI(ret, TCG_REG_TB, 0)); return; } @@ -1099,7 +1105,7 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType t= ype, unsigned vece, */ if (USE_REG_TB) { rel =3D R_PPC_ADDR16; - add =3D tcg_tbrel_diff(s, NULL); + add =3D ppc_tbrel_diff(s, NULL); } else { rel =3D R_PPC_ADDR32; add =3D 0; @@ -2486,7 +2492,6 @@ static void tcg_out_tb_start(TCGContext *s) /* bcl 20,31,$+4 (preferred form for getting nia) */ tcg_out32(s, BC | BO_ALWAYS | BI(7, CR_SO) | 0x4 | LK); tcg_out32(s, MFSPR | RT(TCG_REG_TB) | LR); - tcg_out32(s, ADDI | TAI(TCG_REG_TB, TCG_REG_TB, -4)); } } =20 @@ -2506,7 +2511,7 @@ static void tcg_out_goto_tb(TCGContext *s, int which) =20 /* When branch is out of range, fall through to indirect. */ if (USE_REG_TB) { - ptrdiff_t offset =3D tcg_tbrel_diff(s, (void *)ptr); + ptrdiff_t offset =3D ppc_tbrel_diff(s, (void *)ptr); tcg_out_mem_long(s, LD, LDX, TCG_REG_TMP1, TCG_REG_TB, offset); } else { tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_TMP1, ptr - (int16_t)ptr); --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129556; cv=none; d=zohomail.com; s=zohoarc; b=i2PWrfhcACImh4/6bM/mdo1OqEfs0krtLJ8vb04l174elkVPzUWEuBnfZySTz0uaSqkUllOQZG3s7IpgUyfikNkfWpD4ZiD5ShOTUkVedHfiCfCp9PjvMako/rVdL0mMHQfIv22UAkwkHONLh1+ZOo+uLHSBTS5dIbjUvDucH1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129556; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fgvvzZ0eTjUrFQe9+P0KCKj1UuoBbbqjJKbXrC6sZGQ=; b=EkRZGGDdvim706ibBtb30vAD990ml1rpti4z+R/DrzBF6KgqOeirStd5EzsEgG/x1I47CHzoDGKY7Y4MW/sfWHlykrhIoIOUHyf/fCllC6rmZaFqM8yC/O6JciRFL6MRbP+HgatNBXxgfMFDv5N8ZuzLWGO/g3xKtX6veHfGUg8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129556108551.8600050519484; Tue, 15 Aug 2023 12:59:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0At-00057b-3X; Tue, 15 Aug 2023 15:57:55 -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 1qW0Aq-00055B-3e for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:52 -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 1qW0An-00013l-Sw for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:51 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68876bbecb6so462213b3a.1 for ; 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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129468; x=1692734268; 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=fgvvzZ0eTjUrFQe9+P0KCKj1UuoBbbqjJKbXrC6sZGQ=; b=SLLKOxFhZMbNi7Dw6odspzStJ6g0MC6kXHvs+vXl+BiUsxywdOYfD3yAXmL6r+OZ/V hVTEjtEvpPC9lpeGvGKokZYK6PM6ALqykNU8645rNZ2SjzvOqOfTR4LIVuawvEKNCFni 87V7Cf8m2btrdoLzenoZDbOjHG9jbFNgAPcnpZbe7ck7WaYZCc4V4uVNs2U1EYEPsFQE XiUs9T38WDYJg9s9fLeWM5loPJR8uv1q5QabstL8B0GGUDBFNVQgY4b+tnrKf4uyx9mR NwnOgibsYCOMn8TM5DRMdLg3R2LP/APfabwFXGVMCDL4YzbQe3Y1nhhdRJNJMWM2Nda/ HI6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129468; x=1692734268; 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=fgvvzZ0eTjUrFQe9+P0KCKj1UuoBbbqjJKbXrC6sZGQ=; b=EPG8ZdecMwqQYxB5oII/auK7zFSz9sWY15wCqxBKDLXeR0fBupcVdnxQmseAej3Kb/ BjEzRkCgRXIADxAcJOBf92JGFuvbarDBMKuWiDktq/3gNwFzLX8t1Vkf7phbTIT0sVUs GgQkh8Cb873xJPOwYrcxPjt3d9N0070740jROyBrRuODMlddx0djRlfdsvRGGlDTqymc RmhCls0DAjzQNZSnbYqMj3ejU+k09cL6S7xnaDo427AmSlAlTLMHFpFDreCjX3kyfYfH Fj83ugRjbOPc9kKFPr0MVGTu25mWzKKnKjpfA4+J806vwaQq8+Jbp/Hji7vG8aR07Lg+ G0/Q== X-Gm-Message-State: AOJu0YyMqG5qMESXfnRtQ+/gwrRZHx00/qamhdub74eNJdJp2e8bvpuG eb98nrIX8EizcdTStnHVVkc5Gqjvanlqx/MQ8q4= X-Google-Smtp-Source: AGHT+IHWnmUryb0NElaSyPWB1k2J1sqWTrDuKjPgqjcANuUnc/7bYbUIIi7jdN5XP2tzJ75zx6Ismw== X-Received: by 2002:a05:6a00:1acc:b0:688:4c21:a6f0 with SMTP id f12-20020a056a001acc00b006884c21a6f0mr2145788pfv.18.1692129468589; Tue, 15 Aug 2023 12:57:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 05/14] tcg/ppc: Use ADDPCIS in tcg_out_tb_start Date: Tue, 15 Aug 2023 12:57:32 -0700 Message-Id: <20230815195741.8325-6-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129556956100001 Content-Type: text/plain; charset="utf-8" With ISA v3.0, we can use ADDPCIS instead of BCL+MFLR to load NIP. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 19004fa568..36b4f61236 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -362,6 +362,7 @@ static bool tcg_target_const_match(int64_t val, TCGType= type, int ct) #define CRNAND XO19(225) #define CROR XO19(449) #define CRNOR XO19( 33) +#define ADDPCIS XO19( 2) =20 #define EXTSB XO31(954) #define EXTSH XO31(922) @@ -854,6 +855,19 @@ static inline void tcg_out_sari64(TCGContext *s, TCGRe= g dst, TCGReg src, int c) tcg_out32(s, SRADI | RA(dst) | RS(src) | SH(c & 0x1f) | ((c >> 4) & 2)= ); } =20 +static void tcg_out_addpcis(TCGContext *s, TCGReg dst, intptr_t imm) +{ + int d0, d1, d2; + + tcg_debug_assert((imm & 0xffff) =3D=3D 0); + tcg_debug_assert(imm =3D=3D (int32_t)imm); + + d2 =3D imm & 1; + d1 =3D (imm >> 1) & 0x1f; + d0 =3D (imm >> 6) & 0x3ff; + tcg_out32(s, ADDPCIS | RT(dst) | (d1 << 16) | (d0 << 6) | d2); +} + static void tcg_out_bswap16(TCGContext *s, TCGReg dst, TCGReg src, int fla= gs) { TCGReg tmp =3D dst =3D=3D src ? TCG_REG_R0 : dst; @@ -2489,9 +2503,14 @@ static void tcg_out_tb_start(TCGContext *s) { /* Load TCG_REG_TB. */ if (USE_REG_TB) { - /* bcl 20,31,$+4 (preferred form for getting nia) */ - tcg_out32(s, BC | BO_ALWAYS | BI(7, CR_SO) | 0x4 | LK); - tcg_out32(s, MFSPR | RT(TCG_REG_TB) | LR); + if (have_isa_3_00) { + /* lnia REG_TB */ + tcg_out_addpcis(s, TCG_REG_TB, 0); + } else { + /* bcl 20,31,$+4 (preferred form for getting nia) */ + tcg_out32(s, BC | BO_ALWAYS | BI(7, CR_SO) | 0x4 | LK); + tcg_out32(s, MFSPR | RT(TCG_REG_TB) | LR); + } } } =20 --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129552; cv=none; d=zohomail.com; s=zohoarc; b=R84rorJey6nnSOdIEVGlK6LvADMnCEorY3Ua+skocLnA/LpUHRm5b5WkC63IHSzjNf2UbWwhbDXU5x0uMZFFfPe/h6dRKAuTS6W/PhVVqN4bC2msxtb+oswZU7cb4g4KeBzg5YLnodCkq7YjWyTDowS5xfn/yHQDSvDbvJHmGYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129552; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CAfW4M/c3IgeounQPta3hLHkVcqc5lVrdvZ/euSX+U4=; b=ONM8CfNdFq7dB+mA3YHqwfhQu2YWtruawvKoeiB+uQ6LrvC3timLizDrX5Bf/uSzyhRm3W1pxjdaREo5eWkeSjOMLDP+4pJ5mHMKJL7ddkhcLNKZGU8RYxY0SxDTFdLLAOt/+xUnQmd0gpukWFyO4UN0Z5bRHz1yl41RWEHMI80= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129552002693.5446782595752; Tue, 15 Aug 2023 12:59:12 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AGHT+IHEr1qGnuFuy98LMxQO6hfC8XAlMa2EW0jNgFXoAq1QXhJv48BawK2YiwGEdkZEs8jlFc8/sQ== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129552876100003 Content-Type: text/plain; charset="utf-8" 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; } =20 + /* Load addresses within 2GB with 2 insns. */ + if (have_isa_3_00) { + intptr_t hi =3D tcg_pcrel_diff(s, (void *)arg) - 4; + int16_t lo =3D hi; + + hi -=3D lo; + if (hi =3D=3D (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 =3D=3D (int32_t)tb_diff) { tcg_out_mem_long(s, ADDI, ADD, ret, TCG_REG_TB, tb_diff); --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129644; cv=none; d=zohomail.com; s=zohoarc; b=lWLnR8WE6uMa7Fuai5069ZRFNd1Zg9iBDZpMFeeTdPurhHX2Mxl8yKfekD3O7g6XcTVaCenJNroxBdrgt7XvmkYhAn1zoomGcJgHe86jGbXwLXAmYe9YRr1nqpQ1OVSCAWldgD4PTq+u2yw8aDGr8WkKWDnjQpE1kBN1kU4Ffb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129644; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a3aggFvLmkyyl4eR3KUMuICtg6+359fE3pW160k38Qs=; b=dvegS3HLfaJl2v/MCXnXqb8LAuwVRE9G/FM7ehzmqo3EJvZvm58DNXuk1YzPMoLLvXU24RzLwi9PQcgNCrweVl4U41qKo6aEOiwBVzKyStkMdqaSMJX2MWpsX5HwpAjr6BS0gbzT0yBCcbOhMFiLb4VwWylZ9hoZSR1rrpgFOWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129644292427.8561473743557; Tue, 15 Aug 2023 13:00:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Au-00058i-Pz; 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 1qW0As-00056g-1Q for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:54 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Ap-00014T-H6 for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:53 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-686f1240a22so5734502b3a.0 for ; Tue, 15 Aug 2023 12:57:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129470; x=1692734270; 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=a3aggFvLmkyyl4eR3KUMuICtg6+359fE3pW160k38Qs=; b=KkdJjxmPf9lI7OCk0OpP8JtvjIIzlItLrvtHxYv+gvd1uCAELXYT593RWMuWAJmnYq JjRG3IkYCQuBMScU6olOkgbI3o8HDCmrGNTLF8E5x3c8b8Biw5Cqr9Of5YEugAVYBvuW XRX/8dCpUvM1cAo9lO0sEBAvFF64vp5otLcOAL/puunKnzcB9d+2VCzSvmmPZlYWGKaM hF0pvcwYavtL/w8Dz7viVXwaUB24YHbHDaYHUtbMGUl0z3TzsxNlU/Q8GX64n9cwTOge PaPHkZH2+GWUAO8AZ9itLF33d2SY2w9kfYl/+sLIetmxSMtI2UwDEMJpVAYkMLAO2iKX dL4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129470; x=1692734270; 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=a3aggFvLmkyyl4eR3KUMuICtg6+359fE3pW160k38Qs=; b=LZsZXAgRDJYccHXzw+hiHXqwb74JLlMBUSGNih08Smy5b8Ui0c8RYk1x8gDFfZ9FQh D6oXGXT5HkQN4E/BL5qrY0nnpJBEI7KlnphxiRXsUnsYlx8CPteLirBlanZa4ukY47RA qXzlaig8wzKdvZq83ZIJ5AivTe6GH1FlwrzOYhba3v/UXHLuWFXU4dveJxCZ4YWL3hDO X8iZ1KvbGixwsmwICmQPM2qVHS/y9mnrs7TU+TWuTFhnWTavyLV90MLf75h3pqq0fDiC +868RRjcBOGZgUHFMhagmfB7OZYSL5wqXoW8GZIRyD24fIEa01OE/NviXGLG5h3wzy/7 WB5Q== X-Gm-Message-State: AOJu0Ywa/9AYebwyFkpxYbOVFeOLASZg2tJ8dOPct6+gAJVjGxfKP6WQ c96VLY6e6E12KzeiReDt9V5RZOXdwqrAxiUNFh4= X-Google-Smtp-Source: AGHT+IHIhI7VmVhk3kkyvqBKothXLGqeCknbaLhFRHR6LM2XX6uqaDeXWoKIpsQjOGIT1sYHkOG0NQ== X-Received: by 2002:a05:6a20:748b:b0:132:2f7d:29ca with SMTP id p11-20020a056a20748b00b001322f7d29camr17481785pzd.24.1692129470227; Tue, 15 Aug 2023 12:57:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 07/14] tcg/ppc: Use ADDPCIS for the constant pool Date: Tue, 15 Aug 2023 12:57:34 -0700 Message-Id: <20230815195741.8325-8-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129646339100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index a302bfff2e..a5c1891eb6 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1076,6 +1076,12 @@ static void tcg_out_movi_int(TCGContext *s, TCGType = type, TCGReg ret, tcg_out32(s, LD | TAI(ret, TCG_REG_TB, 0)); return; } + if (have_isa_3_00) { + tcg_out_addpcis(s, TCG_REG_TMP2, 0); + new_pool_label(s, arg, R_PPC_REL14, s->code_ptr, 0); + tcg_out32(s, LD | TAI(ret, TCG_REG_TMP2, 0)); + return; + } =20 tmp =3D arg >> 31 >> 1; tcg_out_movi(s, TCG_TYPE_I32, ret, tmp); @@ -1133,6 +1139,10 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType = type, unsigned vece, if (USE_REG_TB) { rel =3D R_PPC_ADDR16; add =3D ppc_tbrel_diff(s, NULL); + } else if (have_isa_3_00) { + tcg_out_addpcis(s, TCG_REG_TMP1, 0); + rel =3D R_PPC_REL14; + add =3D 0; } else { rel =3D R_PPC_ADDR32; add =3D 0; @@ -1159,6 +1169,8 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType t= ype, unsigned vece, if (USE_REG_TB) { tcg_out32(s, ADDI | TAI(TCG_REG_TMP1, 0, 0)); load_insn |=3D RA(TCG_REG_TB); + } else if (have_isa_3_00) { + tcg_out32(s, ADDI | TAI(TCG_REG_TMP1, TCG_REG_TMP1, 0)); } else { tcg_out32(s, ADDIS | TAI(TCG_REG_TMP1, 0, 0)); tcg_out32(s, ADDI | TAI(TCG_REG_TMP1, TCG_REG_TMP1, 0)); --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129560; cv=none; d=zohomail.com; s=zohoarc; b=SvQ7S+QE11GWTxaW+iRoF4KatC1ElQlyfQ5aHHVARFoDyjei9iw1zjxOe1aFM6R+gv1+HzJ8RSU6ALpecs9GZpWGdpR541HpaMmEkyFF/x+yuOpmJF8veW7RbCOo4tuaqJwotfQTQc79u7XUq8Ix/CnK9jT8QceIKeP7L1diUEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129560; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2a12Z19iXsASCqZDsR31Txy9HCN36MK3mWzwcxfOs68=; b=P1oyJHWT0oGEAi1fKJMukbDD0GaG2ze9LExJOY9ciCoRp7SzoSSJCNvhHmkh/yGt3VO4/APB30tY4/JGr/aoXoz9bLAj8cADLA91R6QrUDQwZEmztWpI1pxzRPegKh9dlcCQ5dnwr7OLc+IiAzVv60ni4XfAo2iFpu7lcMZrflE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129560972762.3619719342529; Tue, 15 Aug 2023 12:59:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Av-00059D-B4; Tue, 15 Aug 2023 15:57:57 -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 1qW0At-00057Z-1G for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:55 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Aq-00014m-Os for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:54 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6887918ed20so321727b3a.2 for ; Tue, 15 Aug 2023 12:57:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); 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=1692129471; x=1692734271; 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=2a12Z19iXsASCqZDsR31Txy9HCN36MK3mWzwcxfOs68=; b=glcOeLGmS1pANxTeXrZnAv2hfWb/QJxbm0ypXqKLAgXseZrAvGMGO7xMVDDXpWFnT8 QWHyLes3m5Jihh4dDG8BgtsLQZpXy4hcvYREl3ROHly6OMcb38Uvd5QuwgLg6AoJepqv VUL05eMencyEeDfr1bKVEacIDVOKvqKaWwh0OZZH2CkGyz7FUigbADIjAWpdOeb/epWZ 67Bml6Q0Kcpu4f+DUUMA7GlJ9IozEk2ArRoywDzmFUcKZrjtX2KS7Rps1gvGKo/Zn+CP ksiAyC576xdQQVkLPGDS4wDCwebb2W6Gk5N5nqx/y4t8cTtjUU5ub64pJuBTPcrsrBAl jNBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129471; x=1692734271; 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=2a12Z19iXsASCqZDsR31Txy9HCN36MK3mWzwcxfOs68=; b=T+skLMNrG18QYRzpUhYKTWACNddErYAl3n181iDzO3AZx2brcgc9PL4R4ITZvHWc4C 0I4VWFg5HzaTOylPn8Asxeh7BpYFtCpNiSVaDvfI3t+OcE0UsKl+lmV7N4YrlTnYvOUm PHvBZwyDY3qkk/7EWRusnQdt/RudWoLb/M8f/WuPNywnfaR4l0mZvAaIJMn3QlgSgeO7 YwYy5rcXwFESApD0nLQ2a4lIjpS0EL3rW/zXviTlYPTo2eWXgW1wvVgMSoggQiBGHn5/ igfUet7sLbbk5BUKrORCcc5ewND3qTz5gUlBVcxXevoTLHiTVOb3VxJPpPjeGfsCfcYk dPBw== X-Gm-Message-State: AOJu0Yy6E6WbhEu40Nd7aMwUUcq4z4zD37vUClKTBnOYGSsBpOjWH6Mj gZ4cksm14WSSRy3+nj/p1wM5uLb+qfsfu5dSy/M= X-Google-Smtp-Source: AGHT+IEhybxdv4IEQf/HGShZ7x99/DkHed6uKyJln8jaAkszcM0ffnEHdlBzJjuQrY9hBgzpiPtH2w== X-Received: by 2002:a05:6a20:42a0:b0:129:d944:2e65 with SMTP id o32-20020a056a2042a000b00129d9442e65mr20044110pzj.13.1692129471107; Tue, 15 Aug 2023 12:57:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 08/14] tcg/ppc: Use ADDPCIS in tcg_out_goto_tb Date: Tue, 15 Aug 2023 12:57:35 -0700 Message-Id: <20230815195741.8325-9-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129562874100003 Content-Type: text/plain; charset="utf-8" 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 a5c1891eb6..b7d1b4f1bb 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2548,6 +2548,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 =3D get_jmp_target_addr(s, which); + int16_t lo; =20 /* Direct branch will be patched by tb_target_set_jmp_target. */ set_jmp_insn_offset(s, which); @@ -2557,9 +2558,15 @@ static void tcg_out_goto_tb(TCGContext *s, int which) if (USE_REG_TB) { ptrdiff_t offset =3D 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 =3D tcg_pcrel_diff(s, (void *)ptr) - 4; + lo =3D 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)p= tr); + lo =3D 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); } =20 tcg_out32(s, MTSPR | RS(TCG_REG_TMP1) | CTR); --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129652; cv=none; d=zohomail.com; s=zohoarc; b=HGBMxno/lIqo5m4QmPy2TuzZxGfsuoYWziPVMAGUOv+0PqAzpamgixhnFvKC9c7ZHCL9+jIDEkOKlYCMBh+cn3HAcOJa6TrQTadRF+vwEBEYbiDEWI/8G53n3cz3cut6rMeR3aPjF+5LxYiR/7Ex9OFm3hcrPjQGMZkyc4fts0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129652; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3yC0mxP+Pzdku/R2U4WTUfNcg5S21JJsMYdzIv6kLFM=; b=LAVZen43sZGoYWfwNJAsenj4FB8qeDvgzioBMDj4hwzVILAW1QW8MIa+e7VSRwBGV6fafuZrG00rbwnO3svDQP3YaIwehflbOzukxYopiQs2caxS6crOLXst5ujUWAcRL7xsdoaXOWlkdmeB5XtBPVYasuC4em22jEQvosWCn38= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129652630903.1659970014044; Tue, 15 Aug 2023 13:00:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Ax-0005AT-1f; Tue, 15 Aug 2023 15:57:59 -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 1qW0Au-00058Q-Dj for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:56 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Ar-000151-6Z for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:55 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-686ba29ccb1so3897348b3a.1 for ; Tue, 15 Aug 2023 12:57:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129472; x=1692734272; 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=3yC0mxP+Pzdku/R2U4WTUfNcg5S21JJsMYdzIv6kLFM=; b=YjELarhXxYAmk6Gw2a3lI0J16SSyPIWBrh/gEeiXfSSE+hf5ZX0gjSzTgexkuilwWr u+s/OshZSJzIOw0oJF33mdxlqs9nAgP3PR17Kv8vnExd7OSw7Rq966xOdab4TBg1Wxor 6SIpezfQSDmvN9MpTOzBrHn+4qUgIKGcNl74n4vG1cpz+KAKsM3w5wq4l5TZtNB2iPMV yobdiUmgPTbyik6M8E+dPRlF4XSPDeVkCONeoSEpmPHYidnEPRBFE+e8C6vv4H/z8lzt L7zg2DDMAbVqVmOAiJsEpeQ0vjU3xGlU0/iSqAaH7kiNp5PEwa4kNk+f0tsWaUPZ0qPN I5zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129472; x=1692734272; 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=3yC0mxP+Pzdku/R2U4WTUfNcg5S21JJsMYdzIv6kLFM=; b=htoPolQCYx2/K6hUhXtjazKgYDZovZMLJCafVuVCjhgfv5dqCGy7OSj8hN6d+StydQ PmPRBV8qlL6sblcEVSG6IUF7jfocKnUIE2bVspiI6tr6hUqla/by0HUY1NWzb3pDj18j JMZ6CX9IrH14xx1P7T+yKSAZHUjf3m7EwyEvC2mVCFWd30xsC91NYeSeYqQTN5bi1nar EEvd4N5pBIsbHlvB77IO1tFJZmrlRRVa/wa+h3jkJgY78buXnbg/W3AzzJ34FPI97J7d ko29WrtYdo1EL73i5kkB+c2QvORqF/MrO78LclZ9DpfmOZzdnGZmCLeva5UrTED7wfHs 5NUA== X-Gm-Message-State: AOJu0YxC7j9wN4Wa6FTcurAKI3RsV2VgC1S46IfvSdg9NownZngKnIAn VDmZQjd/ODnxWKzGOPMwWEo9EjA2nafB/Uk+EIQ= X-Google-Smtp-Source: AGHT+IFpxqFJrhKk6a4hnsSQNnBJ3s2roGPqX1B2zc9yb+rY4iNV7RCz3ox2BJgTi3fp28ns4GZNmQ== X-Received: by 2002:a05:6a00:1392:b0:687:9785:13c7 with SMTP id t18-20020a056a00139200b00687978513c7mr3799044pfg.13.1692129471957; Tue, 15 Aug 2023 12:57:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 09/14] tcg/ppc: Use PADDI in tcg_out_movi Date: Tue, 15 Aug 2023 12:57:36 -0700 Message-Id: <20230815195741.8325-10-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129654725100003 Content-Type: text/plain; charset="utf-8" PADDI can load 34-bit immediates and 34-bit pc-relative addresses. Reviewed-by: Jordan Niethe Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index b7d1b4f1bb..40472f3d00 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -714,6 +714,38 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int t= ype, return true; } =20 +/* Ensure that the prefixed instruction does not cross a 64-byte boundary.= */ +static bool tcg_out_need_prefix_align(TCGContext *s) +{ + return ((uintptr_t)s->code_ptr & 0x3f) =3D=3D 0x3c; +} + +static void tcg_out_prefix_align(TCGContext *s) +{ + if (tcg_out_need_prefix_align(s)) { + tcg_out32(s, NOP); + } +} + +static ptrdiff_t tcg_pcrel_diff_for_prefix(TCGContext *s, const void *targ= et) +{ + return tcg_pcrel_diff(s, target) - (tcg_out_need_prefix_align(s) ? 4 := 0); +} + +/* Output Type 10 Prefix - Modified Load/Store Form (MLS:D) */ +static void tcg_out_mls_d(TCGContext *s, tcg_insn_unit opc, unsigned rt, + unsigned ra, tcg_target_long imm, bool r) +{ + tcg_insn_unit p, i; + + p =3D OPCD(1) | (2 << 24) | (r << 20) | ((imm >> 16) & 0x3ffff); + i =3D opc | TAI(rt, ra, imm); + + tcg_out_prefix_align(s); + tcg_out32(s, p); + tcg_out32(s, i); +} + static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt, TCGReg base, tcg_target_long offset); =20 @@ -1012,6 +1044,25 @@ static void tcg_out_movi_int(TCGContext *s, TCGType = type, TCGReg ret, return; } =20 + /* + * Load values up to 34 bits, and pc-relative addresses, + * with one prefixed insn. + */ + if (have_isa_3_10) { + if (arg =3D=3D sextract64(arg, 0, 34)) { + /* pli ret,value =3D paddi ret,0,value,0 */ + tcg_out_mls_d(s, ADDI, ret, 0, arg, 0); + return; + } + + tmp =3D tcg_pcrel_diff_for_prefix(s, (void *)arg); + if (tmp =3D=3D sextract64(tmp, 0, 34)) { + /* pla ret,value =3D paddi ret,0,value,1 */ + tcg_out_mls_d(s, ADDI, ret, 0, tmp, 1); + return; + } + } + /* Load 32-bit immediates with two insns. Note that we've already eliminated bare ADDIS, so we know both insns are required. */ if (TCG_TARGET_REG_BITS =3D=3D 32 || arg =3D=3D (int32_t)arg) { --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129528; cv=none; d=zohomail.com; s=zohoarc; b=hKJi09MQh1p3zqz38WLso65dRhltRBg6z6g5Lr51QuE8xLyyfmxBvRFOTvM74VXpsRdAOH7lbfIUZ/4a941CdUoKyAorPv0bgwmwh+YORFxzWWdzKDJd8U57utz9cpr07K134f+/vmgp2VrJxVnCGxueMquVcqeWc+qbbs5qWk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129528; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NqBKPmbTeyzbaEOoqwFakyRjcnv8k/gpOjB7jfp4teM=; b=OL5i96/nJ24rqekIDbDliyfM1+PMOsc00aYKmwZjJlIvpf58WZsr7V842eY5oXiMQV+SFBoaBKx/aHPPRosD9V4zLesNy5/M6+OoM5AaFfK6weWDZcGQayr3R+anc5so1qXksT0wGVAb4DX/dZ5ovZm5vkzcKcE9BfumpD/Gck0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129528560792.1677413908063; Tue, 15 Aug 2023 12:58:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Aw-0005A8-LJ; Tue, 15 Aug 2023 15:57:58 -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 1qW0Av-00059B-5e for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:57 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0As-00015Y-Hp for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:56 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6887059f121so586573b3a.3 for ; Tue, 15 Aug 2023 12:57:54 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129473; x=1692734273; 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=NqBKPmbTeyzbaEOoqwFakyRjcnv8k/gpOjB7jfp4teM=; b=Iph7fDMSyC3A81kverLqvoj0p1sM6GHXO+KQgSLyJzG5NGNdsTj/tIgS1vg2lycEaU VNC5jzIKPkpSuUonn+zIG1LC9rNVS3zwh082eCRRyBBZcetZ2JwLq1TFSW37acAoIL5G zJSzve5W70Gd8B1uqp80DEM4bNhO4AXCPHwoCOg0ZmUlZaZriXOE4uqw33T97Et0Isg7 7YsvhnP5YDi4Rln01YwzH0JJEgEeIRwrHZIG0gxSioK3Wl9BUpN+eELt13BRUuXu7e/W dssDLh0LaX4hvxIt3NI3xTPQ0D7Mq6ylECbQDkS11Q6MI+F+8yGmM2ILX1lHhSMFalK7 b6dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129473; x=1692734273; 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=NqBKPmbTeyzbaEOoqwFakyRjcnv8k/gpOjB7jfp4teM=; b=eAsSGICywoJLCVIsYw8HcpR3X4jsjOy2PPkdaBXdi+P7e8fE+rNC4disqiK0evgReR e3Myb3fg5oBKswAdL2VyRq8tUAGFipDHkTwolTnmvP5UUjBjs1gWDAo5e3Lgg3XyxeI4 AaO19JQJwiPKSWcgcCIQ2lROZsQ6jk8KFZLUwt2iJ9j7kN+8jfU6QsAKC6rfIHXHKkTL htugxcPwtIJe81QbhWY147y2C+o7hjGkwiOuBHybHbfQbtRcVjM2mRIHX+KLIT2pIUxF zyaAormSJ9YGudFDb2sZV1floy+huBrexdxlloCTQiaa9ArlJvv2knH0Us2iyxSWO0j5 +7Xg== X-Gm-Message-State: AOJu0YzUKv80bQnk89PnyOPFnDRyp6ditbBVmrso1qYwnhOHB7gnEBZa Orgzhep+F2OMGknnlu/rb/bvOfIkXevSGgxvFHM= X-Google-Smtp-Source: AGHT+IGGAX6z3G07PO5zgZM9KKODvOBEVjri7RFbhKcyOtI7D+bFdCw7j0HYnXH38iwsofs+MRtjdA== X-Received: by 2002:a05:6a00:2e20:b0:686:be77:431c with SMTP id fc32-20020a056a002e2000b00686be77431cmr14303019pfb.13.1692129473034; Tue, 15 Aug 2023 12:57:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 10/14] tcg/ppc: Use prefixed instructions in tcg_out_mem_long Date: Tue, 15 Aug 2023 12:57:37 -0700 Message-Id: <20230815195741.8325-11-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129530689100015 Content-Type: text/plain; charset="utf-8" When the offset is out of range of the non-prefixed insn, but fits the 34-bit immediate of the prefixed insn, use that. Reviewed-by: Jordan Niethe Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 40472f3d00..1aece2cbf7 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -329,6 +329,15 @@ static bool tcg_target_const_match(int64_t val, TCGTyp= e type, int ct) #define STDX XO31(149) #define STQ XO62( 2) =20 +#define PLWA OPCD( 41) +#define PLD OPCD( 57) +#define PLXSD OPCD( 42) +#define PLXV OPCD(25 * 2 + 1) /* force tx=3D1 */ + +#define PSTD OPCD( 61) +#define PSTXSD OPCD( 46) +#define PSTXV OPCD(27 * 2 + 1) /* force sx=3D1 */ + #define ADDIC OPCD( 12) #define ADDI OPCD( 14) #define ADDIS OPCD( 15) @@ -732,6 +741,20 @@ static ptrdiff_t tcg_pcrel_diff_for_prefix(TCGContext = *s, const void *target) return tcg_pcrel_diff(s, target) - (tcg_out_need_prefix_align(s) ? 4 := 0); } =20 +/* Output Type 00 Prefix - 8-Byte Load/Store Form (8LS:D) */ +static void tcg_out_8ls_d(TCGContext *s, tcg_insn_unit opc, unsigned rt, + unsigned ra, tcg_target_long imm, bool r) +{ + tcg_insn_unit p, i; + + p =3D OPCD(1) | (r << 20) | ((imm >> 16) & 0x3ffff); + i =3D opc | TAI(rt, ra, imm); + + tcg_out_prefix_align(s); + tcg_out32(s, p); + tcg_out32(s, i); +} + /* Output Type 10 Prefix - Modified Load/Store Form (MLS:D) */ static void tcg_out_mls_d(TCGContext *s, tcg_insn_unit opc, unsigned rt, unsigned ra, tcg_target_long imm, bool r) @@ -1413,6 +1436,49 @@ static void tcg_out_mem_long(TCGContext *s, int opi,= int opx, TCGReg rt, break; } =20 + /* For unaligned or large offsets, use the prefixed form. */ + if (have_isa_3_10 + && (offset !=3D (int16_t)offset || (offset & align)) + && offset =3D=3D sextract64(offset, 0, 34)) { + /* + * Note that the MLS:D insns retain their un-prefixed opcode, + * while the 8LS:D insns use a different opcode space. + */ + switch (opi) { + case LBZ: + case LHZ: + case LHA: + case LWZ: + case STB: + case STH: + case STW: + case ADDI: + tcg_out_mls_d(s, opi, rt, base, offset, 0); + return; + case LWA: + tcg_out_8ls_d(s, PLWA, rt, base, offset, 0); + return; + case LD: + tcg_out_8ls_d(s, PLD, rt, base, offset, 0); + return; + case STD: + tcg_out_8ls_d(s, PSTD, rt, base, offset, 0); + return; + case LXSD: + tcg_out_8ls_d(s, PLXSD, rt & 31, base, offset, 0); + return; + case STXSD: + tcg_out_8ls_d(s, PSTXSD, rt & 31, base, offset, 0); + return; + case LXV: + tcg_out_8ls_d(s, PLXV, rt & 31, base, offset, 0); + return; + case STXV: + tcg_out_8ls_d(s, PSTXV, rt & 31, base, offset, 0); + return; + } + } + /* For unaligned, or very large offsets, use the indexed form. */ if (offset & align || offset !=3D (int32_t)offset || opi =3D=3D 0) { if (rs =3D=3D base) { --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129665; cv=none; d=zohomail.com; s=zohoarc; b=R9o0M/U2c+f9ZKzaXValbjSqxxR90S/1MGaM2By4N9ev+c31nAFkjd0vfPtB8Co60OZ/SybqQzmbsE9URMW61JNVcVetonvDiCtdv4RP1793fSOCSmERYzc9dlcowQtCeCoAuUZWEwxnHS5heyeS9p9iOs8DbMmjM7GWdX6/fYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129665; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pu9KEBeJ8el0D1W01E7RaWKVL1yngJNhhEobU208UWE=; b=CnbKLImD/wlP/tWof0A+pvsapiPy+Mmjw0AtuIoo6FX3HqA8+022cgX8zxwdhs8UUDr2dt8uOfTY5p+0PYE6oLlH4n7WvBogTNtaraXS3GggtPb6F+Dc2fTtGSBEoI9KfXjrkK+WhVwVL4ov/PW7nP7PwWuSKaWNgBytq6Nmhk4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129665591558.630768825365; Tue, 15 Aug 2023 13:01:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Ax-0005BK-KV; Tue, 15 Aug 2023 15:57:59 -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 1qW0Aw-00059x-6p for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:58 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0At-00015q-7V for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:57 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-686efa1804eso3931879b3a.3 for ; Tue, 15 Aug 2023 12:57:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129474; x=1692734274; 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=pu9KEBeJ8el0D1W01E7RaWKVL1yngJNhhEobU208UWE=; b=PQS7Veyxa8xlO69A62nAoJkL51SxfZU5sICvPXZE45pZxkmLCow05I2o/JDNcX0od7 dasyY7gRq3K2TMZILUiXTjF/BD13DdLtz7bEozaw0Z/SgWIEV9lNvKZPaTQY4sCq+GKA ybiHU6dgP9uVvAjfuNfuffZsijSMNm8Il3YH0EUN482mPajjOYom1EFiEBA5kFdnV2TM xiMGTpleBSOMUaw9C5yVIvu2iPttyooiMivIzkkNW3pyZoSCf+APUb8ovlSQ8/J7zb2x WV5GnvPy7nM9c0fPo4/BGge0Fo4UrxS66XJ8wPwyHhUJPbjX6+gcN6lFYdu2RbXhC9NL fodw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129474; x=1692734274; 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=pu9KEBeJ8el0D1W01E7RaWKVL1yngJNhhEobU208UWE=; b=IlAzIehpVtTZzK+PGAJsGjsQbhbxDZWmyrTQ/YglDBkwwIi2FS5k4Z++rkb+38EROF TEnaOG5AlWjFynN+nFPTFmP7axnmvYzqL2Yom+gYrcy+7Lou2sgHY4Mjnk0vbUs/JUiW 4Qg7K3fa9hV2QX9GyqRQDrGOPY3fXYLV4kp9Qyq0NVdjeZ4W3X9HFOxBLB0I6wThKWWK GtGpiMDr+pTpQAjdtSGfR3SJcL1YcD9phnRV9dBzQ6N+qvAbCGGnDB83i5cGgiB0V2ES F9HkZSM/XV+Zw6+Q316s0QtTd1Nlh1YNZMP8gFlDbcQq2wt3euP94xmAZzUFvvoqZvnF ORBw== X-Gm-Message-State: AOJu0YzsceWLtKJarHbefzQhEUm9TBoS8EwRlfrF4xN5XehrS/Vve0fD lzATQgNdhUaeHSgM9SEE5xubQ4T1R254+3KRyF8= X-Google-Smtp-Source: AGHT+IEG+SWmRzhBdd5c+he4JPYFCn4esQdgUKhlpOjD/tv0BnfWOvnWuaeCjPBvv5FgAdm9M8MeYA== X-Received: by 2002:a05:6a00:2345:b0:687:14df:51a9 with SMTP id j5-20020a056a00234500b0068714df51a9mr13923290pfj.12.1692129473936; Tue, 15 Aug 2023 12:57:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 11/14] tcg/ppc: Use PLD in tcg_out_movi for constant pool Date: Tue, 15 Aug 2023 12:57:38 -0700 Message-Id: <20230815195741.8325-12-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129667151100003 Content-Type: text/plain; charset="utf-8" The prefixed instruction has a pc-relative form to use here. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 1aece2cbf7..670811b636 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -101,6 +101,10 @@ #define ALL_GENERAL_REGS 0xffffffffu #define ALL_VECTOR_REGS 0xffffffff00000000ull =20 +#ifndef R_PPC64_PCREL34 +#define R_PPC64_PCREL34 132 +#endif + #define have_isel (cpuinfo & CPUINFO_ISEL) =20 #ifndef CONFIG_SOFTMMU @@ -266,6 +270,19 @@ static bool reloc_pc14(tcg_insn_unit *src_rw, const tc= g_insn_unit *target) return false; } =20 +static bool reloc_pc34(tcg_insn_unit *src_rw, const tcg_insn_unit *target) +{ + const tcg_insn_unit *src_rx =3D tcg_splitwx_to_rx(src_rw); + ptrdiff_t disp =3D tcg_ptr_byte_diff(target, src_rx); + + if (disp =3D=3D sextract64(disp, 0, 34)) { + src_rw[0] =3D (src_rw[0] & ~0x3ffff) | ((disp >> 16) & 0x3ffff); + src_rw[1] =3D (src_rw[1] & ~0xffff) | (disp & 0xffff); + return true; + } + return false; +} + /* test if a constant matches the constraint */ static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { @@ -691,6 +708,8 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int ty= pe, return reloc_pc14(code_ptr, target); case R_PPC_REL24: return reloc_pc24(code_ptr, target); + case R_PPC64_PCREL34: + return reloc_pc34(code_ptr, target); case R_PPC_ADDR16: /* * We are (slightly) abusing this relocation type. In particular, @@ -1150,6 +1169,11 @@ static void tcg_out_movi_int(TCGContext *s, TCGType = type, TCGReg ret, tcg_out32(s, LD | TAI(ret, TCG_REG_TB, 0)); return; } + if (have_isa_3_10) { + tcg_out_8ls_d(s, PLD, ret, 0, 0, 1); + new_pool_label(s, arg, R_PPC64_PCREL34, s->code_ptr - 2, 0); + return; + } if (have_isa_3_00) { tcg_out_addpcis(s, TCG_REG_TMP2, 0); new_pool_label(s, arg, R_PPC_REL14, s->code_ptr, 0); --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129528; cv=none; d=zohomail.com; s=zohoarc; b=bdnAlVKbN53o6s8b5ggMmUPQqu/MGZQ90SAYU9AxOpKyan5ifE5lgOiQT+Gx/vAZ2MdM3I2+I2ncujIrjV+2FUnKRHLsxEqsbH0fXZHfLm4RBHJ5J9hRkZ88Ur/9xWFjj07bpEktGj5rIo0vhKU8X10PwMh9Qg2rtI8/Ag+omU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129528; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PCV3wYEQOpmY72+V1Mb+CICelf2ZsmJiYhnZyGKj9m8=; b=BN2ezXBgMNNAFol/luBDfTrx4CrJb9fKhmrzXcpBYaVV6CHz05C4vFwy08eXwaBpYeUR935rSs0ZJfyAJIP97YKHT9IMHNnaikJieggmLJ3DAxaDU6DBLNeSptcTlt0Yu3JIH3lKfG+9Jc1o/vRjkewNWKfqP5maXQvFoJEFVjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16921295284741000.0664023201446; Tue, 15 Aug 2023 12:58:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Ay-0005Bu-Cg; Tue, 15 Aug 2023 15:58:00 -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 1qW0Ax-0005Al-1j for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:59 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Au-00016D-6c for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:58 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6884310ee75so1651161b3a.1 for ; Tue, 15 Aug 2023 12:57:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129475; x=1692734275; 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=PCV3wYEQOpmY72+V1Mb+CICelf2ZsmJiYhnZyGKj9m8=; b=jepb0RVIsMULAKTqzdRUKu+sAVtNG8seMOupuNlbyzzQXeU4V+3MExnJFjOVSAcjsV h3KGPPTTDPeIammroCAX8VHFmyyRfqwpiMrZhwkKEYGDEaR76Z7lIGP7vwNmEV3mGann CJfNIY76uKlq04N9pXxCHSlAwkIfr4jDtuVFrwL6l49iozlEJn/yE7ZSqe/ssZKbcWee Lqye4GO67SdpGYVyP2gwuHqa2kYSP9mCJ25KWfrt/00rc6PPYhNcXy5eN+AuByd9Dfto ktovGiXcTwawiJpX8w/yTlKBNX19IQGWh+esekpxp72q+yXiSvPJUnPYuiaELMuV1yRl hsqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129475; x=1692734275; 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=PCV3wYEQOpmY72+V1Mb+CICelf2ZsmJiYhnZyGKj9m8=; b=AQe4GM2r7PIbErZPYWbQUpEpATRRrX9ar+LC59kldh9q7Mi186E2blU5rokBSW9MpV UV7zmEejL2y1rI7PXXyGM1t496NGXYD9wIh+6RCCT9r3qw79ZKjvVV2VBhHFU3yNWz8n KedYbBuBcs5sDw+yd+8atHsPh+04j/wTSchfWtwmha3IetZTHDbNStuRhE8uvKgnnxrL WSx9YsXJ03rZUkhQ10HVHeo311bAdIULSQXmanSrKeBIHfrw5uOmAqu1GbtCsDsLPPjx vuuITs7TAIQHBIfPvC7Pkrvu3+xDV43lEJJ6v0bgN3RN1PuD2M9wXj/dtRdFAsQcnc/N ae/g== X-Gm-Message-State: AOJu0YzQcZNhwjWLu2H9AYbpUH7dZTV2Ea2DBl/JtjOUnEgTTlbdS+xg aBDVILvMd82eMUzUkUF4h4vsFWkA2WAgPsiHLbw= X-Google-Smtp-Source: AGHT+IFKCkyWHFZSQorB8ZBayO8CBkuq0ekqoY5oMv/yRBC+bjf0U4CH6DTujJNemwiEpZtJBJaRvQ== X-Received: by 2002:a05:6a00:3919:b0:682:537f:2cb8 with SMTP id fh25-20020a056a00391900b00682537f2cb8mr15260421pfb.26.1692129474798; Tue, 15 Aug 2023 12:57:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 12/14] tcg/ppc: Use prefixed instructions in tcg_out_dupi_vec Date: Tue, 15 Aug 2023 12:57:39 -0700 Message-Id: <20230815195741.8325-13-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129530024100009 Content-Type: text/plain; charset="utf-8" The prefixed instructions have a pc-relative form to use here. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 670811b636..0cdb7ef37a 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1237,6 +1237,15 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType = type, unsigned vece, if (USE_REG_TB) { rel =3D R_PPC_ADDR16; add =3D ppc_tbrel_diff(s, NULL); + } else if (have_isa_3_10) { + if (type =3D=3D TCG_TYPE_V64) { + tcg_out_8ls_d(s, PLXSD, ret & 31, 0, 0, 1); + new_pool_label(s, val, R_PPC64_PCREL34, s->code_ptr - 2, 0); + } else { + tcg_out_8ls_d(s, PLXV, ret & 31, 0, 0, 1); + new_pool_l2(s, R_PPC64_PCREL34, s->code_ptr - 2, 0, val, val); + } + return; } else if (have_isa_3_00) { tcg_out_addpcis(s, TCG_REG_TMP1, 0); rel =3D R_PPC_REL14; --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129586; cv=none; d=zohomail.com; s=zohoarc; b=cFYc37E5f0HkNn8U8fklC5JLP1o0h2c2/LlNBGWAWHxWHneVX/fFZWBqriRb+G+EPHne1ClhpJWHrjRomjl248DPVVREJgLHowVKN18+6LLfdRyV6IfgtnJyVZx2t+wRFpmDvAJBP3vzwjLiHgR688y0KiLiFMrFYX22vbn0mX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129586; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kahnV3oB+xxgo9j/7zC+dhuzAxQlheFsZwXl/+I/CfE=; b=J0836HPEX8yC3DOzJWtqvIVkitkX5duH6dG3My0NvzzI0xtsksjY2uu/gflcWbCp+endnM29wiVw27fEqzx/NH0xSy9sYJn6VMHJIg0NCvjPv9rD3eZmM8eygh4GnDoF64sR7vFMyO+0KfBeU1lvgh4+vTXqkxRA+iB/0eQeSi8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16921295864254.761745490960379; Tue, 15 Aug 2023 12:59:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Az-0005Cv-4L; Tue, 15 Aug 2023 15:58:01 -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 1qW0Ay-0005BS-1t for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:58:00 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Av-00016P-6W for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:57:59 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-564a0d2d35eso3327932a12.0 for ; Tue, 15 Aug 2023 12:57:56 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129475; x=1692734275; 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=kahnV3oB+xxgo9j/7zC+dhuzAxQlheFsZwXl/+I/CfE=; b=R3EFotwkR6BSUAtMW8tIt+pBNGSQu/lmggijPdd+gkjgjgqRqa08lln0dFUgJzni+f h4btbNxXKhgYJAUtf94abv+Qc/yKhB/Vp/c0/dHWW61efFciDpQFcuJ0LIfiLOWbkDY7 1MzlWX8584qi2CsuYm43mw0MXXvQIKawu98artJ4glDUBoTjfU2k3TyD0aaKymZ5q42z S4T08fHv6a3nRLLc3qm7SwzWtGvmlREmZJ/RDShyZQdkwKHVKoPUJRS1Um82p1CpWrbc sXtaY4w8hsKYy5e8tvUKlChoTHOuSh3YNss0diaJqyyji7YUGgOYSU65OsxBhzA9waPR G78g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129475; x=1692734275; 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=kahnV3oB+xxgo9j/7zC+dhuzAxQlheFsZwXl/+I/CfE=; b=K0EGhSxOAZSDLuylN0WJL4EgyRLroRx13xkhh9/ogQeu64tUs6Ld1u+JoZv3eERXbx PZlw3WPTwqVqoxe8aVyB2EFJX7yQv0PGaDcDjyPOS4cCD8p0w9f9BlTSya/vlo2Qgnr0 5LcWK1fwep5TnWgGnOcHDammjWtI+0R7SHjGuy9Dh7tUk0OUUU0VwQUyK0GszY5LZK7U XmfCFh5xpHz6ash+3Gkw01RvC2K3GYnBGgnXkz520lgG+yAPWVSZmAGQhDweQ9KOiwfs EMRC6bFIzaK1zViYlvNBPO++yJaB8AWYN7hYFEmPCRviLMk7DTxEuNwzUVYIGgpzxKpu 1vFg== X-Gm-Message-State: AOJu0Yz0IrNwjMzMcUb4owZaLRYQN4g6uKtjEa6IFfZuqfo/NG/RQtac Gefx1OkAz+1ljvrmam1u8/XLVOifC+BC2ht8PJA= X-Google-Smtp-Source: AGHT+IHj57XEpJ+46+q5/aOzspp7zZuA3rlQpSLAnnAfHW9iZsomWok67+CCsfz0K64+Hz5SZg2VpQ== X-Received: by 2002:a05:6a20:3d8e:b0:13e:b58a:e3e4 with SMTP id s14-20020a056a203d8e00b0013eb58ae3e4mr13717294pzi.7.1692129475667; Tue, 15 Aug 2023 12:57:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 13/14] tcg/ppc: Use PLD in tcg_out_goto_tb Date: Tue, 15 Aug 2023 12:57:40 -0700 Message-Id: <20230815195741.8325-14-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129587061100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 0cdb7ef37a..20aaa90af2 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2708,6 +2708,9 @@ static void tcg_out_goto_tb(TCGContext *s, int which) if (USE_REG_TB) { ptrdiff_t offset =3D 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_10) { + ptrdiff_t offset =3D tcg_pcrel_diff_for_prefix(s, (void *)ptr); + tcg_out_8ls_d(s, PLD, TCG_REG_TMP1, 0, offset, 1); } else if (have_isa_3_00) { ptrdiff_t offset =3D tcg_pcrel_diff(s, (void *)ptr) - 4; lo =3D offset; --=20 2.34.1 From nobody Tue Feb 10 17:02:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692129632; cv=none; d=zohomail.com; s=zohoarc; b=CFslapiVBNQA0h41A1eMKjBwMXPZElC+CxOXk170QcJ9jHjfhdQXmvJ+301cV7VVZ9ilUWAvpg4Ju9sGtNiwUaIgYQLk0nhRSIJmOeewdjz9xG+wCOf+RDHf+xFr51g330F3ifJBJ3erWG2YfWPUwBC8KP7bzscrCWP0BJkp3w8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692129632; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7pWJR/i0qFrHbOc7VrOLRnKZxmQspNrgrC7qAbkO0lE=; b=QgRQ6/edxWy+mHizZ+uH08zd8VRGm7ptC+kT2JOO2IIMSTZIDlr/4W7T8QVbWiv5zsvN659TEvBCa3xwyVaqCi7ssbCYJ0expq4OP0Wr2qrJ6C9QCFchqvH3076RntZOshxlPq6g4cw80tzO2KRQJINgetyaZmjaVnpAt326POA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692129632946341.8590077841492; Tue, 15 Aug 2023 13:00:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0B0-0005Dy-CU; Tue, 15 Aug 2023 15:58:02 -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 1qW0Ay-0005CZ-SS for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:58:00 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Av-00016v-SL for qemu-devel@nongnu.org; Tue, 15 Aug 2023 15:58:00 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-686be3cbea0so4570598b3a.0 for ; Tue, 15 Aug 2023 12:57:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692129476; x=1692734276; 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=7pWJR/i0qFrHbOc7VrOLRnKZxmQspNrgrC7qAbkO0lE=; b=DTMYnhgOAiNDXW4Xth/rKNHm5oPoXmAj4BATxWHK6Vqp25vvq8JnbHJgk15+wQfmHu EnY7sGc7wOm5oyPv2HgpNDRMaquZPrqjlHLy4lE7rfRGgtxYNWLEhkA9MRtkIl8KsgbW UNAwFlPI38+X6OlOcuoLM8WK9/nwA2wQkPPOzVO7Z32nBYtukhOH4bfiZ4taq+9fMr7v kkjaopvFLgEXvRVXd6jKvZLskydXUdSQ8NkFXbtHF0QngaM8nKG/p1owRQ6HUPV69lhe VxIFfnyjmsLzBLmRT2gpCZVmTMFgXYubxdLz7lgD4DQjBTpjf1BbBn5WmEFqe0XvJuMy +TJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129476; x=1692734276; 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=7pWJR/i0qFrHbOc7VrOLRnKZxmQspNrgrC7qAbkO0lE=; b=M7KZNHv4p+qiTNmsSN8sY31yfG/5Zn7OYMttUwkFkXVQLSXzhOWHt11Rp00THm1kqn G3aXm3jlIOTQqICsI5LYqHufFH4bmRpEX656Nzt98n08QSCm/DNruXcYMs61FDRIsTJL bynHJswNXctISPGjVSmmgmqDieaFl/0ESd3AkJEPkiBd2LvRXrGRDiUcJbQQ9wMiyVop iltjeLET4n5SoFGThtgxW9i8sTC7Uf3galphScbgyAJfP2CfNrr//ifkhoAqla83Rzx0 TYM2rYeQr3QV5WyKPC1zrWMHyOmc8IAYAG+yACa7s/oreKvFRXVVE4W2/r9+jAgjqbGP fTHw== X-Gm-Message-State: AOJu0Ywc23O+RqUi2+jjwgV7HtyIr+/HQgVAhW0sC6iQBv6bfSkTl+5a 6Df6MGJaJ2SBLxq5Mx8iWwoWjmN9cVRUoH1ZKF4= X-Google-Smtp-Source: AGHT+IFhWrjPFkRgHZ/HsHtjaf2Aa/OZ8HfEAsvbvwQq/IJlOTvUDqCFDrEdSjs6ps9iKly3j7QlDw== X-Received: by 2002:a05:6a21:3295:b0:12e:caac:f263 with SMTP id yt21-20020a056a21329500b0012ecaacf263mr3594015pzb.20.1692129476627; Tue, 15 Aug 2023 12:57:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, jniethe5@gmail.com Subject: [PATCH v3 14/14] RFC tcg/ppc: Disable TCG_REG_TB for Power9/Power10 Date: Tue, 15 Aug 2023 12:57:41 -0700 Message-Id: <20230815195741.8325-15-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692129634143100001 Content-Type: text/plain; charset="utf-8" This may or may not improve performance. It appears to result in slightly larger code, but perhaps not enough to matter. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 20aaa90af2..c1e0efb498 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -83,7 +83,7 @@ #define TCG_VEC_TMP2 TCG_REG_V1 =20 #define TCG_REG_TB TCG_REG_R31 -#define USE_REG_TB (TCG_TARGET_REG_BITS =3D=3D 64) +#define USE_REG_TB (TCG_TARGET_REG_BITS =3D=3D 64 && !have_isa_3_00) =20 /* Shorthand for size of a pointer. Avoid promotion to unsigned. */ #define SZP ((int)sizeof(void *)) --=20 2.34.1