This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Optimize movhi in h8300 port
- To: Kazu Hirata <kazu at hxi dot com>
- Subject: Re: [patch] Optimize movhi in h8300 port
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 11 Oct 2000 16:34:23 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <200010081402.HAA19881@cygnus.com>you write:
> Hi,
>
> Attached is a patch to optimize movhi in h8300 port when REG_WAS_0 is
> found.
Ugh. I really don't like REG_WAS_0 notes and using them to drive
optimizations, particularly in the backend.
> Now, "mov.w" in H8 takes 4 bytes. However, if the destination
> register is guranteed to be 0, and either the upper or lower half of
> the source is 0, then we can change this to a byte move.
Or one could write this in a generic way and have it controlled by
the cost of the various ways to load up the constant.
> Also, if a constant to be loaded is a small negative number (-1, -2,
> and -4), then we can optimize and use "subs". Even though this is a
> 4-byte operation, this is OK because we never use upper 16-bit and
> lower 16-bit of a register separately.
Err, see reload_cse_move2add which should do basically the same thing.
jeff