This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Such as:


	if (.....
	   && tdep->ppc_fp0_regnum >= 0)

?
Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]