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]

AIX disable Altivec


	This patch forces Altivec disabled which saves another 500KB in
the size of the compiler.

David

	* config/rs6000/aix.h (TARGET_ALTIVEC): Define to 0.
	(TARGET_ALTIVEC_ABI): Same.
	(TARGET_ALTIVEC_VRSAVE): Same.

	* config/rs6000/rs6000.c (rs6000_expand_ternop_builtin): Check
	icode not CODE_FOR_nothing.  Change switch to if.

Index: aix.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix.h,v
retrieving revision 1.31
diff -c -p -r1.31 aix.h
*** aix.h	7 Aug 2002 21:05:15 -0000	1.31
--- aix.h	8 Aug 2002 01:18:28 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 21,28 ****
  
  /* Yes!  We are AIX!  */
  #define DEFAULT_ABI ABI_AIX
! #undef TARGET_AIX
  #define TARGET_AIX 1
  /* The AIX linker will discard static constructors in object files before
     collect has a chance to see them, so scan the object files directly.  */
  #define COLLECT_EXPORT_LIST
--- 21,45 ----
  
  /* Yes!  We are AIX!  */
  #define DEFAULT_ABI ABI_AIX
! #undef  TARGET_AIX
  #define TARGET_AIX 1
+ 
+ /* AIX always has a TOC.  */
+ #define TARGET_NO_TOC 0
+ #define TARGET_TOC 1
+ #define FIXED_R2 1
+ 
+ /* AIX allows r13 to be used in 32-bit mode.  */
+ #define FIXED_R13 0
+ 
+ /* AIX does not support Altivec.  */
+ #undef  TARGET_ALTIVEC
+ #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.  */
  #define COLLECT_EXPORT_LIST
*************** Boston, MA 02111-1307, USA.  */
*** 122,129 ****
     ? MAX (MAX ((COMPUTED), (SPECIFIED)), 64)		\
     : MAX ((COMPUTED), (SPECIFIED)))
  
- 
- 
  /* Indicate that jump tables go in the text section.  */
  
  #define JUMP_TABLES_IN_TEXT_SECTION 1
--- 139,144 ----
*************** Boston, MA 02111-1307, USA.  */
*** 176,189 ****
  	  = init_one_libfunc (DIVTF3_LIBCALL);				\
        }									\
    } while (0)
- 
- /* AIX always has a TOC.  */
- #define TARGET_NO_TOC		0
- #define	TARGET_TOC		1
- 
- #define FIXED_R2 1
- /* AIX allows r13 to be used.  */
- #define FIXED_R13 0
  
  /* __throw will restore its own return address to be the same as the
     return address of the function that the throw is being made to.
--- 191,196 ----
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.358
diff -c -p -r1.358 rs6000.c
*** rs6000.c	7 Aug 2002 21:05:14 -0000	1.358
--- rs6000.c	8 Aug 2002 01:18:28 -0000
*************** rs6000_expand_ternop_builtin (icode, arg
*** 4368,4395 ****
    enum machine_mode mode1 = insn_data[icode].operand[2].mode;
    enum machine_mode mode2 = insn_data[icode].operand[3].mode;
  
    /* If we got invalid arguments bail out before generating bad rtl.  */
    if (arg0 == error_mark_node
        || arg1 == error_mark_node
        || arg2 == error_mark_node)
      return const0_rtx;
  
!   switch (icode)
      {
        /* Only allow 4-bit unsigned literals.  */
-     case CODE_FOR_altivec_vsldoi_4sf:
-     case CODE_FOR_altivec_vsldoi_4si:
-     case CODE_FOR_altivec_vsldoi_8hi:
-     case CODE_FOR_altivec_vsldoi_16qi:
        if (TREE_CODE (arg2) != INTEGER_CST
  	  || TREE_INT_CST_LOW (arg2) & ~0xf)
  	{
  	  error ("argument 3 must be a 4-bit unsigned literal");
  	  return const0_rtx;
  	}
-       break;
-     default:
-       break;
      }
  
    if (target == 0
--- 4368,4395 ----
    enum machine_mode mode1 = insn_data[icode].operand[2].mode;
    enum machine_mode mode2 = insn_data[icode].operand[3].mode;
  
+   if (icode == CODE_FOR_nothing)
+     /* Builtin not supported on this processor.  */
+     return 0;
+ 
    /* If we got invalid arguments bail out before generating bad rtl.  */
    if (arg0 == error_mark_node
        || arg1 == error_mark_node
        || arg2 == error_mark_node)
      return const0_rtx;
  
!   if (icode == CODE_FOR_altivec_vsldoi_4sf
!       || icode == CODE_FOR_altivec_vsldoi_4si
!       || icode == CODE_FOR_altivec_vsldoi_8hi
!       || icode == CODE_FOR_altivec_vsldoi_16qi)
      {
        /* Only allow 4-bit unsigned literals.  */
        if (TREE_CODE (arg2) != INTEGER_CST
  	  || TREE_INT_CST_LOW (arg2) & ~0xf)
  	{
  	  error ("argument 3 must be a 4-bit unsigned literal");
  	  return const0_rtx;
  	}
      }
  
    if (target == 0


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