vector operations and scalar operands

Jan Hubicka jh@suse.cz
Sun Feb 9 14:46:00 GMT 2003


Hi,
the pattern:
  [(set (match_operand:V4HI 0 "register_operand" "=y")
        (ashiftrt:V4HI (match_operand:V4HI 1 "register_operand" "0")
		       (match_operand:DI 2 "nonmemory_operand" "yi")))]
won't get simplified by my code as it expect vectors in all operands.
Some other places of i386.md does this with vectors:

(define_insn "mmx_uavgv4hi3"
  [(set (match_operand:V4HI 0 "register_operand" "=y")
        (ashiftrt:V4HI
	 (plus:V4HI (plus:V4HI
		     (match_operand:V4HI 1 "register_operand" "0")
		     (match_operand:V4HI 2 "nonimmediate_operand" "ym"))
		    (const_vector:V4HI [(const_int 1)
					(const_int 1)
					(const_int 1)
					(const_int 1)]))
	 (const_int 1)))]

So the question is whether we want to allow scalar operand for shift or
whether I should add vec_duplicate expressions to the patterns.
The second would lead to pretty wide modes - up to V16TI.  Would this
hurt something?

Honza



More information about the Gcc mailing list