ldy 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.

From-SVN: r52984
This commit is contained in:
Aldy Hernandez 2002-05-01 01:50:24 +00:00 committed by Aldy Hernandez
parent 479060323b
commit 08b57fb3ab
3 changed files with 48 additions and 1 deletions

View File

@ -1,3 +1,20 @@
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

View File

@ -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;

View File

@ -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