From patchwork Mon Aug 27 18:20:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lee X-Patchwork-Id: 180259 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 6105B2C010E for ; Tue, 28 Aug 2012 04:21:02 +1000 (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=1346696463; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:Message-ID:From:To:Subject:Reply-To:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=0Qsxnpw +Rzk9LGfYLYScH9/9yUg=; b=nYdAJezdGDYbNY/xJNM98I5b9iPiwiAI4fethdz biU8wDiSIP6QE5ex+hpv00mWJFQFAdtTGSASVD/U2YBpVgSgb7qqvvckS9vYKc0p 9UC+pcEzq7W/1EitzD5t175y+l1g2HLRHaO6tcq4hqPPLv5h9yPLTp5O7bYcYVxI OoSM= 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:Date:Message-ID:From:To:Subject:Reply-To:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=KzRydKQdoettiARZFMlVV87ID+OuiN0JpiCi51iZ3M4gPcjTLnXI419eTTXDpM wNcZHPUFyLW9ECj5BLvzNxUD5lqyzfWjcjJmVgpRXWCY97KxVwdADo7G8u02phhp fRHhU7GrjG931FC5LeM9uKTs6isrHy9gZd6LYE/Py4FQQ=; Received: (qmail 3164 invoked by alias); 27 Aug 2012 18:20:56 -0000 Received: (qmail 3144 invoked by uid 22791); 27 Aug 2012 18:20:54 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (12.216.194.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Aug 2012 18:20:36 +0000 Received: from farm-0038.internal.tilera.com (10.2.0.68) by USMAEXCH2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server (TLS) id 14.0.694.0; Mon, 27 Aug 2012 14:20:35 -0400 Received: (from walt@localhost) by farm-0038.internal.tilera.com (8.14.4/8.12.11/Submit) id q7RIKY3l011912; Mon, 27 Aug 2012 14:20:34 -0400 Date: Mon, 27 Aug 2012 14:20:34 -0400 Message-ID: <201208271820.q7RIKY3l011912@farm-0038.internal.tilera.com> From: Walter Lee To: Subject: [TILE-Gx, committed] bfins instruction fix Reply-To: Walter Lee MIME-Version: 1.0 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 patch stops trying to represent the bfins instruction with the insv pattern, because it causes an extra copy when bfins reuses one of its inputs. * config/tilegx/tilegx.md (*bfins): Rename to insn_bfins. (insn_bfins): Delete. Index: gcc/config/tilegx/tilegx.md =================================================================== --- gcc/config/tilegx/tilegx.md (revision 190722) +++ gcc/config/tilegx/tilegx.md (working copy) @@ -2627,7 +2627,7 @@ "bfextu\t%0, %r1, %2, %3" [(set_attr "type" "X0")]) -(define_insn "*bfins" +(define_insn "insn_bfins" [(set (match_operand:DI 0 "register_operand" "=r") (unspec:DI [(match_operand:DI 1 "reg_or_0_operand" "0") (match_operand:DI 2 "reg_or_0_operand" "rO") @@ -2638,36 +2638,6 @@ "bfins\t%0, %r2, %3, %4" [(set_attr "type" "X0")]) -(define_expand "insn_bfins" - [(set (match_operand:DI 0 "register_operand" "") - (unspec:DI [(match_operand:DI 1 "reg_or_0_operand" "") - (match_operand:DI 2 "reg_or_0_operand" "") - (match_operand:DI 3 "u6bit_cint_operand" "") - (match_operand:DI 4 "u6bit_cint_operand" "")] - UNSPEC_INSN_BFINS))] - "INTVAL (operands[3]) != 64" -{ - HOST_WIDE_INT first = INTVAL (operands[3]); - HOST_WIDE_INT last = INTVAL (operands[4]); - - if (last >= first) - { - /* This is not a wacky wraparound case, so we can express this - as a standard insv. */ - if (operands[0] != operands[1]) - { - operands[2] = make_safe_from (operands[2], operands[0]); - emit_move_insn (operands[0], operands[1]); - } - - emit_insn (gen_insv (operands[0], - GEN_INT (last - first + 1), operands[3], - operands[2])); - - DONE; - } -}) - (define_insn "insn_cmpexch" [(set (match_operand:I48MODE 0 "register_operand" "=r") (mem:I48MODE (match_operand 1 "pointer_operand" "rO")))