aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2004-02-19 21:39:52 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-02-19 21:39:52 +0000
commitf9c887ac068686a6b368ad3c1432ad8ba1d0b201 (patch)
tree6257c7da371e70ad796e23e3e77f3987f0b78fe3 /gcc/config
parent0e1d7f3250b8a658688453eeb5f206d0f9e6d2a2 (diff)
downloadgcc-f9c887ac068686a6b368ad3c1432ad8ba1d0b201.zip
gcc-f9c887ac068686a6b368ad3c1432ad8ba1d0b201.tar.gz
gcc-f9c887ac068686a6b368ad3c1432ad8ba1d0b201.tar.bz2
ia64.c (ia64_function_arg): In big-endian mode...
* config/ia64/ia64.c (ia64_function_arg): In big-endian mode, when passing single SFmode quantities in general registers, put them in the high half. From-SVN: r78119
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/ia64/ia64.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index f7e5cc3..b790819 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -3786,21 +3786,34 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
named, and in a GR register when unnamed. */
else if (cum->prototype)
{
- if (! named)
- return gen_rtx_REG (mode, basereg + cum->words + offset);
- else
+ if (named)
return gen_rtx_REG (mode, FR_ARG_FIRST + cum->fp_regs);
+ /* In big-endian mode, an anonymous SFmode value must be represented
+ as (parallel:SF [(expr_list (reg:DI n) (const_int 0))]) to force
+ the value into the high half of the general register. */
+ else if (BYTES_BIG_ENDIAN && mode == SFmode)
+ return gen_rtx_PARALLEL (mode,
+ gen_rtvec (1,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (DImode, basereg + cum->words + offset),
+ const0_rtx)));
+ else
+ return gen_rtx_REG (mode, basereg + cum->words + offset);
}
/* If there is no prototype, then FP values go in both FR and GR
registers. */
else
{
+ /* See comment above. */
+ enum machine_mode inner_mode =
+ (BYTES_BIG_ENDIAN && mode == SFmode) ? DImode : mode;
+
rtx fp_reg = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (mode, (FR_ARG_FIRST
+ cum->fp_regs)),
const0_rtx);
rtx gr_reg = gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (mode,
+ gen_rtx_REG (inner_mode,
(basereg + cum->words
+ offset)),
const0_rtx);