From patchwork Sat Nov 23 19:21:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 293693 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 2205B2C00CC for ; Sun, 24 Nov 2013 06:34:32 +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=o70DA1j+LZCJ4T/un3h5JgB61JOwGOceKZeZQWManiVipOTTw+ ziHYvDAUN3mz9lSL3DRhTO+T4EBspFbjx4nK5Sn/1ja8iaheGTMR8BHPNvQBpkYZ YVoG9dFg20HacecTpZ0sFG4sshoD12BjaqwIDEq6chl7jmiURDm0FSWXE= 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=0PV6vetR1H4cqgVH3wZXa003xXw=; b=CmgOoXSYn/xrrQVSbRXj aSgZBzX9dQe8vZqwFgGLBbV0vwFOQ/P4ciC0iQ4+YoqsUjZQk2YipkkgYqq5Qzh3 0PInWaYNcI/6yNLLhfi5Po8kqE0mls60V1jA4rRQ9PcVX4T1+LavSgflTucGCxx1 /4ImMubX/qnElDASZNE7z0E= Received: (qmail 1705 invoked by alias); 23 Nov 2013 19:22:36 -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 1685 invoked by uid 89); 23 Nov 2013 19:22:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, 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:21:15 +0000 Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta11.emeryville.ca.mail.comcast.net with comcast id t7Lh1m0071ZMdJ4AB7M8w0; Sat, 23 Nov 2013 19:21:08 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta16.emeryville.ca.mail.comcast.net with comcast id t7Lu1m00Q0BKwT48c7M7Xm; Sat, 23 Nov 2013 19:21:07 +0000 From: Mike Stump Subject: wide-int, darwin Date: Sat, 23 Nov 2013 11:21:07 -0800 Message-Id: Cc: Mike Stump , 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 darwin port. Ok? * config/darwin.c (darwin_mergeable_constant_section): Use wide-int interfaces. (machopic_select_rtx_section): Update to handle CONST_WIDE_INT. diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 761576d..50fb3f0 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1289,22 +1289,17 @@ darwin_mergeable_constant_section (tree exp, { tree size = TYPE_SIZE_UNIT (TREE_TYPE (exp)); - if (TREE_CODE (size) == INTEGER_CST - && TREE_INT_CST_LOW (size) == 4 - && TREE_INT_CST_HIGH (size) == 0) - return darwin_sections[literal4_section]; - else if (TREE_CODE (size) == INTEGER_CST - && TREE_INT_CST_LOW (size) == 8 - && TREE_INT_CST_HIGH (size) == 0) - return darwin_sections[literal8_section]; - else if (HAVE_GAS_LITERAL16 - && TARGET_64BIT - && TREE_CODE (size) == INTEGER_CST - && TREE_INT_CST_LOW (size) == 16 - && TREE_INT_CST_HIGH (size) == 0) - return darwin_sections[literal16_section]; - else - return readonly_data_section; + if (TREE_CODE (size) == INTEGER_CST) + { + if (wi::eq_p (size, 4)) + return darwin_sections[literal4_section]; + else if (wi::eq_p (size, 8)) + return darwin_sections[literal8_section]; + else if (HAVE_GAS_LITERAL16 + && TARGET_64BIT + && wi::eq_p (size, 16)) + return darwin_sections[literal16_section]; + } } return readonly_data_section; @@ -1731,16 +1726,19 @@ machopic_select_rtx_section (enum machine_mode mode, rtx x, { if (GET_MODE_SIZE (mode) == 8 && (GET_CODE (x) == CONST_INT + || GET_CODE (x) == CONST_WIDE_INT || GET_CODE (x) == CONST_DOUBLE)) return darwin_sections[literal8_section]; else if (GET_MODE_SIZE (mode) == 4 && (GET_CODE (x) == CONST_INT + || GET_CODE (x) == CONST_WIDE_INT || GET_CODE (x) == CONST_DOUBLE)) return darwin_sections[literal4_section]; else if (HAVE_GAS_LITERAL16 && TARGET_64BIT && GET_MODE_SIZE (mode) == 16 && (GET_CODE (x) == CONST_INT + || GET_CODE (x) == CONST_WIDE_INT || GET_CODE (x) == CONST_DOUBLE || GET_CODE (x) == CONST_VECTOR)) return darwin_sections[literal16_section];