From patchwork Mon May 6 00:22:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 241532 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id C2D032C00EC for ; Mon, 6 May 2013 10:22:40 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=ItPhwq2Hnw8saHOfbX64V6W4g207tY3tE8+8EqPIy9wfG2 Lzr+nS3KYIGu/d/UAicSVzw8/VLFrW+L7igJks5VmmlmSB1OCL0q+NCwDNqn3Blr f7wvl5xxKK5Yq4FpAA5gtoto3aVZXuJvxD6dlL5V50r1a1d/KceoENG+FGkhQ= 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 :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=mozMlEHWZLiYajKTbCs8BoBN5iQ=; b=R/xW9rv69GUYzDZ/RRDv 0H/oIhAsCCT1xhnRd/aqe8P/Bwsp8Qxmeex63VORq1b5cgeSY38QcZdAAAlXB9jU HhtlDo9GgFXdif9u3KWrnQ4ye08BNs815+aPMv+Pzmb3nEA5215pWBxLZ9UcthZ3 R6XHngMnnC7s0DtB8tQ1YM0= Received: (qmail 5775 invoked by alias); 6 May 2013 00:22:33 -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 5749 invoked by uid 89); 6 May 2013 00:22:27 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from mailout03.t-online.de (HELO mailout03.t-online.de) (194.25.134.81) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 06 May 2013 00:22:25 +0000 Received: from fwd51.aul.t-online.de (fwd51.aul.t-online.de ) by mailout03.t-online.de with smtp id 1UZ9CA-0001Ub-SL; Mon, 06 May 2013 02:22:22 +0200 Received: from [192.168.0.103] (Tt8lN8Z6Qhe1q4VHe9QtmuNxPjuMQlt7j4nssogXZf6XvRxKva3rW-uM45P2xsSgQK@[84.175.200.238]) by fwd51.t-online.de with esmtp id 1UZ9C5-0z6ytU0; Mon, 6 May 2013 02:22:17 +0200 Message-ID: <1367799731.19934.29.camel@yam-132-YW-E178-FTW> Subject: [SH] PR 52933 - Fix some failures on trunk From: Oleg Endo To: gcc-patches Date: Mon, 06 May 2013 02:22:11 +0200 Mime-Version: 1.0 X-Virus-Found: No Hi, Some of the SH div0s integer sign comparison cases stopped working. The attached patch fixes that. Tested on rev 198595 with make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" and no new failures. OK? Cheers, Oleg gcc/ChangeLog: PR target/52933 * config/sh/sh.md (*cmp_div0s_0, *cmp_div0s_1, *movsicc_div0s): Add variations of these patterns. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 198595) +++ gcc/config/sh/sh.md (working copy) @@ -866,6 +866,16 @@ (lshiftrt:SI (xor:SI (match_dup 1) (match_dup 2)) (const_int 31))) (set (match_dup 0) (reg:SI T_REG))]) +(define_insn "*cmp_div0s_0" + [(set (reg:SI T_REG) + (eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand") + (const_int 31)) + (ge:SI (match_operand:SI 1 "arith_reg_operand") + (const_int 0))))] + "TARGET_SH1" + "div0s %0,%1" + [(set_attr "type" "arith")]) + (define_insn_and_split "*cmp_div0s_1" [(set (match_operand:SI 0 "arith_reg_dest" "") (ge:SI (xor:SI (match_operand:SI 1 "arith_reg_operand" "") @@ -896,6 +906,19 @@ (const_int 0))) (set (reg:SI T_REG) (xor:SI (reg:SI T_REG) (const_int 1)))]) +(define_insn_and_split "*cmp_div0s_1" + [(set (reg:SI T_REG) + (eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand") + (const_int 31)) + (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand") + (const_int 31))))] + "TARGET_SH1" + "#" + "&& can_create_pseudo_p ()" + [(set (reg:SI T_REG) (lt:SI (xor:SI (match_dup 0) (match_dup 1)) + (const_int 0))) + (set (reg:SI T_REG) (xor:SI (reg:SI T_REG) (const_int 1)))]) + ;; ------------------------------------------------------------------------- ;; SImode compare and branch ;; ------------------------------------------------------------------------- @@ -1069,6 +1092,27 @@ (match_dup 4) (match_dup 3)))]) +(define_insn_and_split "*movsicc_div0s" + [(set (match_operand:SI 0 "arith_reg_dest") + (if_then_else:SI (eq (lshiftrt:SI + (match_operand:SI 1 "arith_reg_operand") + (const_int 31)) + (lshiftrt:SI + (match_operand:SI 2 "arith_reg_operand") + (const_int 31))) + (match_operand:SI 3 "arith_reg_operand") + (match_operand:SI 4 "general_movsrc_operand"))) + (clobber (reg:SI T_REG))] + "TARGET_PRETEND_CMOVE" + "#" + "&& 1" + [(set (reg:SI T_REG) (lt:SI (xor:SI (match_dup 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) + (if_then_else (ne (reg:SI T_REG) (const_int 0)) + (match_dup 4) + (match_dup 3)))]) + ;; ------------------------------------------------------------------------- ;; SImode unsigned integer comparisons ;; -------------------------------------------------------------------------