gcc/ 2011-07-27 H.J. Lu * 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 * configure.ac: Set need_64bit_hwint to yes for x86 targets. * configure: Regenerated. diff --git a/gcc/config.gcc b/gcc/config.gcc index d7cf895..54ac985 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -345,6 +345,7 @@ i[34567]86-*-*) cpu_type=i386 c_target_objs="i386-c.o" cxx_target_objs="i386-c.o" + need_64bit_hwint=yes extra_options="${extra_options} fused-madd.opt" extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 96263ed..c5dd881 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2918,7 +2918,7 @@ ix86_option_override_internal (bool main_args_p) PTA_F16C = 1 << 26, PTA_BMI = 1 << 27, PTA_TBM = 1 << 28 - /* if this reaches 32, need to widen struct pta flags below */ + /* if this reaches 64, need to widen struct pta flags below */ }; static struct pta @@ -2926,7 +2926,7 @@ ix86_option_override_internal (bool main_args_p) const char *const name; /* processor name or nickname. */ const enum processor_type processor; const enum attr_cpu schedule; - const unsigned /*enum pta_flags*/ flags; + const unsigned HOST_WIDE_INT /*enum pta_flags*/ flags; } const processor_alias_table[] = { @@ -24016,7 +24016,7 @@ static GTY(()) tree ix86_builtins[(int) IX86_BUILTIN_MAX]; struct builtin_isa { const char *name; /* function name */ enum ix86_builtin_func_type tcode; /* type to use in the declaration */ - int isa; /* isa_flags this builtin is defined for */ + HOST_WIDE_INT isa; /* isa_flags this builtin is defined for */ bool const_p; /* true if the declaration is constant */ bool set_and_not_built_p; }; @@ -24041,7 +24041,8 @@ static struct builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX]; errors if a builtin is added in the middle of a function scope. */ static inline tree -def_builtin (int mask, const char *name, enum ix86_builtin_func_type tcode, +def_builtin (HOST_WIDE_INT mask, const char *name, + enum ix86_builtin_func_type tcode, enum ix86_builtins code) { tree decl = NULL_TREE; @@ -24079,7 +24080,7 @@ def_builtin (int mask, const char *name, enum ix86_builtin_func_type tcode, /* Like def_builtin, but also marks the function decl "const". */ static inline tree -def_builtin_const (int mask, const char *name, +def_builtin_const (HOST_WIDE_INT mask, const char *name, enum ix86_builtin_func_type tcode, enum ix86_builtins code) { tree decl = def_builtin (mask, name, tcode, code); @@ -24130,7 +24131,7 @@ ix86_add_new_builtins (int isa) struct builtin_description { - const unsigned int mask; + const HOST_WIDE_INT mask; const enum insn_code icode; const char *const name; const enum ix86_builtins code; diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index 5e6b5df..281fec3 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -22,14 +22,18 @@ HeaderInclude config/i386/i386-opts.h +; Maximum number of mask bits in a variable. +MaxMaskBits +ix86_isa_flags = 64 + ; Bit flags that specify the ISA we are compiling for. Variable -int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT +HOST_WIDE_INT ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT ; A mask of ix86_isa_flags that includes bit X if X was set or cleared ; on the command line. Variable -int ix86_isa_flags_explicit +HOST_WIDE_INT ix86_isa_flags_explicit ;; Definitions to add to the cl_target_option structure ;; -march= processor @@ -50,7 +54,7 @@ unsigned char branch_cost ;; which flags were passed by the user TargetSave -int x_ix86_isa_flags_explicit +HOST_WIDE_INT x_ix86_isa_flags_explicit ;; which flags were passed by the user TargetSave diff --git a/gcc/opt-read.awk b/gcc/opt-read.awk index c488ed5..9884175 100644 --- a/gcc/opt-read.awk +++ b/gcc/opt-read.awk @@ -101,6 +101,15 @@ BEGIN { " { " quote string quote ", " value ", " val_flags \ " },\n" } + if ($1 == "MaxMaskBits") { + max = $2 + var = max; + sub(" *=.*", "", var) + sub(".*=", "", max) + max_mask_bits[var] = max + if (max == 64) + var_mask_1[var] = "1LL" + } else { name = opt_args("Mask", $1) if (name == "") { diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index 876e0f6..c4f7b1d 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -300,18 +300,25 @@ for (i = 0; i < n_opts; i++) { name = opt_args("Mask", flags[i]) vname = var_name(flags[i]) mask = "MASK_" + mask_1 = "" if (vname != "") { mask = "OPTION_MASK_" + mask_1 = var_mask_1[vname] } + if (mask_1 == "") + mask_1 = "1" if (name != "" && !flag_set_p("MaskExists", flags[i])) - print "#define " mask name " (1 << " masknum[vname]++ ")" + print "#define " mask name " (" mask_1 " << " masknum[vname]++ ")" } for (i = 0; i < n_extra_masks; i++) { print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")" } for (var in masknum) { - if (masknum[var] > 31) { + max = max_mask_bits[var] + if (max == "") + max = 32 + if (masknum[var] >= max) { if (var == "") print "#error too many target masks" else diff --git a/libcpp/configure b/libcpp/configure index b453a7b..27a867c 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -7312,9 +7312,7 @@ case $target in x86_64-*-* | \ ia64-*-* | \ hppa*64*-*-* | \ - i[34567]86-*-darwin* | \ - i[34567]86-*-solaris2.1[0-9]* | x86_64-*-solaris2.1[0-9]* | \ - i[34567]86-w64-mingw* | \ + i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \ mips*-*-* | \ mmix-*-* | \ powerpc*-*-* | \ diff --git a/libcpp/configure.ac b/libcpp/configure.ac index 170932c..6e9adbf 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -150,9 +150,7 @@ case $target in x86_64-*-* | \ ia64-*-* | \ hppa*64*-*-* | \ - i[34567]86-*-darwin* | \ - i[34567]86-*-solaris2.1[0-9]* | x86_64-*-solaris2.1[0-9]* | \ - i[34567]86-w64-mingw* | \ + i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \ mips*-*-* | \ mmix-*-* | \ powerpc*-*-* | \