This is the mail archive of the gcc@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: How to clean up i386 machine description?



  In message <13903.43029.876619.202723@ongaonga.elec.canterbury.ac.nz>you writ
e:
  > Hmmm, this looks like a pattern explosion!  I haven't been following
  > this thread too closely so I might have the wrong end of the stick.
  > I gather you're wanting to tighten up the operand predicates for the
  > x86 and are having trouble with the weird combination of valid
  > operands.  
Having additional pattern is not necessarily bad.  Particularly when those
patterns have simple and well understood purposes.

For example, take a look at how we've rearranged the extensions from SImode to
DImode in the x86 port.  We've got several new patterns/splitters, but I
believe the resulting code is actually *easier* to understand than the old
code.  And it generates more efficient code.

  > If this is the case, what I suggest you do is to use the extra
  > condition field of the patterns to reject invalid combinations of the
  > operands.  I did this with the C4x target where I wanted to minimise
  > the amount of reloading.  On the x86 you'll probably find that the
  > predicates match almost anything but that there are limited
  > combinations of valid operands.
We do that in some cases too.  We use a combination of tighter predicates and
conditions.

Note that you have to be careful about using conditions in named patterns that
the tree->rtl converter knows about.  Conditions on those patterns can only
check TARGET_XXX stuff, they can not be dependent on the operands.  Easy tidbit
to forget.

jeff


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