md description for intruction that modifies multiple operands

Fred Fish fnf@intrinsity.com
Mon May 26 23:54:00 GMT 2003


> (1) The above entry only tells the compiler that the first operand is an output
> operand, so I tried changing it to something like:
> 
> 	(define_insn "block4"
> 	  [(set (match_operand:SI 0 "register_operand" "+d")
> 	        (unspec:SI [(match_operand:SI 1 "register_operand" "+d")
> 	                    (match_operand:SI 2 "register_operand" "+d")
> 	                    (match_operand:SI 3 "register_operand" "+d")] 123))]
> 	  "TARGET_FOO"
> 	  "block4\\t%0 # %0,%1,%2,%3")
> 
> to let it know that all operands are both read/write.  I'm not
> entirely sure this is the correct approach.

That didn't seem to work.  I also tried something like:

	(define_insn "block4"
	  [(set (match_operand:SI 0 "register_operand" "+d")
	        (unspec:SI [(match_operand:SI 1 "register_operand" "+d")
	                    (match_operand:SI 2 "register_operand" "+d")
	                    (match_operand:SI 3 "register_operand" "+d")] 123))
	   (set (match_dup 1) (unspec:SI [(match_dup 0) (match_dup 2) (match_dup 3)] 124))
	   (set (match_dup 2) (unspec:SI [(match_dup 0) (match_dup 1) (match_dup 3)] 125))
	   (set (match_dup 3) (unspec:SI [(match_dup 0) (match_dup 1) (match_dup 2)] 126))]
	  "TARGET_FOO"
	  "block4\\t%0 # %0,%1,%2,%3")

which works a little better, but still seems to have some problems
with the compiler recognizing that every operand is both an input and
output.

Am I totally off track here?

Thanks.

-Fred



More information about the Gcc mailing list