Re: PING: PATCH: Use int64 for x86 options
On Sun, 7 Aug 2011, H.J. Lu wrote: HOST_BITS_PER_WIDE_INT isn't defined in target library. I need to check if HOST_BITS_PER_WIDE_INT is defined first. Here is the updated patch. As I said in http://gcc.gnu.org/ml/gcc/2011-07/msg00488.html, you need to check all CLVC_* uses for cases that need updating for HOST_WIDE_INT fields. This patch fails to update option_enabled and get_option_state. -- Joseph S. Myers jos...@codesourcery.com
Re: PING: PATCH: Use int64 for x86 options
On Wed, Aug 17, 2011 at 12:28 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Sun, 7 Aug 2011, H.J. Lu wrote: HOST_BITS_PER_WIDE_INT isn't defined in target library. I need to check if HOST_BITS_PER_WIDE_INT is defined first. Here is the updated patch. As I said in http://gcc.gnu.org/ml/gcc/2011-07/msg00488.html, you need to check all CLVC_* uses for cases that need updating for HOST_WIDE_INT fields. This patch fails to update option_enabled and get_option_state. Here is the additional patch. Thanks. H.J. --- diff --git a/gcc/ChangeLog.isa b/gcc/ChangeLog.isa index a8f7d0e..fe52888 100644 --- a/gcc/ChangeLog.isa +++ b/gcc/ChangeLog.isa @@ -1,3 +1,15 @@ +2011-08-17 H.J. Lu hongjiu...@intel.com + + * opts-common.c (get_option_state): Check cl_host_wide_int + for CLVC_EQUAL size. + +2011-08-17 H.J. Lu hongjiu...@intel.com + + * opts-common.c (set_option): Check cl_host_wide_int for + CLVC_EQUAL. + (option_enabled): Check cl_host_wide_int for CLVC_EQUAL, + CLVC_BIT_CLEAR and CLVC_BIT_SET. + 2011-08-07 H.J. Lu hongjiu...@intel.com * opth-gen.awk: Check number of mask bits only if diff --git a/gcc/opts-common.c b/gcc/opts-common.c index 1c2138f..0b86764 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -1088,9 +1088,14 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set, break; case CLVC_EQUAL: - *(int *) flag_var = (value -? option-var_value -: !option-var_value); + if (option-cl_host_wide_int) + *(HOST_WIDE_INT *) flag_var = (value +? option-var_value +: !option-var_value); + else + *(int *) flag_var = (value + ? option-var_value + : !option-var_value); if (set_flag_var) *(int *) set_flag_var = 1; break; @@ -1188,13 +1193,22 @@ option_enabled (int opt_idx, void *opts) return *(int *) flag_var != 0; case CLVC_EQUAL: - return *(int *) flag_var == option-var_value; + if (option-cl_host_wide_int) + return *(HOST_WIDE_INT *) flag_var == option-var_value; + else + return *(int *) flag_var == option-var_value; case CLVC_BIT_CLEAR: - return (*(int *) flag_var option-var_value) == 0; + if (option-cl_host_wide_int) + return (*(HOST_WIDE_INT *) flag_var option-var_value) == 0; + else + return (*(int *) flag_var option-var_value) == 0; case CLVC_BIT_SET: - return (*(int *) flag_var option-var_value) != 0; + if (option-cl_host_wide_int) + return (*(HOST_WIDE_INT *) flag_var option-var_value) != 0; + else + return (*(int *) flag_var option-var_value) != 0; case CLVC_STRING: case CLVC_ENUM: @@ -1221,7 +1235,9 @@ get_option_state (struct gcc_options *opts, int option, case CLVC_BOOLEAN: case CLVC_EQUAL: state-data = flag_var; - state-size = sizeof (int); + state-size = (cl_options[option].cl_host_wide_int +? sizeof (HOST_WIDE_INT) +: sizeof (int)); break; case CLVC_BIT_CLEAR:
Re: PING: PATCH: Use int64 for x86 options
On Wed, 17 Aug 2011, H.J. Lu wrote: On Wed, Aug 17, 2011 at 12:28 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Sun, 7 Aug 2011, H.J. Lu wrote: HOST_BITS_PER_WIDE_INT isn't defined in target library. I need to check if HOST_BITS_PER_WIDE_INT is defined first. Here is the updated patch. As I said in http://gcc.gnu.org/ml/gcc/2011-07/msg00488.html, you need to check all CLVC_* uses for cases that need updating for HOST_WIDE_INT fields. This patch fails to update option_enabled and get_option_state. Here is the additional patch. Thanks. The target-independent parts of your patch are OK with these extra changes, subject to the usual test requirements. -- Joseph S. Myers jos...@codesourcery.com
Re: PING: PATCH: Use int64 for x86 options
On Wed, Aug 17, 2011 at 1:35 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Wed, 17 Aug 2011, H.J. Lu wrote: On Wed, Aug 17, 2011 at 12:28 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Sun, 7 Aug 2011, H.J. Lu wrote: HOST_BITS_PER_WIDE_INT isn't defined in target library. I need to check if HOST_BITS_PER_WIDE_INT is defined first. Here is the updated patch. As I said in http://gcc.gnu.org/ml/gcc/2011-07/msg00488.html, you need to check all CLVC_* uses for cases that need updating for HOST_WIDE_INT fields. This patch fails to update option_enabled and get_option_state. Here is the additional patch. Thanks. The target-independent parts of your patch are OK with these extra changes, subject to the usual test requirements. -- Joseph S. Myers jos...@codesourcery.com I am testing this complete patch. Richard, Uros, is x86 backend change OK? Thanks. -- H.J. 2011-08-17 H.J. Lu hongjiu...@intel.com Igor Zamyatin igor.zamya...@intel.com * hwint.h (HOST_WIDE_INT_1): New. * opt-functions.awk (switch_bit_fields): Initialize the host_wide_int field. (host_wide_int_var_name): New. (var_type_struct): Check and return HOST_WIDE_INT. * opt-read.awk: Handle HOST_WIDE_INT for Variable. * optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other. * opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly check masks for HOST_WIDE_INT. * opts-common.c (set_option): Support HOST_WIDE_INT flag_var. (option_enabled): Likewise. (get_option_state): Likewise. * opts.h (cl_option): Add cl_host_wide_int. Change var_value to HOST_WIDE_INT. * config/i386/i386-c.c (ix86_target_macros_internal): Replace int with HOST_WIDE_INT for isa_flag. (ix86_pragma_target_parse): Replace int with HOST_WIDE_INT for isa variables. * config/i386/i386.c (ix86_target_string): Replace int with HOST_WIDE_INT for isa. Use HOST_WIDE_INT_PRINT to print isa. (ix86_target_opts): Replace int with HOST_WIDE_INT on mask. (pta_flags): Removed. (PTA_XXX): Redefined as (HOST_WIDE_INT_1 X). (pta): Use HOST_WIDE_INT on flags. (builtin_isa): Use HOST_WIDE_INT on isa. (ix86_add_new_builtins): Likewise. (def_builtin): Use HOST_WIDE_INT on mask. (def_builtin_const): Likewise. (builtin_description): Likewise. * config/i386/i386.opt (ix86_isa_flags): Replace int with HOST_WIDE_INT. (ix86_isa_flags_explicit): Likewise. (x_ix86_isa_flags_explicit): Likewise. 2011-08-17 H.J. Lu hongjiu...@intel.com Igor Zamyatin igor.zamya...@intel.com * hwint.h (HOST_WIDE_INT_1): New. * opt-functions.awk (switch_bit_fields): Initialize the host_wide_int field. (host_wide_int_var_name): New. (var_type_struct): Check and return HOST_WIDE_INT. * opt-read.awk: Handle HOST_WIDE_INT for Variable. * optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other. * opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly check masks for HOST_WIDE_INT. * opts-common.c (set_option): Support HOST_WIDE_INT flag_var. (option_enabled): Likewise. (get_option_state): Likewise. * opts.h (cl_option): Add cl_host_wide_int. Change var_value to HOST_WIDE_INT. * config/i386/i386-c.c (ix86_target_macros_internal): Replace int with HOST_WIDE_INT for isa_flag. (ix86_pragma_target_parse): Replace int with HOST_WIDE_INT for isa variables. * config/i386/i386.c (ix86_target_string): Replace int with HOST_WIDE_INT for isa. Use HOST_WIDE_INT_PRINT to print isa. (ix86_target_opts): Replace int with HOST_WIDE_INT on mask. (pta_flags): Removed. (PTA_XXX): Redefined as (HOST_WIDE_INT_1 X). (pta): Use HOST_WIDE_INT on flags. (builtin_isa): Use HOST_WIDE_INT on isa. (ix86_add_new_builtins): Likewise. (def_builtin): Use HOST_WIDE_INT on mask. (def_builtin_const): Likewise. (builtin_description): Likewise. * config/i386/i386.opt (ix86_isa_flags): Replace int with HOST_WIDE_INT. (ix86_isa_flags_explicit): Likewise. (x_ix86_isa_flags_explicit): Likewise. diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index 1fc333c..c5a770f 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -34,14 +34,14 @@ along with GCC; see the file COPYING3. If not see static bool ix86_pragma_target_parse (tree, tree); static void ix86_target_macros_internal - (int, enum processor_type, enum processor_type, enum fpmath_unit, + (HOST_WIDE_INT, enum processor_type, enum processor_type, enum fpmath_unit, void (*def_or_undef) (cpp_reader *, const char *)); /* Internal function to either define or undef the appropriate system macros. */ static void -ix86_target_macros_internal (int isa_flag, +ix86_target_macros_internal (HOST_WIDE_INT isa_flag, enum processor_type arch, enum
Re: PING: PATCH: Use int64 for x86 options
On Tue, Aug 9, 2011 at 7:06 AM, Joseph S. Myers jos...@codesourcery.com wrote: On Tue, 9 Aug 2011, H.J. Lu wrote: Is this OK for trunk? No. You don't need to ping so often; I'll look at it in due course once sufficient time has passed since the last posted revision (if a patch keeps getting new versions posted, I consider that evidence that I should wait a while before considering reviewing it because it's likely still to be unstable). Hi Joseph, Do you have time to review this patch? We have many x86 patches depending on it. Thanks. -- H.J.
Re: PING: PATCH: Use int64 for x86 options
On Tue, 16 Aug 2011, H.J. Lu wrote: On Tue, Aug 9, 2011 at 7:06 AM, Joseph S. Myers jos...@codesourcery.com wrote: On Tue, 9 Aug 2011, H.J. Lu wrote: Is this OK for trunk? No. You don't need to ping so often; I'll look at it in due course once sufficient time has passed since the last posted revision (if a patch keeps getting new versions posted, I consider that evidence that I should wait a while before considering reviewing it because it's likely still to be unstable). Hi Joseph, Do you have time to review this patch? We have many x86 patches depending on it. I expect to review it later this week. -- Joseph S. Myers jos...@codesourcery.com
Re: PING: PATCH: Use int64 for x86 options
Is this OK for trunk? On Sun, Aug 7, 2011 at 7:18 PM, H.J. Lu hjl.to...@gmail.com wrote: On Sat, Aug 6, 2011 at 9:05 AM, H.J. Lu hjl.to...@gmail.com wrote: Ping. AVX2 support depends on this patch. --- 2011-08-04 H.J. Lu hongjiu...@intel.com Igor Zamyatin igor.zamya...@intel.com * hwint.h (HOST_WIDE_INT_1): New. * opt-functions.awk (switch_bit_fields): Initialize the host_wide_int field. (host_wide_int_var_name): New. (var_type_struct): Check and return HOST_WIDE_INT. * opt-read.awk: Handle HOST_WIDE_INT for Variable. * optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other. * opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly check masks for HOST_WIDE_INT. * opts-common.c (set_option): Support HOST_WIDE_INT Flag_var. * opts.h (cl_option): Add cl_host_wide_int. Change var_value to HOST_WIDE_INT. * config/i386/i386-c.c (ix86_target_macros_internal): Replace int with HOST_WIDE_INT for isa_flag. (ix86_pragma_target_parse): Replace int with HOST_WIDE_INT for isa variables. * config/i386/i386.c (ix86_target_string): Replace int with HOST_WIDE_INT for isa. Use HOST_WIDE_INT_PRINT to print isa. (ix86_target_opts): Replace int with HOST_WIDE_INT on mask. (pta_flags): Removed. (PTA_XXX): Redefined as (HOST_WIDE_INT_1 X). (pta): Use HOST_WIDE_INT on flags. (builtin_isa): Use HOST_WIDE_INT on isa. (ix86_add_new_builtins): Likewise. (def_builtin): Use HOST_WIDE_INT on mask. (def_builtin_const): Likewise. (builtin_description): Likewise. * config/i386/i386.opt (ix86_isa_flags): Replace int with HOST_WIDE_INT. (ix86_isa_flags_explicit): Likewise. (x_ix86_isa_flags_explicit): Likewise. -- H.J. HOST_BITS_PER_WIDE_INT isn't defined in target library. I need to check if HOST_BITS_PER_WIDE_INT is defined first. Here is the updated patch. -- H.J. -- H.J.
Re: PING: PATCH: Use int64 for x86 options
On Tue, 9 Aug 2011, H.J. Lu wrote: Is this OK for trunk? No. You don't need to ping so often; I'll look at it in due course once sufficient time has passed since the last posted revision (if a patch keeps getting new versions posted, I consider that evidence that I should wait a while before considering reviewing it because it's likely still to be unstable). -- Joseph S. Myers jos...@codesourcery.com
Re: PING: PATCH: Use int64 for x86 options
On Tue, Aug 9, 2011 at 7:06 AM, Joseph S. Myers jos...@codesourcery.com wrote: On Tue, 9 Aug 2011, H.J. Lu wrote: Is this OK for trunk? No. You don't need to ping so often; I'll look at it in due course once sufficient time has passed since the last posted revision (if a patch keeps getting new versions posted, I consider that evidence that I should wait a while before considering reviewing it because it's likely still to be unstable). Thanks. -- H.J.
Re: PING: PATCH: Use int64 for x86 options
On Sat, Aug 6, 2011 at 9:05 AM, H.J. Lu hjl.to...@gmail.com wrote: Ping. AVX2 support depends on this patch. Thanks. On Thu, Aug 4, 2011 at 5:49 PM, H.J. Lu hjl.to...@gmail.com wrote: On Thu, Aug 4, 2011 at 4:44 PM, H.J. Lu hjl.to...@gmail.com wrote: On Thu, Aug 4, 2011 at 3:46 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Thu, 4 Aug 2011, H.J. Lu wrote: Here is the updated patch to get proper HOST_WIDE_INT bits and 1 through a new file, opt-gen.c. OK for trunk? Using another generator program like this can't be the best approach (apart from anything else, when built for the build system hwint.h should reflect the build system types not the host system types; cf. http://gcc.gnu.org/ml/gcc/2010-08/msg00111.html where I suspected that sort of host/build confusion of causing a reported build failure). You want opth-gen.awk to know the number of bits to give errors. Note that the errors are given by generating #error into the output file. It's easy enough to generate #if conditions into the file that compare with HOST_BITS_PER_WIDE_INT. You want opth-gen.awk to know whether to use 1LL as the shifted constant. You can easily enough make hwint.h contain a HOST_WIDE_INT_1 macro, defined to 1L or 1LL as appropriate. Here is the updated patch. OK for trunk? Small update. Replace 1LL with HOST_WIDE_INT_1 in PTA_XXX. OK for trunk? Thanks. -- H.J. --- 2011-08-04 H.J. Lu hongjiu...@intel.com Igor Zamyatin igor.zamya...@intel.com * hwint.h (HOST_WIDE_INT_1): New. * opt-functions.awk (switch_bit_fields): Initialize the host_wide_int field. (host_wide_int_var_name): New. (var_type_struct): Check and return HOST_WIDE_INT. * opt-read.awk: Handle HOST_WIDE_INT for Variable. * optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other. * opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly check masks for HOST_WIDE_INT. * opts-common.c (set_option): Support HOST_WIDE_INT Flag_var. * opts.h (cl_option): Add cl_host_wide_int. Change var_value to HOST_WIDE_INT. * config/i386/i386-c.c (ix86_target_macros_internal): Replace int with HOST_WIDE_INT for isa_flag. (ix86_pragma_target_parse): Replace int with HOST_WIDE_INT for isa variables. * config/i386/i386.c (ix86_target_string): Replace int with HOST_WIDE_INT for isa. Use HOST_WIDE_INT_PRINT to print isa. (ix86_target_opts): Replace int with HOST_WIDE_INT on mask. (pta_flags): Removed. (PTA_XXX): Redefined as (HOST_WIDE_INT_1 X). (pta): Use HOST_WIDE_INT on flags. (builtin_isa): Use HOST_WIDE_INT on isa. (ix86_add_new_builtins): Likewise. (def_builtin): Use HOST_WIDE_INT on mask. (def_builtin_const): Likewise. (builtin_description): Likewise. * config/i386/i386.opt (ix86_isa_flags): Replace int with HOST_WIDE_INT. (ix86_isa_flags_explicit): Likewise. (x_ix86_isa_flags_explicit): Likewise. -- H.J. HOST_BITS_PER_WIDE_INT isn't defined in target library. I need to check if HOST_BITS_PER_WIDE_INT is defined first. Here is the updated patch. -- H.J. 2011-08-07 H.J. Lu hongjiu...@intel.com Igor Zamyatin igor.zamya...@intel.com * hwint.h (HOST_WIDE_INT_1): New. * opt-functions.awk (switch_bit_fields): Initialize the host_wide_int field. (host_wide_int_var_name): New. (var_type_struct): Check and return HOST_WIDE_INT. * opt-read.awk: Handle HOST_WIDE_INT for Variable. * optc-save-gen.awk: Support HOST_WIDE_INT on var_target_other. * opth-gen.awk: Use HOST_WIDE_INT_1 on HOST_WIDE_INT. Properly check masks for HOST_WIDE_INT. * opts-common.c (set_option): Support HOST_WIDE_INT Flag_var. * opts.h (cl_option): Add cl_host_wide_int. Change var_value to HOST_WIDE_INT. * config/i386/i386-c.c (ix86_target_macros_internal): Replace int with HOST_WIDE_INT for isa_flag. (ix86_pragma_target_parse): Replace int with HOST_WIDE_INT for isa variables. * config/i386/i386.c (ix86_target_string): Replace int with HOST_WIDE_INT for isa. Use HOST_WIDE_INT_PRINT to print isa. (ix86_target_opts): Replace int with HOST_WIDE_INT on mask. (pta_flags): Removed. (PTA_XXX): Redefined as (HOST_WIDE_INT_1 X). (pta): Use HOST_WIDE_INT on flags. (builtin_isa): Use HOST_WIDE_INT on isa. (ix86_add_new_builtins): Likewise. (def_builtin): Use HOST_WIDE_INT on mask. (def_builtin_const): Likewise. (builtin_description): Likewise. * config/i386/i386.opt (ix86_isa_flags): Replace int with HOST_WIDE_INT. (ix86_isa_flags_explicit): Likewise. (x_ix86_isa_flags_explicit): Likewise. diff --git