OSDN Git Service

* config/rs6000/rs6000.c (rs6000_override_options): Set
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Oct 2007 17:12:01 +0000 (17:12 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Oct 2007 17:12:01 +0000 (17:12 +0000)
        rs6000_altivec_abi on AIX.
        (conditional_register_usage): Set VR20:31 fixed on AIX.

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

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

index 4384c63..7faa8c3 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-23  David Edelsohn  <edelsohn@gnu.org>
+
+       * config/rs6000/rs6000.c (rs6000_override_options): Set
+       rs6000_altivec_abi on AIX.
+       (conditional_register_usage): Set VR20:31 fixed on AIX.
+
 2007-10-23  Richard Guenther  <rguenther@suse.de>
 
        * alias.c (get_alias_set): For INDIRECT_REFs, deal with
index 024eda7..cbbb8a8 100644 (file)
@@ -1570,7 +1570,11 @@ rs6000_override_options (const char *default_cpu)
     rs6000_ieeequad = 1;
 #endif
 
-  /* Set Altivec ABI as default for powerpc64 linux.  */
+  /* Enable Altivec ABI for AIX -maltivec.  */
+  if (TARGET_XCOFF && TARGET_ALTIVEC)
+    rs6000_altivec_abi = 1;
+
+  /* Set Altivec ABI as default for PowerPC64 Linux.  */
   if (TARGET_ELF && TARGET_64BIT)
     {
       rs6000_altivec_abi = 1;
@@ -4220,9 +4224,6 @@ rs6000_conditional_register_usage (void)
     fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
       = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
 
-  if (TARGET_ALTIVEC)
-    global_regs[VSCR_REGNO] = 1;
-
   if (TARGET_SPE)
     {
       global_regs[SPEFSCR_REGNO] = 1;
@@ -4237,16 +4238,26 @@ rs6000_conditional_register_usage (void)
        = call_really_used_regs[14] = 1;
     }
 
-  if (! TARGET_ALTIVEC)
+  if (!TARGET_ALTIVEC)
     {
       for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)
        fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
       call_really_used_regs[VRSAVE_REGNO] = 1;
     }
 
+  if (TARGET_ALTIVEC)
+    global_regs[VSCR_REGNO] = 1;
+
   if (TARGET_ALTIVEC_ABI)
-    for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)
-      call_used_regs[i] = call_really_used_regs[i] = 1;
+    {
+      for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i)
+       call_used_regs[i] = call_really_used_regs[i] = 1;
+
+      /* AIX reserves VR20:31 in non-extended ABI mode.  */
+      if (TARGET_XCOFF)
+       for (i = FIRST_ALTIVEC_REGNO + 20; i < FIRST_ALTIVEC_REGNO + 32; ++i)
+         fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
+    }
 }
 \f
 /* Try to output insns to set TARGET equal to the constant C if it can