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 to split x86 movdi


At 10:45 PM -0700 4/10/99, Richard Henderson wrote:
>On Sat, Apr 10, 1999 at 08:21:05PM -0400, John Wehle wrote:
> > + (define_split
> > +   [(set (match_operand:DI 0 "nonimmediate_operand" "")
> > + 	(match_operand:DI 1 "nonimmediate_operand" ""))]
> > +  "reload_completed && ! reg_overlap_mentioned_p (operands[0], 
>operands[1])"
> > +  [(set (match_dup 2)
> > +        (match_dup 4))
> > +   (set (match_dup 3)
> > +        (match_dup 5))]
> > +   "split_di (&operands[0], 1, &operands[2], &operands[3]);
> > +    split_di (&operands[1], 1, &operands[4], &operands[5]);")
>
>We should be able to trivially handle overlapped register
>pairs as well, no?
>
>
>r~

My solution for a similar split.... (a21k_subword() handles the
SHARC's post-increment addressing, or it calls operand_subword())


(define_split
 [(set (match_operand:DI 0 "general_operand" "")
       (match_operand:DI 1 "general_operand" ""))]

 "reload_completed && GET_CODE (operands[1]) != CALL"

 [(set (match_dup 4) (match_dup 2))
  (set (match_dup 5) (match_dup 3)) ]

 "{
    extern rtx a21k_subword (rtx, int, int, enum machine_mode);

    if (operands[1] == const0_rtx || operands[1] == CONST0_RTX (DImode)) {
      operands[2] = operands[3] = operands[1];
    } else {
     operands[2] = a21k_subword (operands[1], 0, 0, DImode);
     operands[3] = a21k_subword (operands[1], 1, 0, DImode);
    }

    operands[4] = a21k_subword (operands[0], 0, 0, DImode);
    operands[5] = a21k_subword (operands[0], 1, 0, DImode);

   /* Because we could be splitting something like
    *   (set (reg:DI r1)(reg:DI r0))
    * we have to check for overlaps
    */
   if ( rtx_equal_p (operands[4], operands[3]))
     {
      rtx t = operands[4];
      operands[4] = operands[5];
      operands[5] = t;

      t = operands[2];
      operands[2] = operands[3];
      operands[3] = t;
     }

  }
 "
)

------------------------------------------------------------------------

		    Quality Software Management
		http://www.tiac.net/users/lehotsky
			lehotsky@tiac.net
			(978)287-0435 Voice
			(978)287-0436 Fax/Data

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation


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