From patchwork Thu Oct 27 04:08:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 122060 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 31915B6F8B for ; Thu, 27 Oct 2011 15:08:55 +1100 (EST) Received: (qmail 10306 invoked by alias); 27 Oct 2011 04:08:50 -0000 Received: (qmail 10293 invoked by uid 22791); 27 Oct 2011 04:08:48 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, TW_DX, TW_SV, TW_XC X-Spam-Check-By: sourceware.org Received: from shards.monkeyblade.net (HELO shards.monkeyblade.net) (198.137.202.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Oct 2011 04:08:33 +0000 Received: from localhost (cpe-66-65-61-233.nyc.res.rr.com [66.65.61.233]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id p9R48ShX031398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 26 Oct 2011 21:08:31 -0700 Date: Thu, 27 Oct 2011 00:08:28 -0400 (EDT) Message-Id: <20111027.000828.2152064485465600946.davem@davemloft.net> To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix thinko in previous sparc setcc changes. From: David Miller Mime-Version: 1.0 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 More extensive testing showed that we have to force the usage of v9 scc patterns when comparing DImode values with comparison codes other than EQ and NE. Soon we'll be able to add exceptions this this, because VIS3 has addxc and addxccc instructions which test the 64-bit carry condition. Committed to trunk. gcc/ * config/sparc/sparc.c (emit_scc_insn): Force attempt of v9 sequences if we're comparing DImode and comparison is other than EQ or NE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180558 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/config/sparc/sparc.c | 5 +++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a51510..124b17c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2011-10-26 David S. Miller + * config/sparc/sparc.c (emit_scc_insn): Force attempt of v9 sequences + if we're comparing DImode and comparison is other than EQ or NE. + * config/sparc/sparc.c (emit_scc_insn): Do not try v9 sequences until LEU/LTU/GEU/GTU is attempted. * config/sparc/sparc.md (*neg_snesi_sign_extend): New 64-bit insn diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 80e05a6..ea9fdef 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -2541,6 +2541,11 @@ emit_scc_insn (rtx operands[]) } } + if (TARGET_V9 + && GET_MODE (x) == DImode + && gen_v9_scc (operands[0], code, x, y)) + return true; + /* We can do LTU and GEU using the addx/subx instructions too. And for GTU/LEU, if both operands are registers swap them and fall back to the easy case. */