RFC: PATCH: Require and use int64 for x86 options
H.J. Lu
hjl.tools@gmail.com
Wed Jul 27 17:00:00 GMT 2011
On Wed, Jul 13, 2011 at 6:22 AM, Ian Lance Taylor <iant@google.com> wrote:
> Igor Zamyatin <izamyatin@gmail.com> writes:
>
>> 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=yes 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. This patch uses
int64 on both ix86_isa_flags and PTA. I added a new option to opt:
; Maximum number of mask bits in a variable.
MaxMaskBits
ix86_isa_flags = 64
It mark ix86_isa_flags as 64bit. Any comments?
Thanks.
--
H.J.
---
gcc/
2011-07-27 H.J. Lu <hongjiu.lu@intel.com>
* config.gcc: Set need_64bit_hwint to yes for x86 targets.
* opt-read.awk (BEGIN): Set max_mask_bits[var] and
var_mask_1[var].
* opth-gen.awk: Use var_mask_1[var] instead of 1. Check
max_mask_bits[var] instead of 31.
* config/i386/i386.c (pta): Use HOST_WIDE_INT on flags.
(builtin_isa): Use HOST_WIDE_INT on isa.
(def_builtin): Use HOST_WIDE_INT on mask.
(def_builtin_const): Likewise.
(builtin_description): Likewise.
* config/i386/i386.opt (MaxMaskBits): New.
(ix86_isa_flags): Replace int with HOST_WIDE_INT.
(ix86_isa_flags_explicit): Likewise.
(x_ix86_isa_flags_explicit): Likewise.
libcpp/
2011-07-27 H.J. Lu <hongjiu.lu@intel.com>
* configure.ac: Set need_64bit_hwint to yes for x86 targets.
* configure: Regenerated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-x86-int64-1.patch
Type: text/x-diff
Size: 6862 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110727/e15b8165/attachment.bin>
More information about the Gcc
mailing list