From patchwork Wed Jun 13 21:00:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164762 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 9B8B7B7017 for ; Thu, 14 Jun 2012 07:00:43 +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=1340226043; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=eZJvaYbODnx/YeCh1iMuFuw5H0M=; b=cy5zmIB1zkhvNHM dEa2+MIl1UrRJhh/RBIEWURkTIO5JbH7GgR2kj+xusOPU3clA5cR7tEzfIgVg85Z J7wN42mz763cMgj3wg5SaW/b7z+2U4QY0uOYBex13lsdSLhMU9/bXC0QgYPMKvuL zSpSnG+wgX0OdecSJbgbolwW6if4= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RkFcQ+yxtRzxDmZ6PaueRONh+JoYxdAmqUG1S+huKwfxM4mIMhfWW7RNvmog+J vRgPXeiGDGtgsWIoisflgpUCgEDzOanv7XXjq6JBg5SiMWG0nrb8o+E5JbZF3d6L zInXmAFYg9ty6HVEf4VatBhX2IWdFlOI/zmzj4QMLOuXw=; Received: (qmail 19384 invoked by alias); 13 Jun 2012 21:00:40 -0000 Received: (qmail 19369 invoked by uid 22791); 13 Jun 2012 21:00:39 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jun 2012 21:00:23 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5DL0971002514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Jun 2012 17:00:09 -0400 Received: from pebble.twiddle.home (vpn-10-161.rdu.redhat.com [10.11.10.161]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5DL06bq024680; Wed, 13 Jun 2012 17:00:07 -0400 Message-ID: <4FD8FF55.7060904@redhat.com> Date: Wed, 13 Jun 2012 14:00:05 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: "Joseph S. Myers" CC: Mike Stump , Jay K , GCC Patches Subject: Re: constant that doesn't fit in 32bits in alpha.c References: <4FD67990.1080904@redhat.com> <4FD679DB.7010105@redhat.com> <6641E578-5D47-48B6-9639-DCE2E45EABAE@comcast.net> <4FD6955C.4090904@redhat.com> In-Reply-To: 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 On 2012-06-12 12:44, Joseph S. Myers wrote: > I'd rather have a macro HOST_WIDE_INT_C in hwint.h (like INTMAX_C etc. in > stdint.h). HOST_WIDE_INT_1 is already defined in hwint.h to either 1L or > 1LL; I'd suggest defining HOST_WIDE_INT_C to concatenate with either L or > LL (and then HOST_WIDE_INT_1 can be HOST_WIDE_INT_C (1), unconditionally). > Are you happy with this version? r~ diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 2177288..36f7306 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -5451,8 +5451,6 @@ alpha_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) chain_value = convert_memory_address (Pmode, chain_value); #endif -#define HWI_HEX2(X,Y) (((HOST_WIDE_INT)0x ## X ## u << 32) | 0x ## Y ## u) - if (TARGET_ABI_OPEN_VMS) { const char *fnname; @@ -5471,7 +5469,8 @@ alpha_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) the VMS calling standard. This is stored in the first quadword. */ word1 = force_reg (DImode, gen_const_mem (DImode, fnaddr)); word1 = expand_and (DImode, word1, - GEN_INT (HWI_HEX2(ffff0fff,0000fff0)), NULL); + GEN_INT (HOST_WIDE_INT_C (0xffff0fff0000fff0)), + NULL); } else { @@ -5482,12 +5481,10 @@ alpha_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) nop We don't bother setting the HINT field of the jump; the nop is merely there for padding. */ - word1 = GEN_INT (HWI_HEX2 (a77b0010,a43b0018)); - word2 = GEN_INT (HWI_HEX2 (47ff041f,6bfb0000)); + word1 = GEN_INT (HOST_WIDE_INT_C (0xa77b0010a43b0018)); + word2 = GEN_INT (HOST_WIDE_INT_C (0x47ff041f6bfb0000)); } -#undef HWI_HEX2 - /* Store the first two words, as computed above. */ mem = adjust_address (m_tramp, DImode, 0); emit_move_insn (mem, word1); diff --git a/gcc/hwint.h b/gcc/hwint.h index 9885911..1734639 100644 --- a/gcc/hwint.h +++ b/gcc/hwint.h @@ -1,5 +1,5 @@ /* HOST_WIDE_INT definitions for the GNU compiler. - Copyright (C) 1998, 2002, 2004, 2008, 2009, 2010 + Copyright (C) 1998, 2002, 2004, 2008, 2009, 2010, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -60,20 +60,25 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1]; #if HOST_BITS_PER_LONG >= 64 || !defined NEED_64BIT_HOST_WIDE_INT # define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG # define HOST_WIDE_INT long +# define HOST_WIDE_INT_C(X) X ## L #else # if HOST_BITS_PER_LONGLONG >= 64 # define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONGLONG # define HOST_WIDE_INT long long +# define HOST_WIDE_INT_C(X) X ## LL # else # if HOST_BITS_PER___INT64 >= 64 # define HOST_BITS_PER_WIDE_INT HOST_BITS_PER___INT64 # define HOST_WIDE_INT __int64 +# define HOST_WIDE_INT_C(X) X ## i64 # else #error "Unable to find a suitable type for HOST_WIDE_INT" # endif # endif #endif +#define HOST_WIDE_INT_1 HOST_WIDE_INT_C(1) + /* This is a magic identifier which allows GCC to figure out the type of HOST_WIDE_INT for %wd specifier checks. You must issue this typedef before using the __asm_fprintf__ format attribute. */ @@ -84,7 +89,6 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG # define HOST_WIDE_INT_PRINT HOST_LONG_FORMAT # define HOST_WIDE_INT_PRINT_C "L" -# define HOST_WIDE_INT_1 1L /* 'long' might be 32 or 64 bits, and the number of leading zeroes must be tweaked accordingly. */ # if HOST_BITS_PER_WIDE_INT == 64 @@ -97,7 +101,6 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; #else # define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT # define HOST_WIDE_INT_PRINT_C "LL" -# define HOST_WIDE_INT_1 1LL /* We can assume that 'long long' is at least 64 bits. */ # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ "0x%" HOST_LONG_LONG_FORMAT "x%016" HOST_LONG_LONG_FORMAT "x" @@ -122,14 +125,17 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; # define HOST_WIDEST_INT_PRINT_UNSIGNED HOST_WIDE_INT_PRINT_UNSIGNED # define HOST_WIDEST_INT_PRINT_HEX HOST_WIDE_INT_PRINT_HEX # define HOST_WIDEST_INT_PRINT_DOUBLE_HEX HOST_WIDE_INT_PRINT_DOUBLE_HEX +# define HOST_WIDEST_INT_C(X) HOST_WIDE_INT(X) #else # if HOST_BITS_PER_LONGLONG >= 64 # define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG # define HOST_WIDEST_INT long long +# define HOST_WIDEST_INT_C(X) X ## LL # else # if HOST_BITS_PER___INT64 >= 64 # define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER___INT64 # define HOST_WIDEST_INT __int64 +# define HOST_WIDEST_INT_C(X) X ## i64 # else #error "This line should be impossible to reach" # endif