This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed] aix_struct_return and Altivec vrsave


	This patch cleans up PowerPC option processing a bit more by
moving the aix_struct_return flag into its own variable.

	This patch also includes the removal of special handling for
TARGET_ALTIVEC_VRSAVE required by the recent awk changes.

Bootstrapped and regression tested on powerpc-ibm-aix5.2.0.0

David

	* config/rs6000/aix.h (TARGET_ALTIVEC_VRSAVE): Delete.
	* config/rs6000/rs6000.c (rs6000_explicit_options): Add
	aix_struct_ret.
	(rs6000_override_options): Do not protect TARGET_ALTIVEC_VRSAVE.
	Modify aix_struct_return variable, not target_flags.
	(rs6000_handle_option): Do not protect TARGET_ALTIVEC_VRSAVE.
	(rs6000_return_in_memory): Test aix_struct_return.
	* config/rs6000/rs6000.opt (maix-struct-return): Convert to
	independent variable.  Report mxl-compat.

Index: aix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/aix.h,v
retrieving revision 1.54
diff -c -p -r1.54 aix.h
*** aix.h	7 May 2005 18:51:46 -0000	1.54
--- aix.h	17 May 2005 14:15:31 -0000
***************
*** 38,45 ****
  #define TARGET_ALTIVEC 0
  #undef  TARGET_ALTIVEC_ABI
  #define TARGET_ALTIVEC_ABI 0
- #undef  TARGET_ALTIVEC_VRSAVE
- #define TARGET_ALTIVEC_VRSAVE 0
  
  /* The AIX linker will discard static constructors in object files before
     collect has a chance to see them, so scan the object files directly.  */
--- 38,43 ----
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.824
diff -c -p -r1.824 rs6000.c
*** rs6000.c	13 May 2005 19:52:39 -0000	1.824
--- rs6000.c	17 May 2005 14:15:31 -0000
*************** int rs6000_alignment_flags;
*** 226,231 ****
--- 226,232 ----
  
  /* True for any options that were explicitly set.  */
  struct {
+   bool aix_struct_ret;		/* True if -maix-struct-ret was used.  */
    bool alignment;		/* True if -malign- was used.  */
    bool abi;			/* True if -mabi= was used.  */
    bool spe;			/* True if -mspe= was used.  */
*************** rs6000_override_options (const char *def
*** 1252,1260 ****
    if (TARGET_ELF && TARGET_64BIT)
      {
        rs6000_altivec_abi = 1;
- #if TARGET_ALTIVEC_VRSAVE != 0
        TARGET_ALTIVEC_VRSAVE = 1;
- #endif
      }
  
    /* Set the Darwin64 ABI as default for 64-bit Darwin.  */
--- 1253,1259 ----
*************** rs6000_override_options (const char *def
*** 1357,1372 ****
      memcpy (rs6000_reg_names, alt_reg_names, sizeof (rs6000_reg_names));
  #endif
  
!   /* Set TARGET_AIX_STRUCT_RET last, after the ABI is determined.
       If -maix-struct-return or -msvr4-struct-return was explicitly
       used, don't override with the ABI default.  */
!   if ((target_flags_explicit & MASK_AIX_STRUCT_RET) == 0)
!     {
!       if (DEFAULT_ABI == ABI_V4 && !DRAFT_V4_STRUCT_RET)
! 	target_flags = (target_flags & ~MASK_AIX_STRUCT_RET);
!       else
! 	target_flags |= MASK_AIX_STRUCT_RET;
!     }
  
    if (TARGET_LONG_DOUBLE_128
        && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN))
--- 1356,1366 ----
      memcpy (rs6000_reg_names, alt_reg_names, sizeof (rs6000_reg_names));
  #endif
  
!   /* Set aix_struct_return last, after the ABI is determined.
       If -maix-struct-return or -msvr4-struct-return was explicitly
       used, don't override with the ABI default.  */
!   if (!rs6000_explicit_options.aix_struct_ret)
!     aix_struct_return = (DEFAULT_ABI != ABI_V4 || DRAFT_V4_STRUCT_RET);
  
    if (TARGET_LONG_DOUBLE_128
        && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN))
*************** rs6000_handle_option (size_t code, const
*** 1639,1649 ****
  	}
        break;
  
! #if TARGET_ALTIVEC_VRSAVE != 0
      case OPT_mvrsave_:
        rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
        break;
- #endif
  
      case OPT_misel_:
        rs6000_explicit_options.isel = true;
--- 1633,1646 ----
  	}
        break;
  
!     case OPT_maix_struct_return:
!     case OPT_msvr4_struct_return:
!       rs6000_explicit_options.aix_struct_ret = true;
!       break;
! 
      case OPT_mvrsave_:
        rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
        break;
  
      case OPT_misel_:
        rs6000_explicit_options.isel = true;
*************** rs6000_emit_move (rtx dest, rtx source, 
*** 3899,3905 ****
     returned in memory.  The Darwin ABI does the same.  The SVR4 ABI
     specifies that structures <= 8 bytes are returned in r3/r4, but a
     draft put them in memory, and GCC used to implement the draft
!    instead of the final standard.  Therefore, TARGET_AIX_STRUCT_RET
     controls this instead of DEFAULT_ABI; V.4 targets needing backward
     compatibility can change DRAFT_V4_STRUCT_RET to override the
     default, and -m switches get the final word.  See
--- 3896,3902 ----
     returned in memory.  The Darwin ABI does the same.  The SVR4 ABI
     specifies that structures <= 8 bytes are returned in r3/r4, but a
     draft put them in memory, and GCC used to implement the draft
!    instead of the final standard.  Therefore, aix_struct_return
     controls this instead of DEFAULT_ABI; V.4 targets needing backward
     compatibility can change DRAFT_V4_STRUCT_RET to override the
     default, and -m switches get the final word.  See
*************** rs6000_return_in_memory (tree type, tree
*** 3935,3941 ****
      }
  
    if (AGGREGATE_TYPE_P (type)
!       && (TARGET_AIX_STRUCT_RET
  	  || (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8))
      return true;
  
--- 3932,3938 ----
      }
  
    if (AGGREGATE_TYPE_P (type)
!       && (aix_struct_return
  	  || (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8))
      return true;
  
Index: rs6000.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.opt,v
retrieving revision 1.2
diff -c -p -r1.2 rs6000.opt
*** rs6000.opt	7 May 2005 18:51:50 -0000	1.2
--- rs6000.opt	17 May 2005 14:15:31 -0000
*************** msched-epilog
*** 112,126 ****
  Target Undocumented Mask(SCHED_PROLOG) MaskExists
  
  maix-struct-return
! Target Report Mask(AIX_STRUCT_RET)
  Return all structures in memory (AIX default)
  
  msvr4-struct-return
! Target Report InverseMask(AIX_STRUCT_RET)
  Return small structures in registers (SVR4 default)
  
  mxl-compat
! Target Var(TARGET_XL_COMPAT)
  Conform more closely to IBM XLC semantics
  
  mno-fp-in-toc
--- 112,126 ----
  Target Undocumented Mask(SCHED_PROLOG) MaskExists
  
  maix-struct-return
! Target Report RejectNegative Var(aix_struct_return)
  Return all structures in memory (AIX default)
  
  msvr4-struct-return
! Target Report RejectNegative Var(aix_struct_return,0) VarExists
  Return small structures in registers (SVR4 default)
  
  mxl-compat
! Target Report Var(TARGET_XL_COMPAT)
  Conform more closely to IBM XLC semantics
  
  mno-fp-in-toc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]