aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2002-05-20 02:31:24 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2002-05-20 02:31:24 +0000
commit16861f33d261b486cf6713c4da46bc35b6d2058b (patch)
treee6390ec5fda5a72c7e3f96c49244630019fc64c1 /gcc
parent23459e152d4a0d5d945b427a7c7601e35dac653e (diff)
downloadgcc-16861f33d261b486cf6713c4da46bc35b6d2058b.zip
gcc-16861f33d261b486cf6713c4da46bc35b6d2058b.tar.gz
gcc-16861f33d261b486cf6713c4da46bc35b6d2058b.tar.bz2
rs6000.h (FUNCTION_VALUE): Only return vectors in an altivec register if TARGET_ALTIVEC.
2002-05-19 Aldy Hernandez <aldyh@redhat.com> * config/rs6000/rs6000.h (FUNCTION_VALUE): Only return vectors in an altivec register if TARGET_ALTIVEC. * config/rs600/rs6000.c (rs6000_emit_move): Change VECTOR_MODE_P to ALTIVEC_VECTOR_MODE. (rs6000_va_arg): Only vectors of type AltiVec are 16 byte aligned. (rs6000_va_arg): Vectors may go in registers if they are not altivec vectors. From-SVN: r53645
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/rs6000/rs6000.c13
-rw-r--r--gcc/config/rs6000/rs6000.h3
3 files changed, 20 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1ec26fe..bf0d2b7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2002-05-19 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/rs6000.h (FUNCTION_VALUE): Only return vectors in
+ an altivec register if TARGET_ALTIVEC.
+
+ * config/rs600/rs6000.c (rs6000_emit_move): Change VECTOR_MODE_P
+ to ALTIVEC_VECTOR_MODE.
+ (rs6000_va_arg): Only vectors of type AltiVec are 16 byte aligned.
+ (rs6000_va_arg): Vectors may go in registers if they are not
+ altivec vectors.
+
2002-05-19 Kazu Hirata <kazu@cs.umass.edu>
* protoize.c: Fix formatting.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 1a65a77..071e400 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -2315,7 +2315,7 @@ rs6000_emit_move (dest, source, mode)
/* Handle the case where reload calls us with an invalid address;
and the case of CONSTANT_P_RTX. */
- if (!VECTOR_MODE_P (mode)
+ if (!ALTIVEC_VECTOR_MODE (mode)
&& (! general_operand (operands[1], mode)
|| ! nonimmediate_operand (operands[0], mode)
|| GET_CODE (operands[1]) == CONSTANT_P_RTX))
@@ -3225,8 +3225,8 @@ rs6000_va_arg (valist, type)
lab_over = gen_label_rtx ();
addr_rtx = gen_reg_rtx (Pmode);
- /* Vectors never go in registers. */
- if (TREE_CODE (type) != VECTOR_TYPE)
+ /* AltiVec vectors never go in registers. */
+ if (!TARGET_ALTIVEC || TREE_CODE (type) != VECTOR_TYPE)
{
TREE_THIS_VOLATILE (reg) = 1;
emit_cmp_and_jump_insns
@@ -3280,7 +3280,8 @@ rs6000_va_arg (valist, type)
All AltiVec vectors go in the overflow area. So in the AltiVec
case we need to get the vectors from the overflow area, but
remember where the GPRs and FPRs are. */
- if (n_reg > 1 && TREE_CODE (type) != VECTOR_TYPE)
+ if (n_reg > 1 && (TREE_CODE (type) != VECTOR_TYPE
+ || !TARGET_ALTIVEC))
{
t = build (MODIFY_EXPR, TREE_TYPE (reg), reg, build_int_2 (8, 0));
TREE_SIDE_EFFECTS (t) = 1;
@@ -3294,8 +3295,8 @@ rs6000_va_arg (valist, type)
{
int align;
- /* Vectors are 16 byte aligned. */
- if (TREE_CODE (type) == VECTOR_TYPE)
+ /* AltiVec vectors are 16 byte aligned. */
+ if (TARGET_ALTIVEC && TREE_CODE (type) == VECTOR_TYPE)
align = 15;
else
align = 7;
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index fa47a97..4e9edff 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1460,7 +1460,8 @@ typedef struct rs6000_stack {
&& TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \
|| POINTER_TYPE_P (VALTYPE) \
? word_mode : TYPE_MODE (VALTYPE), \
- TREE_CODE (VALTYPE) == VECTOR_TYPE ? ALTIVEC_ARG_RETURN \
+ TREE_CODE (VALTYPE) == VECTOR_TYPE \
+ && TARGET_ALTIVEC ? ALTIVEC_ARG_RETURN \
: TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT \
? FP_ARG_RETURN : GP_ARG_RETURN)