From patchwork Wed Oct 10 02:47:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 190536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 351A72C008C for ; Wed, 10 Oct 2012 13:47:30 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350442050; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:MIME-Version:Content-Type:Content-Disposition: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=9LdWgtQ fr5V9eFr9U5R5JdEvTm8=; b=cpEU8HzsiPtCvyAij6RF7c1mD2YrI3iSss6ulD7 yXjJJWIixtp5P1UhT0v/yjSSqL0YSLtlZatpPH3G3u6xZrQCVy1MPmqNpTIKH+Ye w9x9C3XvC34co8mEEVLyRxlBRBgRM02Ggr/pw+kPAYRYNMEGFQGpzUVIYGQssdqK lOdo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ef0UZfmdUmA5HOAWX2I8If7LqxDwlkO7bq5wodTHFINEsRrBz0xGUK+jS/1ySl tIiAS3hGquHLTlxy10OOG8R5xF7Zre2kVW+8N/S3LkEsh/lZysf/oAiflZz0x/7Y wrnYd447uKTyLQ4y7W/j9QodkZazJLHajOwwYv+LYQ/2w=; Received: (qmail 2525 invoked by alias); 10 Oct 2012 02:47:26 -0000 Received: (qmail 2515 invoked by uid 22791); 10 Oct 2012 02:47:26 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Oct 2012 02:47:21 +0000 Received: by mail-pb0-f47.google.com with SMTP id ro12so178358pbb.20 for ; Tue, 09 Oct 2012 19:47:21 -0700 (PDT) Received: by 10.68.130.71 with SMTP id oc7mr6277715pbb.116.1349837241048; Tue, 09 Oct 2012 19:47:21 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPS id iu8sm241660pbc.71.2012.10.09.19.47.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 19:47:20 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id AD476EA3687; Wed, 10 Oct 2012 13:17:15 +1030 (CST) Date: Wed, 10 Oct 2012 13:17:15 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn , Pat Haugen Subject: [RS6000] VSX splat fix Message-ID: <20121010024715.GO25219@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org, David Edelsohn , Pat Haugen MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 This fixes a problem with my PR45844 fix. PR45844 was due to rs6000.c reg_offset_addressing_ok_p testing the operand mode to determine whether an insn supports reg+offset addressing, but the VSX splat insn uses a DF/DI mode input operand. So the memory form of this insn was wrongly seen to support reg+offset addressing. I hacked around this by adjusting the mode in the insn predicate, which happened to work for the PR45844 testcase, but actually causes the predicate to reject all MEMs since general_operand checks that the mode matches. (Oddly, this does not stop reload using the memory form of the insn! const_double passes the predicate, reload forces to mem which matches one of the constraints, and the predicate is not checked again.) This avoids the general_operand mode check by expanding code from there relevant to MEMs. Bootstrapped and regression tested powerpc64-linux. OK for mainline and 4.6/4.7? * config/rs6000/predicates.md (splat_input_operand): Don't call input_operand for MEMs. Instead check for volatile and call memory_address_addr_space_p with modified mode. Index: gcc/config/rs6000/predicates.md =================================================================== --- gcc/config/rs6000/predicates.md (revision 192236) +++ gcc/config/rs6000/predicates.md (working copy) @@ -941,12 +941,16 @@ { if (MEM_P (op)) { + if (! volatile_ok && MEM_VOLATILE_P (op)) + return 0; if (mode == DFmode) mode = V2DFmode; else if (mode == DImode) mode = V2DImode; else - gcc_unreachable (); + gcc_unreachable (); + return memory_address_addr_space_p (mode, XEXP (op, 0), + MEM_ADDR_SPACE (op)); } return input_operand (op, mode); })