From patchwork Sat Nov 23 19:22:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 293705 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B1D12C00D1 for ; Sun, 24 Nov 2013 06:42:56 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:subject:date:message-id:cc:to:mime-version; q=dns; s=default; b=Uogikf3HtfeS1PR2H0FUQqfg+b3s/XKcnIX4dJnMmXo/EE4Bwh cqM+tyMszyhDtH2e9XF/gCz7v5uXz2wTR/nS1xx3w6PudeGMwZxtQIrL2V+IonFq nv51RwBxjCHHVxzbGPFm2fhVxbtm1HbqIwLgChzixjLMR23LfdCi0nVJc= 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:from :content-type:subject:date:message-id:cc:to:mime-version; s= default; bh=9h6It58oSbdc63mlCqgBQvgU+Wg=; b=a/JgEvqRPXOmlg9fU4/8 C2hlHhveiLhA71ZPmCy38wOtlu3UeQKQpBy9AHVUHBWUJ1tMYuLDSxd4irdjTWVp tmBQd2dHRFpt4JxO5s4TDTIz7qIlaML8wtRSUBZ42hm98NuB/SFNFxJBc+EtJpCV XqekiP7UWrgAGw9uK7/XlmU= Received: (qmail 4739 invoked by alias); 23 Nov 2013 19:23: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 4562 invoked by uid 89); 23 Nov 2013 19:23:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_BL_SPAMCOP_NET, RDNS_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: qmta11.emeryville.ca.mail.comcast.net Received: from Unknown (HELO qmta11.emeryville.ca.mail.comcast.net) (76.96.27.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Nov 2013 19:22:39 +0000 Received: from omta20.emeryville.ca.mail.comcast.net ([76.96.30.87]) by qmta11.emeryville.ca.mail.comcast.net with comcast id t7M21m0021smiN4AB7Nf5l; Sat, 23 Nov 2013 19:22:39 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta20.emeryville.ca.mail.comcast.net with comcast id t7NV1m00v0BKwT48g7Nf6R; Sat, 23 Nov 2013 19:22:39 +0000 From: Mike Stump Subject: wide-int, reload Date: Sat, 23 Nov 2013 11:22:39 -0800 Message-Id: <9340B309-B480-4F10-8A69-FD6A51CEEEB6@comcast.net> Cc: Bernd Schmidt , Kenneth Zadeck To: "gcc-patches@gcc.gnu.org Patches" Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) X-IsSubscribed: yes Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch. This patch covers the reload code. Ok? * postreload.c (reload_cse_simplify_set): Use wide-int interfaces. diff --git a/gcc/postreload.c b/gcc/postreload.c index b0c6342..7803b33 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -295,27 +295,27 @@ reload_cse_simplify_set (rtx set, rtx insn) #ifdef LOAD_EXTEND_OP if (extend_op != UNKNOWN) { - HOST_WIDE_INT this_val; + wide_int result; - /* ??? I'm lazy and don't wish to handle CONST_DOUBLE. Other - constants, such as SYMBOL_REF, cannot be extended. */ - if (!CONST_INT_P (this_rtx)) + if (!CONST_SCALAR_INT_P (this_rtx)) continue; - this_val = INTVAL (this_rtx); switch (extend_op) { case ZERO_EXTEND: - this_val &= GET_MODE_MASK (GET_MODE (src)); + result = wide_int::from (std::make_pair (this_rtx, + GET_MODE (src)), + BITS_PER_WORD, UNSIGNED); break; case SIGN_EXTEND: - /* ??? In theory we're already extended. */ - if (this_val == trunc_int_for_mode (this_val, GET_MODE (src))) - break; + result = wide_int::from (std::make_pair (this_rtx, + GET_MODE (src)), + BITS_PER_WORD, SIGNED); + break; default: gcc_unreachable (); } - this_rtx = GEN_INT (this_val); + this_rtx = immed_wide_int_const (result, word_mode); } #endif this_cost = set_src_cost (this_rtx, speed);