From patchwork Sat Jan 12 13:28:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1023906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-493928-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ILbE5Dc2"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43cLCX6JtGz9s9h for ; Sun, 13 Jan 2019 00:28:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; q=dns; s=default; b=s1PFCU8DKLUWhvR7eLxs t2sDZAQv8Rt1GAr8cb/DauHb2i7LSb5O47dWA/4RqtcrcPASO8Z10fGl1zPGhI8u 6++P9enaw9icafazaNcryA3JWUN7TDXtx5ZRQ/1vIkqEtdVmH6YoFzGJnl6aSOsa UUFXWXXZRy142zX4fLtmwfM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; s=default; bh=QFl5P/YpitvZaORBkUA/a9Jvtk k=; b=ILbE5Dc2KAi0ernWpnYdO67PeOsoea1nH/lugKChoyHLPV8bmiddbMfVjY NwqSfqnElT1EImCN4MVkn0ZtASKXlb3zqDv6YWw/t+iT6Kf1/6gl0RNDLlde2+6f aNlQM5d7A1SBfC01PJGA156Af6DeFVzzVk7bXyguHg8RTFF5k= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 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:05 +0000 Cc: Segher Boessenkool To: gcc-patches Hi, The current implementation of “speculation_barrier” and “group_end_nop” insns emit hard-wired register names which causes tests using them to fail on Darwin, at least, which uses “rNN” instead of “NN”. The patch makes the register names for these insns use the operand output mechanism 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 == PROCESSOR_POWER6) - return "ori 1,1,0"; - return "ori 2,2,0"; + operands[0] = gen_rtx_REG (Pmode, + rs6000_tune == PROCESSOR_POWER6 ? 1 : 2); + return "ori %0,%0,0"; }) (define_insn "speculation_barrier" [(unspec_volatile:BLK [(const_int 0)] UNSPECV_SPEC_BARRIER)] "" - "ori 31,31,0") +{ + operands[0] = gen_rtx_REG (Pmode, 31); + return "ori %0,%0,0"; +}) ;; Define the subtract-one-and-jump insns, starting with the template ;; so loop.c knows what to generate.