From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59610 invoked by alias); 12 Jan 2019 13:28:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 59600 invoked by uid 89); 12 Jan 2019 13:28:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_COUK,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=nn, sk:unspecv, sk:UNSPECV, Hx-spam-relays-external:sk:smtp.wa X-HELO: smtp2.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp2.wavenetuk.net) (195.26.37.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 12 Jan 2019 13:28:14 +0000 Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id 94D8E600135; Sat, 12 Jan 2019 13:28:11 +0000 (GMT) From: Iain Sandoe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH, powerpc] Fix speculation barrier and group nop to emit target register names. Message-Id: <8E1C034C-7935-4D83-810C-08A600310FB0@sandoe.co.uk> Date: Sat, 12 Jan 2019 13:28:00 -0000 Cc: Segher Boessenkool To: gcc-patches X-SW-Source: 2019-01/txt/msg00697.txt.bz2 Hi, The current implementation of =E2=80=9Cspeculation_barrier=E2=80=9D and =E2= =80=9Cgroup_end_nop=E2=80=9D insns emit hard-wired register names which cau= ses tests using them to fail on Darwin, at least, which uses =E2=80=9CrNN= =E2=80=9D instead of =E2=80=9CNN=E2=80=9D. The patch makes the register names for these insns use the operand output m= echanism to substitute the appropriate variant when needed. tested on powerpc-darwin9 and powerpc64-linux. OK for trunk? Iain gcc/ * config/rs6000/rs6000.md (group_end_nop): Emit insn register names using operand format, rather than hard-wired. (speculation_barrier): Likewise. diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 56364e0..86badc2 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -12494,15 +12494,18 @@ [(unspec [(const_int 0)] UNSPEC_GRP_END_NOP)] "" { - if (rs6000_tune =3D=3D PROCESSOR_POWER6) - return "ori 1,1,0"; - return "ori 2,2,0"; + operands[0] =3D gen_rtx_REG (Pmode, + rs6000_tune =3D=3D PROCESSOR_POWER6 ? 1 : 2); + return "ori %0,%0,0"; }) =20 (define_insn "speculation_barrier" [(unspec_volatile:BLK [(const_int 0)] UNSPECV_SPEC_BARRIER)] "" - "ori 31,31,0") +{ + operands[0] =3D gen_rtx_REG (Pmode, 31); + return "ori %0,%0,0"; +}) =0C ;; Define the subtract-one-and-jump insns, starting with the template ;; so loop.c knows what to generate.