From patchwork Fri Dec 14 03:18:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153712 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1596576ljp; Thu, 13 Dec 2018 19:23:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/XTuCEDBCPHmnhcseJrAqVd1leQ6PkucgJ3b/Wli3YWFQNqC67KRnrrnG8XsD0hv/9tvGhR X-Received: by 2002:a37:dc04:: with SMTP id v4mr1153956qki.101.1544757792146; Thu, 13 Dec 2018 19:23:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544757792; cv=none; d=google.com; s=arc-20160816; b=LYH2YQKhr//NVanAAuT5Qi8/pZWRq0W7FUW0ct+kvde0PRDrsb/MiHmlppQRmdHVla Wetu8BvINDpphBL/cMqSys7jt0IdzJfMIkUGqNpmozRzux6GNhoT9hSABTkKmavV3Z3c jrwzqKhilzdCad/cklDtVW/PDLEgsdrwffnCi/t8hss+sxfGZKb6xKPOGhgZO3qO5BBd xZ3Y1Xo/H7aMQcXWzW9qkqwUCwINBIZRPS4sHNAerFkJkfi8eaOcQECb+5bdzRj0dE2R 68+BXbIGY/9EBguLOZFogtfBiPvxE+GDDYT9oSEen4UKhGdoFmKGT0dJuFTzlgrQrF1c k4zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=7EGeWCwiLOWCXY2HFjlb7FD3hn04KtScBAMx3eYxs8U=; b=Rw3cXMZtV478YBEn29c25oSNG0IoelyrjseFkhxjEetJyCE9nAKsg4NGzNmQ6L95E1 gpmDcbqa9hY4oJNQ+C2YXjIU7bDte+eme4N478jjXs33rAn/nRvoOLw1JFl0ntDPei9C xANcNJCZ3X5bZTq6gnB3cFrP8S0BMLgNYFR50rZamdNBmUWvFrdNjcDWlfAb7PrSLUcv +jYLOhoxon/X2b+4J4kAXZ9E1LfKhWj7rjgLDdHfLYC/IGR3Ix6HujKvvWq+4yDsS6ww kEZYXGzw5W5+5GkQoH8e5dk+vWsdoFfbiHegQ3fzfb4n1ZE7lKHqiQ0qriJqcrcjEMPa XuAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TFH9AcDO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x46si536912qth.369.2018.12.13.19.23.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 19:23:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TFH9AcDO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXe4F-0008OT-Iz for patch@linaro.org; Thu, 13 Dec 2018 22:23:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXe0m-0005tp-JL for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:19:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXe0l-0006Yu-K3 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:19:36 -0500 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:42982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXe0l-0006W0-Dk for qemu-devel@nongnu.org; Thu, 13 Dec 2018 22:19:35 -0500 Received: by mail-ot1-x329.google.com with SMTP id v23so4096170otk.9 for ; Thu, 13 Dec 2018 19:19:35 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=7EGeWCwiLOWCXY2HFjlb7FD3hn04KtScBAMx3eYxs8U=; b=TFH9AcDO339sDQdLTHVAs5NhztvybTzDJnV+F1k5xaTjGyKO8dTgTV6mwsGAHUsHNR ht3ok0eWlvaDDO8Sz2j290gYv2TBMOHykOW3ODmXPiaQZC95vT+YDc9UULAyzQ2qoMiY fxHwqNq4TNGFHCeIZwYbkPJzMjHE+eYzKmrz0= 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:mime-version:content-transfer-encoding; bh=7EGeWCwiLOWCXY2HFjlb7FD3hn04KtScBAMx3eYxs8U=; b=J3fUopcIABuh6vTyMkc2tPR2r5WoP5fUn+fzPJTPCBExO+I5dwIgsfkCt2AN37Td0U 6cmTOlYBh0+eRUJv07A01pGXJk8d0GIFYZ4llzOt1l3Dx2fFJpRW/awVidd/+ZEJ9na9 FFD04L1j93a/QYOUrBlBfGpnOvqFDUGffCNbDH6U6YkQcYASBADDoy8bWQIgCMQZeKvl 5svFrQuQwHLkWr3jk1c4ZbzUR48TlsIBVzqZzJWqI5921OPpetrfW4gZ9hohZm0ViTDH csSxUfQ3IODA3iku32A5ddFX1f3mhTe1Jqo6IyXxaVpaziDgIwdXV2cAcPikQrrPgrZn Vefw== X-Gm-Message-State: AA+aEWZDo2DoRKxmFTHxWunSsxCYV+rfGZltMp2qEc01eMfmkgzK1EfA jvHw1RHimQtH+GzKOffOJbasScCqnRgjWA== X-Received: by 2002:a9d:1c97:: with SMTP id l23mr1019110ota.276.1544757574488; Thu, 13 Dec 2018 19:19:34 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id g138sm2367537oib.26.2018.12.13.19.19.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 19:19:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 21:18:58 -0600 Message-Id: <20181214031923.29527-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181214031923.29527-1-richard.henderson@linaro.org> References: <20181214031923.29527-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::329 Subject: [Qemu-devel] [PULL 07/32] tcg/ppc: Fold away "noaddr" branch routines 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is no longer a need for preserving branch offset operands, as we no longer re-translate. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) -- 2.17.2 diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index c2f729ee8f..2e2a22f579 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -210,18 +210,6 @@ static void reloc_pc14(tcg_insn_unit *pc, tcg_insn_unit *target) *pc = (*pc & ~0xfffc) | reloc_pc14_val(pc, target); } -static inline void tcg_out_b_noaddr(TCGContext *s, int insn) -{ - unsigned retrans = *s->code_ptr & 0x3fffffc; - tcg_out32(s, insn | retrans); -} - -static inline void tcg_out_bc_noaddr(TCGContext *s, int insn) -{ - unsigned retrans = *s->code_ptr & 0xfffc; - tcg_out32(s, insn | retrans); -} - /* parse target specific constraints */ static const char *target_parse_constraint(TCGArgConstraint *ct, const char *ct_str, TCGType type) @@ -1179,11 +1167,11 @@ static void tcg_out_setcond(TCGContext *s, TCGType type, TCGCond cond, static void tcg_out_bc(TCGContext *s, int bc, TCGLabel *l) { if (l->has_value) { - tcg_out32(s, bc | reloc_pc14_val(s->code_ptr, l->u.value_ptr)); + bc |= reloc_pc14_val(s->code_ptr, l->u.value_ptr); } else { tcg_out_reloc(s, s->code_ptr, R_PPC_REL14, l, 0); - tcg_out_bc_noaddr(s, bc); } + tcg_out32(s, bc); } static void tcg_out_brcond(TCGContext *s, TCGCond cond, @@ -1771,7 +1759,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) /* Load a pointer into the current opcode w/conditional branch-link. */ label_ptr = s->code_ptr; - tcg_out_bc_noaddr(s, BC | BI(7, CR_EQ) | BO_COND_FALSE | LK); + tcg_out32(s, BC | BI(7, CR_EQ) | BO_COND_FALSE | LK); rbase = TCG_REG_R3; #else /* !CONFIG_SOFTMMU */ @@ -1846,7 +1834,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64) /* Load a pointer into the current opcode w/conditional branch-link. */ label_ptr = s->code_ptr; - tcg_out_bc_noaddr(s, BC | BI(7, CR_EQ) | BO_COND_FALSE | LK); + tcg_out32(s, BC | BI(7, CR_EQ) | BO_COND_FALSE | LK); rbase = TCG_REG_R3; #else /* !CONFIG_SOFTMMU */ @@ -2044,13 +2032,14 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_br: { TCGLabel *l = arg_label(args[0]); + uint32_t insn = B; if (l->has_value) { - tcg_out_b(s, 0, l->u.value_ptr); + insn |= reloc_pc24_val(s->code_ptr, l->u.value_ptr); } else { tcg_out_reloc(s, s->code_ptr, R_PPC_REL24, l, 0); - tcg_out_b_noaddr(s, B); } + tcg_out32(s, insn); } break; case INDEX_op_ld8u_i32: