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: Using shifts by 1 on K6,K7 and i386



  In message <006c01bfe813$524c0680$3595f9c3@mincomputer>you write:
  > > Actaully, if any change is made, it should be of the form
  > > `TARGET_USE_SHIFT1', much like the existing TARGET_USE_LEAVE
  > > and friends.
Richard is correct here.

  > I have looked at the 486 manual, and it is not that simple. Shifts by one
  > are slower only when using register operands on the 486. This means that
  > the ideally the predicate should be something like this
  > 
  > (!(TARGET_I486 && register_operand(operands[0],SImode)) || optimize_size)
  > 
  > I'm not sure what the second operand to memory_operand does and if it is 
  > necessary, but I would need at least one operand to a TARGET_USE_SHIFT1
  > macro.
The second operand to "register_operand" is the mode of the operand.  In this
case it should be the mode of the value that you want to shift.

Instead of using SImode, just use GET_MODE (operands[0]) for the second
argument.

Yes, you'll need to make the TARGET_USE_SHIFT1 change like Richard suggested
too -- and if you need an argument, that's not a problem either.  There's no
reason that the new TARGET_USE_SHIFT1 couldn't accept an argument that I'm
aware of.


jeff


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