Re: [rfa] Add e500 function call support to PPC

Kevin Buettner
2003-03-09T01:00:14Z

On Mar 8, 2:11pm, Andrew Cagney wrote:

> This adds support for the e500's function call convention to the PPC
> (ppc-sysv-tdep.c to be exact).
>
> The e500 passes everything in GPRs (which are extended to 64 bits).
>
[...]
> - if (TYPE_CODE (type) == TYPE_CODE_FLT)
> + if (TYPE_CODE (type) == TYPE_CODE_FLT
> + && arch_info->mach != bfd_mach_ppc_e500)

This construct bothers me. If it occurred only once, it might not
bother me so much, but (arch_info->mach != bfd_mach_ppc_e500) appears
far too often in the code for me to be comfortable with it. Suppose
we have another core with a similar property (of passing everything
in GPRs). If this happens, we'll end up with a proliferation of
additional checks for all of these different cores and things will
become quite unreadable. Please introduce a predicate into which
we can put this test and perhaps others as they arise. Then, only
the predicate will need to be modified.

Kevin