This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: SH-ELF: SFmode calling convention bug with -m4/-m4-single-only -ml
- To: tm at kloo dot net (tm)
- Subject: Re: SH-ELF: SFmode calling convention bug with -m4/-m4-single-only -ml
- From: Joern Rennecke <amylaar at onetel dot net dot uk>
- Date: Thu, 1 Nov 2001 01:51:25 +0000 (GMT)
- Cc: gcc-bugs at gcc dot gnu dot org, amylaar at onetel dot net dot uk, aoliva at redhat dot com
> The culprit appears to be the FUNCTION_ARG macro in gcc/config/sh/sh.h.
> It flips the least significant bit of the regno to which the parameter
> is assigned if the options are -m4/-m4-single and -ml.
This bit flipping is necessary because DFmode values are always big endian
in registers, but in little endian mode they are little endian in memory.
So when a varargs function stores the floating point registers, it stores
fr5 first in memory, then fr4, then fr7, then fr6 etc.
If you wanted to use the fp registers in numerical order for SFmode in
little endian mode, you'd need larger and slower code in the va_arg
processing.
--
Joern Rennecke | gcc expert for hire
amylaar@onetel.net.uk | send enquiries to: jwr_jobs@onetel.net.uk