This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: PATCH: Darwin specific 1-liners (1)




On Wed, 5 Dec 2001, David Edelsohn wrote:

> >>>>> Stan Shebs writes:
>
> Stan> I don't think you should fault Dale too much for being careful.
> Stan> The usual situation is that somebody puts a patch into generic code,
> Stan> and it crumbles performance everywhere except on the one platform
> Stan> that was tested.  This particular patch is based on empirical results,
> Stan> and given the vagaries of PowerPC family members, ABIs, etc, it's
> Stan> often not the case that a win for one combination is a win for all.
>
> Stan> If you or Geoff are willing to make the claim that this will win for
> Stan> all cases, then we'll happily make the code generic, but we have
> Stan> neither the equipment nor the time to do empirical measurements
> Stan> across the range of PowerPC targets, and so it seems better to me
> Stan> not to claim an improvement that we can't back up with numbers.
>
> 	I am not faulting Dale for being cautious.  I am saying that if
> this patch is not ABI-specific, the submitter should explore the broader
> benefit.  "darwin.h" does not seem like the right place for a performance
> patch or a patch testing HARD_REGNO_RENAME_OK.
>
> 	I cannot find any documentation for the macro (which obviously is
> *NOT* Dale's fault).  Dale did not include any background about what type
> of code would try to use LR for a tablejump.  Furthermore, rs6000.md lists
> CTR first in tablejump matchers, so it should be preferred over LR.
>
> 	All recent PowerPC processors have LR stacks, so avoiding LR for
> anything except returning from calls is good.
Yup. The optimization guide for the 7450 says:
"In general, the CTR should be used for computed target addresses and the
LR should be used only for
call/return addresses. If using the CTR for a loop conflicts with a
computed goto, the computed goto should
be used and the loop should be converted to a GPR form.
Note that the PowerPC Compiler Writer's Guide (Section 3.1.3.3) suggests
using either CTR or LR for a
computed branch, and suggests that using the LR is acceptable when the CTR
is used for a loop. This
suggestion is inappropriate for the MPC7450. For the MPC7400, the rules
given in the preceding paragraphs
should be followed."


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