+2002-04-30 Aldy Hernandez <aldyh@redhat.com>
+
+ * 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 <rth@redhat.com>
PR opt/6516
/* 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;
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 *));
/* 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. */
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 ()
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;
{"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 \
}
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