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: i386.md splits (hope final version)



  In message <19981007155434.22113@atrey.karlin.mff.cuni.cz>you write:
  > Hi
  > 
  > I've found bug in my code causing crash when sign_extend to memory was
  > called with SUBREG parameter (REG_P didn't returned true and memory to
  > memory move was emited). This patch actually fixes it.
(subreg (reg)) will satisfy a "register_operand" predicate and you have to be
prepared to handle it.  REG_P expected to return false when presented with
a SUBREG.

You can use true_regnum or alter_subreg to get at the real register.  And
ironically, we should be seeing fewer (subreg (reg)) expressions after reload.
I'm not sure they are all gone yet, but we are working on it.


  > Also I've browsed crafty code and found that many sign extensions to memory
  > are done. So I've added new split for it that does shift in register, not
  > in memory. It uses clobber, so please look at this part if it is correct.
You may want to simply reject extensions to memory.  That should force the
earlier parts of the compiler to do them in a register, then store the result
into memory, which is what you're doing by hand.

I do not see what you gain by allowing sign extensions with a memory operand
destination.  I believe this is a case where we want the predicate to be more
restrictive.


  > Oct 7 08:58:58 1998  Jan Hubicka <hubicka@freesoft.cz>
  > 
  > 	* i386.md: Change ix86_cpu == PROCESSOR_PENTIUM to TARGET_PENTIUM
  > 	(zero_extendsidi2): split it, support extending from other
  > 	register and to memory to avoid unnecesary moves of extended value
  > 	Use # in pattern and handle completely by splits.
  > 	(extendsidi2): likewise, don't generate cltd at pentium.
  > 	(ashiftrt_32): New pattern
I installed everything except the sign extension changes.

I added another splitter for the zero extension case to handle when the
input and output operand are the same register.  There's no need for the
copy of the low half in that case -- we just need to zero out the top
half.

Thanks,

Teff


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