From patchwork Thu Apr 5 18:34:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 151003 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 CF2ACB7055 for ; Fri, 6 Apr 2012 04:35:22 +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=1334255723; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Subject:From:To:Content-Type:Date:Message-ID:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=brJXelK07DLJbWKB3Cq5 ulTo80A=; b=bKUqewCWJuBILhSkjUIiuig+WgVT2ZfEgLAGX8kno1Ya9Tj3rF0j pBN8NpYBFZHoGMcjR+/Q9BGPjXuDfMOCLSAyanXfy/5xamHl7v9QdVALhfr5zovo JIM0CORUaX5yjWxHwEYXR6egMyR8bhhUNhT3dkCsRWIeVK3rO/WmrqA= 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:Subject:From:To:Content-Type:Date:Message-ID:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tOtAkY/E8aDnD3zfaVQ+sAobtIcnkfggTppBlagZLWWOKln2dBBhvTaqSIgb5/ IKqIXsIk1HgbC82Ban/qt5FnD4jjHDNcIpSjJ8JuOl3mDzMf9/3DZU4QEhXQb5SK R+v/35sQpyQw85M6ucT3djIn8OapWr3sGy7Uft9RaIiTE=; Received: (qmail 3578 invoked by alias); 5 Apr 2012 18:35:17 -0000 Received: (qmail 3434 invoked by uid 22791); 5 Apr 2012 18:35:16 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout05.t-online.de (HELO mailout05.t-online.de) (194.25.134.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 18:35:03 +0000 Received: from fwd21.aul.t-online.de (fwd21.aul.t-online.de ) by mailout05.t-online.de with smtp id 1SFrWP-0001DV-Lz; Thu, 05 Apr 2012 20:35:01 +0200 Received: from [192.168.0.104] (ZkktfuZdQhuByVL4eBz8L7GLFjk4-0laCScWCk3MXgDbCoJhaCj70f+ZVNypg9Zg8X@[87.157.41.129]) by fwd21.t-online.de with esmtp id 1SFrWF-1otOt60; Thu, 5 Apr 2012 20:34:51 +0200 Subject: [SH] Replace hi_const with satisfies_constraint_I16 From: Oleg Endo To: gcc-patches Date: Thu, 05 Apr 2012 20:34:50 +0200 Message-ID: <1333650890.19154.37.camel@yam-132-YW-E178-FTW> 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 Hi, The attached patch removes the hi_const function and replaces its use with satisfies_constraint_I16. Tested against rev 185893 with... make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a-single/-mb, -m4-single/-ml,-m4-single/-mb, -m4a-single/-ml,-m4a-single/-mb}" ...and no new failures. OK? Cheers, Oleg ChangeLog: * config/sh/sh.c (hi_const): Remove. (find_barrier, sh_reorg): Use satisfies_constraint_I16 instead of hi_const. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 185894) +++ gcc/config/sh/sh.c (working copy) @@ -174,7 +174,6 @@ static void print_slot (rtx); static rtx add_constant (rtx, enum machine_mode, rtx); static void dump_table (rtx, rtx); -static int hi_const (rtx); static int broken_move (rtx); static int mova_p (rtx); static rtx find_barrier (int, rtx, rtx); @@ -4293,17 +4292,6 @@ pool_window_last = 0; } -/* Return nonzero if constant would be an ok source for a - mov.w instead of a mov.l. */ - -static int -hi_const (rtx src) -{ - return (CONST_INT_P (src) - && INTVAL (src) >= -32768 - && INTVAL (src) <= 32767); -} - #define MOVA_LABELREF(mova) XVECEXP (SET_SRC (PATTERN (mova)), 0, 0) /* Nonzero if the insn is a move instruction which needs to be fixed. */ @@ -4583,7 +4571,8 @@ front end will generate code to load unsigned constants into HImode targets without properly sign extending them. */ if (mode == HImode - || (mode == SImode && hi_const (src) && REGNO (dst) != FPUL_REG)) + || (mode == SImode && satisfies_constraint_I16 (src) + && REGNO (dst) != FPUL_REG)) { found_hi += 2; /* We put the short constants before the long constants, so @@ -5726,7 +5715,7 @@ dst = SET_DEST (pat); mode = GET_MODE (dst); - if (mode == SImode && hi_const (src) + if (mode == SImode && satisfies_constraint_I16 (src) && REGNO (dst) != FPUL_REG) { int offset = 0;