This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] h8300.md: Optimize one case of zero_extract.
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Mar 2003 14:30:41 -0500 (EST)
- Subject: Re: [patch] h8300.md: Optimize one case of zero_extract.
On Mon, 3 Mar 2003, Kazu Hirata wrote:
> > ..._operand:SI 0 "r,r"
> > ..._operand:SI 1 "?0,r"
> > ...
> > "@
> > same
> > different"
> >
> > Shorter than C and IMHO less error-prone. The "?" is to make
> > GCC penalize that alternative a bit (not prefer it over the
> > other case due to the order), since the same-register
> > alternative IIUC would be more costly in this particular case.
>
> Thanks. I've been wondering if there is a conveninent way to do this.
> If I get "which_alternative == 1", does that guarantee that two
> registers are different? I know that they would be without '?', but I
> just don't know what happens with '?'.
The same thing; the '?' just affects GCC:s preference when
generating, combining and reloading insns. If you omit it, it
will just lead to the first alternative being *generated* more
often (well, modulo bugs); it will not lead to that alternative
being recognized differently. It's all in the manual IIRC.
brgds, H-P