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]

rs6000 patch 4 of 4 (altivec)


Fixes target/14960.  The rs6000.c patch is the same as Hartmut's.  The
extra changes in rs6000.h are so that Altivec registers are not treated
specially if they won't be used to pass/return vectors.

	* config/rs6000/rs6000.c (rs6000_function_value): Test
	TARGET_ALTIVEC and TARGET_ALTIVEC_ABI.
	(rs6000_libcall_value): Likewise.
	* config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Likewise.
	(FUNCTION_ARG_REGNO_P): Likewise.

Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.629
diff -u -p -r1.629 rs6000.c
--- gcc/config/rs6000/rs6000.c	22 Apr 2004 02:02:13 -0000	1.629
+++ gcc/config/rs6000/rs6000.c	23 Apr 2004 08:24:40 -0000
@@ -16218,7 +16216,8 @@ rs6000_function_value (tree valtype, tre
 	   && TARGET_HARD_FLOAT
 	   && targetm.calls.split_complex_arg)
     return rs6000_complex_function_value (mode);
-  else if (TREE_CODE (valtype) == VECTOR_TYPE && TARGET_ALTIVEC)
+  else if (TREE_CODE (valtype) == VECTOR_TYPE
+	   && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI)
     regno = ALTIVEC_ARG_RETURN;
   else
     regno = GP_ARG_RETURN;
@@ -16236,7 +16235,8 @@ rs6000_libcall_value (enum machine_mode 
   if (GET_MODE_CLASS (mode) == MODE_FLOAT
 	   && TARGET_HARD_FLOAT && TARGET_FPRS)
     regno = FP_ARG_RETURN;
-  else if (ALTIVEC_VECTOR_MODE (mode))
+  else if (ALTIVEC_VECTOR_MODE (mode)
+	   && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI)
     regno = ALTIVEC_ARG_RETURN;
   else if (COMPLEX_MODE_P (mode) && targetm.calls.split_complex_arg)
     return rs6000_complex_function_value (mode);
Index: gcc/config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.319
diff -u -p -r1.319 rs6000.h
--- gcc/config/rs6000/rs6000.h	25 Mar 2004 17:43:20 -0000	1.319
+++ gcc/config/rs6000/rs6000.h	23 Apr 2004 08:24:40 -0000
@@ -1696,7 +1696,7 @@ extern enum rs6000_abi rs6000_current_ab
 #define FUNCTION_VALUE_REGNO_P(N)					\
   ((N) == GP_ARG_RETURN							\
    || ((N) == FP_ARG_RETURN && TARGET_HARD_FLOAT)			\
-   || ((N) == ALTIVEC_ARG_RETURN && TARGET_ALTIVEC))
+   || ((N) == ALTIVEC_ARG_RETURN && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI))
 
 /* 1 if N is a possible register number for function argument passing.
    On RS/6000, these are r3-r10 and fp1-fp13.
@@ -1704,7 +1704,7 @@ extern enum rs6000_abi rs6000_current_ab
 #define FUNCTION_ARG_REGNO_P(N)						\
   ((unsigned) (N) - GP_ARG_MIN_REG < GP_ARG_NUM_REG			\
    || ((unsigned) (N) - ALTIVEC_ARG_MIN_REG < ALTIVEC_ARG_NUM_REG	\
-       && TARGET_ALTIVEC)						\
+       && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI)				\
    || ((unsigned) (N) - FP_ARG_MIN_REG < FP_ARG_NUM_REG			\
        && TARGET_HARD_FLOAT))
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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