This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: Darwin specific 1-liners (1)
- From: Daniel Berlin <dan at cgsoftware dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Stan Shebs <shebs at apple dot com>, <dalej at apple dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Dec 2001 21:56:40 -0500 (EST)
- Subject: 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 188.8.131.52) 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."