diff options
| author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-22 01:21:10 +0000 |
|---|---|---|
| committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-22 01:21:10 +0000 |
| commit | 235d035184b552f2e400cf661626a82c19c69759 (patch) | |
| tree | a6d16d3d62f6ce5c0e1b2e8553d4ac71683cc106 | |
| parent | a1f89588023a18459a0d7a2f2a354cd7cd24d010 (diff) | |
| download | ppe42-gcc-235d035184b552f2e400cf661626a82c19c69759.tar.gz ppe42-gcc-235d035184b552f2e400cf661626a82c19c69759.zip | |
PR target/17836
* config/rs6000/rs6000.c (rs6000_return_in_memory): Return
synthetic vectors in memory.
(function_arg_boundary): Align large synthetic vectors.
(rs6000_pass_by_reference): Pass synthetic vectors in memory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90995 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/config/rs6000/rs6000.c | 42 |
2 files changed, 48 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c8f32e703b..e50939b69b6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-11-21 David Edelsohn <edelsohn@gnu.org> + + PR target/17836 + * config/rs6000/rs6000.c (rs6000_return_in_memory): Return + synthetic vectors in memory. + (function_arg_boundary): Align large synthetic vectors. + (rs6000_pass_by_reference): Pass synthetic vectors in memory. + 2004-11-21 Jeff Law <law@redhat.com> * cfg.c (update_bb_profile_for_threading): Do not rescale the diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7bf65545d8b..2d4e6186c5c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4640,6 +4640,21 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) && (TARGET_AIX_STRUCT_RET || (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8)) return true; + + /* Return synthetic vectors in memory. */ + if (TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) > (TARGET_ALTIVEC ? 16 : 8)) + { + static bool warned_for_return_big_vectors = false; + if (!warned_for_return_big_vectors) + { + warning ("synthetic vectors returned by reference: " + "non-standard ABI extension with no compatibility guarantee"); + warned_for_return_big_vectors = true; + } + return true; + } + if (DEFAULT_ABI == ABI_V4 && TYPE_MODE (type) == TFmode) return true; return false; @@ -4783,10 +4798,13 @@ function_arg_padding (enum machine_mode mode, tree type) of an argument with the specified mode and type. If it is not defined, PARM_BOUNDARY is used for all arguments. - V.4 wants long longs to be double word aligned. */ + V.4 wants long longs to be double word aligned. + Doubleword align SPE vectors. + Quadword align Altivec vectors. + Quadword align large synthetic vector types. */ int -function_arg_boundary (enum machine_mode mode, tree type ATTRIBUTE_UNUSED) +function_arg_boundary (enum machine_mode mode, tree type) { if (DEFAULT_ABI == ABI_V4 && GET_MODE_SIZE (mode) == 8) return 64; @@ -4794,6 +4812,9 @@ function_arg_boundary (enum machine_mode mode, tree type ATTRIBUTE_UNUSED) return 64; else if (ALTIVEC_VECTOR_MODE (mode)) return 128; + else if (type && TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) > 16) + return 128; else return PARM_BOUNDARY; } @@ -5617,6 +5638,23 @@ rs6000_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, return 1; } + + /* Pass synthetic vectors in memory. */ + if (type && TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) > (TARGET_ALTIVEC ? 16 : 8)) + { + static bool warned_for_pass_big_vectors = false; + if (TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_pass_by_reference: synthetic vector\n"); + if (!warned_for_pass_big_vectors) + { + warning ("synthetic vector passed by reference: " + "non-standard ABI extension with no compatibility guarantee"); + warned_for_pass_big_vectors = true; + } + return 1; + } + return 0; } |

