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]
Other format: [Raw text]

Re: New insns for the s390 backend (3)


On Wed, Aug 27, 2003 at 04:46:12PM +0200, Andreas Krebbel wrote:
> The additional insn definition is mandatory otherwise combine would never 
> create an AND rtx with such a high constant because s390 doesn't provide an 
> appropriate instruction. Therefore the splitter would never get a chance.

I don't believe you.  Combine discards all clobbers initially,
then adds them back as needed.  The final desired insn and the
faulty pattern differ only in the split.

If the true and insn is so different, then neither the split
nor the insn with the clobber are needed.

> This is true. Omitting the reload_completed constraint would make no 
> difference. It was just included to make it explicit that this splitter is 
> one of the after-reload-kind. Not a good idea?

If it makes no difference, then it *isnt* "one of the after-reload-kind".

> Unfortunately the patterns for AND and llgt differ a lot from each other. 

Boy, they sure don't look any different.

It sure looks like you could define

In CONST_OK_FOR_LETTER_P:
  'M'	VALUE == 2147483647

In EXTRA_CONSTRAINT:
  'A'	s390_single_hi (OP, DImode, -1) >= 0

(define_insn "anddi3"
  [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d")
	(and:DI (match_operand:DI 1 "nonimmediate_operand" "%d,o,0,0,0")
		(match_operand:DI 2 "general_operand" "M,M,A,d,m")))
   (clobber (reg:CC 33))]
  "TARGET_64BIT"
{
  switch (which_alternative)
    {
    case 0:
      return "llgtr\t%0,%1";
    case 1:
      return "llgt\t%0,%N1";
    case 2:
      {
	static const char * const pat[4] = {
	  "nihh\t%0,%x2",
	  "nihl\t%0,%x2",
	  "nilh\t%0,%x2",
	  "nill\t%0,%x2"
	};

	int part = s390_single_hi (operands[2], DImode, -1);
	operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
	return pat[part];
      }
    case 3:
      return "ngr\t%0,%2";
    case 4:
      return "ng\t%0,%2";
    default:
      abort ();
    }
}
  [(set_attr "op_type" "RRE,RXE,RI,RRE,RXY")])

Further refinements would be to use something more precise than
general_operand for operand 2.


r~


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