Any idea why some 32bits architectures return in register value larger than the register ?

William Tambe tambewilliam@gmail.com
Tue Apr 2 20:45:00 GMT 2019


is that still ok even when TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE
and TARGET_FUNCTION_VALUE_REGNO_P are defined for a single register
that can only hold a single-word object ? ie:

https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/moxie/moxie.c#L75
https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/moxie/moxie.c#L86
https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/moxie/moxie.c#L94

On Tue, Apr 2, 2019 at 3:37 PM Jeff Law <law@redhat.com> wrote:
>
> On 4/2/19 2:30 PM, William Tambe wrote:
> > When looking at backends for moxie and ft32, which are cpus for which
> > the return register is 32bits, TARGET_ RETURN_IN_MEMORY is implemented
> > such that the function value is returned in a register even when its
> > size is 64bits. ie:
> >
> > https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/ft32/ft32.c#L63
> >
> > https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/moxie/moxie.c#L60
> >
> > Any idea why it is implemented that way ?
> >
> Could be that's how the ABI is defined.  It's often the case that ABI's
> define double-word objects as being passed and returned in register
> pairs for efficiency.
>
> jeff



More information about the Gcc-help mailing list