From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31269 invoked by alias); 27 Jul 2011 17:40:46 -0000 Received: (qmail 31140 invoked by uid 22791); 27 Jul 2011 17:40:44 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jul 2011 17:40:30 +0000 Received: by qwh5 with SMTP id 5so1081678qwh.20 for ; Wed, 27 Jul 2011 10:40:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.118.69 with SMTP id u5mr70194qcq.122.1311788429608; Wed, 27 Jul 2011 10:40:29 -0700 (PDT) Received: by 10.229.98.193 with HTTP; Wed, 27 Jul 2011 10:40:29 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Jul 2011 18:05:00 -0000 Message-ID: Subject: Re: RFC: PATCH: Require and use int64 for x86 options From: "H.J. Lu" To: Uros Bizjak Cc: Ian Lance Taylor , "Joseph S. Myers" , Igor Zamyatin , gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg00485.txt.bz2 On Wed, Jul 27, 2011 at 10:00 AM, Uros Bizjak wrote: > On Wed, Jul 27, 2011 at 6:42 PM, H.J. Lu wrote: > >>>> As you may see pta_flags enum in i386.c is almost full. So there is a >>>> risk of overflow in quite near future. Comment in source code advises >>>> "widen struct pta flags" which is now defined as unsigned. But it >>>> looks not optimal. >>>> >>>> What will be the most proper solution for this problem? >>> >>> Why is widening pta_flags "not optimal?" >>> >>> It's hard for me to believe that we still care about bootstrapping a >>> i386-*-* compiler with a compiler which doesn't support any 64-bit type. >>> So I don't see any problem with setting need_64bit_hwint=3Dyes in >>> config.gcc for i386-*-*, changing pta_flags to be unsigned >>> HOST_WIDE_INT, and letting pta_flags go up to (unsigned HOST_WIDE_INT) 1 >>> << 63. >>> >>> If anybody doesn't like that idea, we can simply add a flags2 field and >>> a pta_flags2 enum with PTA2_xxx constants. >>> >> >> Hi, >> >> We are also running out of bits in ix86_isa_flags. =A0This patch uses >> int64 on both ix86_isa_flags and PTA. =A0I added a new option to opt: >> >> ; Maximum number of mask bits in a variable. >> MaxMaskBits >> ix86_isa_flags =3D 64 >> >> It mark ix86_isa_flags as 64bit. =A0Any comments? > > We should just introduce ix86_isa_flags2. =A0We shouldn't stop at 128 fla= gs. ;) > It is used to control which insns are are available. See OPTION_MASK_ISA_XXX_SET and OPTION_MASK_ISA_XXX_UNSET in common/config/i386/i386-common.c. Adding ix86_isa_flags2 makes it very complicated: 1. We need to turn on a set of ISAs for -mXXX. 2. We need to turn off a set of ISAs for -mno-XXX. 3. We need to check 2 fields in def_builtin to see if an insn is available. As a side benefit, need_64bit_hwint=3Dyes will resolve many 32bit code generation differences on ia32 and x86-64 hosts. We can close a bunch of bugs, like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D43226 --=20 H.J.