From: Aldy Hernandez Date: Wed, 1 May 2002 01:50:24 +0000 (+0000) Subject: ldy Hernandez X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08b57fb3abf6b8591b0424da9cb0c5a44f5eb55e;p=gcc.git ldy Hernandez * doc/invoke.texi (Option Summary): Add -mvrsave=. (RS/6000 and PowerPC Options): Document -mvrsave=. * config/rs6000/rs6000.c (rs6000_altivec_vrsave): New global. (rs6000_altivec_vrsave_string): Same. (rs6000_override_options): Call rs6000_parse_vrsave_option. (rs6000_parse_vrsave_option): New. (rs6000_stack_info): Only generate vrsave instructions when TARGET_ALTIVEC_VRSAVE. * config/rs6000/rs6000.h (TARGET_OPTIONS): Add -mvrsave= option. (rs6000_altivec_vrsave_string): Define extern. (rs6000_altivec_vrsave): Same. (TARGET_ALTIVEC_VRSAVE): New. From-SVN: r52984 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ae84559455..e8a1eb5270c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2002-04-30 Aldy Hernandez + + * doc/invoke.texi (Option Summary): Add -mvrsave=. + (RS/6000 and PowerPC Options): Document -mvrsave=. + + * config/rs6000/rs6000.c (rs6000_altivec_vrsave): New global. + (rs6000_altivec_vrsave_string): Same. + (rs6000_override_options): Call rs6000_parse_vrsave_option. + (rs6000_parse_vrsave_option): New. + (rs6000_stack_info): Only generate vrsave instructions when + TARGET_ALTIVEC_VRSAVE. + + * config/rs6000/rs6000.h (TARGET_OPTIONS): Add -mvrsave= option. + (rs6000_altivec_vrsave_string): Define extern. + (rs6000_altivec_vrsave): Same. + (TARGET_ALTIVEC_VRSAVE): New. + 2002-04-30 Richard Henderson PR opt/6516 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 927abba4333..235090005a5 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -74,6 +74,12 @@ int rs6000_long_double_type_size; /* Whether -mabi=altivec has appeared */ int rs6000_altivec_abi; +/* Whether VRSAVE instructions should be generated. */ +int rs6000_altivec_vrsave; + +/* String from -mvrsave= option. */ +const char *rs6000_altivec_vrsave_string; + /* Set to non-zero once AIX common-mode calls have been defined. */ static int common_mode_defined; @@ -168,6 +174,7 @@ static rtx altivec_expand_predicate_builtin PARAMS ((enum insn_code, const char static rtx altivec_expand_ternop_builtin PARAMS ((enum insn_code, tree, rtx)); static rtx altivec_expand_stv_builtin PARAMS ((enum insn_code, tree)); static void rs6000_parse_abi_options PARAMS ((void)); +static void rs6000_parse_vrsave_option PARAMS ((void)); static int first_altivec_reg_to_save PARAMS ((void)); static unsigned int compute_vrsave_mask PARAMS ((void)); static void is_altivec_return_reg PARAMS ((rtx, void *)); @@ -536,6 +543,9 @@ rs6000_override_options (default_cpu) /* Handle -mabi= options. */ rs6000_parse_abi_options (); + /* Handle -mvrsave= option. */ + rs6000_parse_vrsave_option (); + #ifdef TARGET_REGNAMES /* If the user desires alternate register names, copy in the alternate names now. */ @@ -583,6 +593,21 @@ rs6000_override_options (default_cpu) free_machine_status = rs6000_free_machine_status; } +/* Handle -mvrsave= options. */ +static void +rs6000_parse_vrsave_option () +{ + /* Generate VRSAVE instructions by default. */ + if (rs6000_altivec_vrsave_string == 0 + || ! strcmp (rs6000_altivec_vrsave_string, "yes")) + rs6000_altivec_vrsave = 1; + else if (! strcmp (rs6000_altivec_vrsave_string, "no")) + rs6000_altivec_vrsave = 0; + else + error ("unknown -mvrsave= option specified: '%s'", + rs6000_altivec_vrsave_string); +} + /* Handle -mabi= options. */ static void rs6000_parse_abi_options () @@ -7770,7 +7795,7 @@ rs6000_stack_info () info_ptr->parm_size = RS6000_ALIGN (current_function_outgoing_args_size, 8); - if (TARGET_ALTIVEC_ABI) + if (TARGET_ALTIVEC_ABI && TARGET_ALTIVEC_VRSAVE) { info_ptr->vrsave_mask = compute_vrsave_mask (); info_ptr->vrsave_size = info_ptr->vrsave_mask ? 4 : 0; diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 95d5143cbc3..f5bfbfe7add 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -430,6 +430,8 @@ extern enum processor_type rs6000_cpu; {"abi=", &rs6000_abi_string, N_("Specify ABI to use") }, \ {"long-double-", &rs6000_long_double_size_string, \ N_("Specify size of long double (64 or 128 bits)") }, \ + {"vrsave=", &rs6000_altivec_vrsave_string, \ + N_("Specify yes/no if VRSAVE instructions should be generated for AltiVec") }, \ SUBTARGET_OPTIONS \ } @@ -458,9 +460,12 @@ extern int rs6000_debug_arg; /* debug argument handling */ extern const char *rs6000_long_double_size_string; extern int rs6000_long_double_type_size; extern int rs6000_altivec_abi; +extern const char *rs6000_altivec_vrsave_string; +extern int rs6000_altivec_vrsave; #define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128) #define TARGET_ALTIVEC_ABI rs6000_altivec_abi +#define TARGET_ALTIVEC_VRSAVE rs6000_altivec_vrsave /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro