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]

Re: [patch] Optimize movhi in h8300 port


  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

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