ldy Hernandez <aldyh@redhat.com>
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 May 2002 01:50:24 +0000 (01:50 +0000)
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 May 2002 01:50:24 +0000 (01:50 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52984 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h

index 2ae8455..e8a1eb5 100644 (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
index 927abba..2350900 100644 (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;
index 95d5143..f5bfbfe 100644 (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