From nobody Tue Feb 10 06:57:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504824922916199.31274252364653; Thu, 7 Sep 2017 15:55:22 -0700 (PDT) Received: from localhost ([::1]:42570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5hh-0006Oa-Go for importer@patchew.org; Thu, 07 Sep 2017 18:55:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq5UK-0003JO-NQ for qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq5UG-0008TD-3w for qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:32 -0400 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]:35371) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq5UF-0008RY-Ug for qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:28 -0400 Received: by mail-pf0-x22e.google.com with SMTP id g13so1630320pfm.2 for ; Thu, 07 Sep 2017 15:41:27 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-108-236.tukw.qwest.net. [97.126.108.236]) by smtp.gmail.com with ESMTPSA id h19sm770678pfh.142.2017.09.07.15.41.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 15:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H+LLtzCzH8QndIjCRi1FVfoNlieFGUHJ+Q0JqTEk1F0=; b=KMfepWU1BTFsCzpiWSnTJDsNNF9XY8dKxpBTharm/iIT8MtltxGTkj65GxVIjyp2Mi UulfwoC3NDp8NeO+BwTl7oahTZ0ZrB8jDuglZ/28r+hOnu1jxZ77Lx+2DdAegF0AJhOy UlbyISnU8+SsH2VFZDfdlkpofR3XGk60wm5wM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H+LLtzCzH8QndIjCRi1FVfoNlieFGUHJ+Q0JqTEk1F0=; b=Wv39fhSxtgf4ti3wo0E/ZOvpXiVc8IHRs489cvOMsHHyMxqWGiwem1zRY4QZxTDJRx oXfDNYR1D+tIhLzGXjVvPS/nY5NhXt5Em/PjYJWQ2eNkH95+bu0bUglks/Gnh2QUOSnt CYprO4OEAzGpUyQe+V6gCVwsEslQJ2S2fTyBBzW3zPhR9m0pukOgULyl3LA88cSQEtHe q3LUQokD0UxOsaAZnsLYudJjqheaZ+ZsvlbyPANJOKwFYylwdxdqnjviLB/7WE2ogif/ QiXlJJ18DktlFpdHL4I9OwuY21O2RbnINzw/nq90yI/XuU1oFjkjqcekBUVSCy0D53Am A6qQ== X-Gm-Message-State: AHPjjUiVV6P/JMXcLytgcDB8fdjlUbO0f4TelamjsG2MfNMFieY9p96e c1RFpyn7NeB37+VOzq8zUA== X-Google-Smtp-Source: ADKCNb580RProykv/FtOjQxwThKgfLAMc9hggbh/lJjN2aIJe2BcNjzz7mlm8RCzdsxi2b79CxpXMA== X-Received: by 10.99.130.198 with SMTP id w189mr919111pgd.175.1504824086701; Thu, 07 Sep 2017 15:41:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Sep 2017 15:40:51 -0700 Message-Id: <20170907224051.21518-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907224051.21518-1-richard.henderson@linaro.org> References: <20170907224051.21518-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22e Subject: [Qemu-devel] [PULL 23/23] tcg/ppc: Use constant pool for movi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.h | 1 + tcg/ppc/tcg-target.inc.c | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 3772cc6648..be52ad1d2e 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -132,5 +132,6 @@ void tb_target_set_jmp_target(uintptr_t, uintptr_t, uin= tptr_t); #ifdef CONFIG_SOFTMMU #define TCG_TARGET_NEED_LDST_LABELS #endif +#define TCG_TARGET_NEED_POOL_LABELS =20 #endif diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index df709c4a96..21d764c102 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -22,6 +22,9 @@ * THE SOFTWARE. */ =20 +#include "elf.h" +#include "tcg-pool.inc.c" + #if defined _CALL_DARWIN || defined __APPLE__ #define TCG_TARGET_CALL_DARWIN #endif @@ -58,8 +61,6 @@ =20 static tcg_insn_unit *tb_ret_addr; =20 -#include "elf.h" - bool have_isa_2_06; bool have_isa_3_00; =20 @@ -224,9 +225,12 @@ static inline void tcg_out_bc_noaddr(TCGContext *s, in= t insn) static void patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend) { - tcg_insn_unit *target =3D (tcg_insn_unit *)value; + tcg_insn_unit *target; + tcg_insn_unit old; + + value +=3D addend; + target =3D (tcg_insn_unit *)value; =20 - tcg_debug_assert(addend =3D=3D 0); switch (type) { case R_PPC_REL14: reloc_pc14(code_ptr, target); @@ -234,6 +238,12 @@ static void patch_reloc(tcg_insn_unit *code_ptr, int t= ype, case R_PPC_REL24: reloc_pc24(code_ptr, target); break; + case R_PPC_ADDR16: + assert(value =3D=3D (int16_t)value); + old =3D *code_ptr; + old =3D deposit32(old, 0, 16, value); + *code_ptr =3D old; + break; default: tcg_abort(); } @@ -676,6 +686,14 @@ static void tcg_out_movi_int(TCGContext *s, TCGType ty= pe, TCGReg ret, return; } =20 + /* Use the constant pool, if possible. */ + if (!in_prologue && USE_REG_TB) { + new_pool_label(s, arg, R_PPC_ADDR16, s->code_ptr, + -(intptr_t)s->code_gen_ptr); + tcg_out32(s, LD | TAI(ret, TCG_REG_TB, 0)); + return; + } + tmp =3D arg >> 31 >> 1; tcg_out_movi(s, TCG_TYPE_I32, ret, tmp); if (tmp) { @@ -1858,6 +1876,14 @@ static void tcg_out_qemu_st(TCGContext *s, const TCG= Arg *args, bool is_64) #endif } =20 +static void tcg_out_nop_fill(tcg_insn_unit *p, int count) +{ + int i; + for (i =3D 0; i < count; ++i) { + p[i] =3D NOP; + } +} + /* Parameters for function call generation, used in tcg.c. */ #define TCG_TARGET_STACK_ALIGN 16 #define TCG_TARGET_EXTEND_ARGS 1 --=20 2.13.5