From patchwork Wed Aug 27 23:27:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaz Kojima X-Patchwork-Id: 383613 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7FCAA1400A3 for ; Thu, 28 Aug 2014 09:27:19 +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:date :message-id:to:subject:from:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=hgTZ29T0D/PmGDHl C/fJSX/WmULHrIypYEpalnbgHzWjjMgvl19fSPqGbYX3YEMjHlDD+TtAnVTadurx vdtj1xQsEbIxdcAbdHgDJx8kUIKpYIpVhmlCP6dQEdWiNPXEOanE6C+cD2eayyRW bwvZH0tFHtpcWn2CtlRx3vUX94E= 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:date :message-id:to:subject:from:mime-version:content-type :content-transfer-encoding; s=default; bh=Y9qzhpGA2cIWUEmHOpEOH4 c7FLY=; b=SRTVnda5mFsqOnhd9NMFb7D/ARuVlLCB9RfHhmo92QSfkHy+8oN7Nz h+FtdzfITRXE90IpSIvfLwtg/TmJpp2RIXfqiK/lTVJhOe0UYFjE/HLmBSSHblNn E1lbcLRS+vd5Kzouhj/0D8SK9NLaG3t3qcfowEr/sjTReR/4/NmFA= Received: (qmail 22778 invoked by alias); 27 Aug 2014 23:27:11 -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 22768 invoked by uid 89); 27 Aug 2014 23:27:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mo-sw.iij4u.or.jp Received: from mo-sw1501.iij4u.or.jp (HELO mo-sw.iij4u.or.jp) (210.130.239.241) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Aug 2014 23:27:09 +0000 Received: by mo-sw.iij4u.or.jp (4u-mo-sw1501) id s7RNR6JK009910; Thu, 28 Aug 2014 08:27:06 +0900 Received: from localhost (238.152.138.210.bn.2iij.net [210.138.152.238]) by mbox.iij4u.or.jp (4u-mbox1501) id s7RNR5iY007620; Thu, 28 Aug 2014 08:27:05 +0900 Date: Thu, 28 Aug 2014 08:27:04 +0900 (JST) Message-Id: <20140828.082704.375776914.kkojima@rr.iij4u.or.jp> To: gcc-patches@gcc.gnu.org Subject: [patch committed SH] Fix PR target/62261 From: Kaz Kojima Mime-Version: 1.0 X-IsSubscribed: yes I've applied the attached patch to fix PR target/62261 which is a sh64 specific 4.9/5 regression. The patch handles negative shift counts at some shift paterns for shmedia. Tested sh64-elf and sh4-unknown-linux-gnu with no new failures. I'll backport it to 4.9 in a weak or two. Regards, kaz --- 2014-08-27 Kaz Kojima PR target/62261 * config/sh/sh.md (ashlsi3): Handle negative shift count for TARGET_SHMEDIA. (ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise. --- ORIG/trunk/gcc/config/sh/sh.md 2014-07-03 09:10:37.000000000 +0900 +++ trunk/gcc/config/sh/sh.md 2014-08-20 12:03:03.540859362 +0900 @@ -4579,6 +4579,12 @@ label: { if (TARGET_SHMEDIA) { + if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0) + { + operands[2] = GEN_INT (-INTVAL (operands[2])); + emit_insn (gen_ashrsi3_media (operands[0], operands[1], operands[2])); + DONE; + } emit_insn (gen_ashlsi3_media (operands[0], operands[1], operands[2])); DONE; } @@ -4819,6 +4825,12 @@ label: { if (TARGET_SHMEDIA) { + if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0) + { + operands[2] = GEN_INT (-INTVAL (operands[2])); + emit_insn (gen_ashrdi3_media (operands[0], operands[1], operands[2])); + DONE; + } emit_insn (gen_ashldi3_media (operands[0], operands[1], operands[2])); DONE; } @@ -4912,6 +4924,12 @@ label: { if (TARGET_SHMEDIA) { + if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0) + { + operands[2] = GEN_INT (-INTVAL (operands[2])); + emit_insn (gen_ashlsi3_media (operands[0], operands[1], operands[2])); + DONE; + } emit_insn (gen_ashrsi3_media (operands[0], operands[1], operands[2])); DONE; } @@ -5011,6 +5029,12 @@ label: { if (TARGET_SHMEDIA) { + if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0) + { + operands[2] = GEN_INT (-INTVAL (operands[2])); + emit_insn (gen_ashldi3_media (operands[0], operands[1], operands[2])); + DONE; + } emit_insn (gen_ashrdi3_media (operands[0], operands[1], operands[2])); DONE; } @@ -5085,6 +5109,12 @@ label: { if (TARGET_SHMEDIA) { + if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0) + { + operands[2] = GEN_INT (-INTVAL (operands[2])); + emit_insn (gen_ashlsi3_media (operands[0], operands[1], operands[2])); + DONE; + } emit_insn (gen_lshrsi3_media (operands[0], operands[1], operands[2])); DONE; } @@ -5279,6 +5309,12 @@ label: { if (TARGET_SHMEDIA) { + if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) < 0) + { + operands[2] = GEN_INT (-INTVAL (operands[2])); + emit_insn (gen_ashldi3_media (operands[0], operands[1], operands[2])); + DONE; + } emit_insn (gen_lshrdi3_media (operands[0], operands[1], operands[2])); DONE; }