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

Re: how can I write a right V32QI Unpack Low Data insn pattern?


On Thu, Mar 3, 2011 at 11:09 AM, Ian Lance Taylor <iant@google.com> wrote:
> Liu <proljc@gmail.com> writes:
>
>>> It's a bit odd to have more than 26 elements. ?Do you have any
>>> incredibly large define_insn patterns?
>>>
>> Yes, I have some 80 lines define_insn patterns, are they incredibly large?
>
> An 80 line pattern is incredibly large, yes. ?The size of the overall
> define_insn doesn't matter, just the size of the pattern.
>
>> I try your patch, but it get the same error still.
>
> Bother. ?Are you sure that genrecog ran again? ?Can you send us an
> example of a very large define_insn pattern?
>
> Ian
>

I'm not sure about "the size of the pattern", I think it is the
"const_int" numbers.

This is a HADD insn-pattern :
(define_insn "xx_vphaddv16hi"
  [(set (match_operand:V16HI 0 "register_operand" "=Z")
      (vec_concat:V16HI
	(vec_concat:V8HI
	  (vec_concat:V4HI
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI
		  (match_operand:V16HI 1 "register_operand" "Z")
		  (parallel [(const_int 0)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 2)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 3)]))))
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 4)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 5)])))
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 6)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 7)])))))
	  (vec_concat:V4HI
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 8)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 9)])))
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 10)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 11)]))))
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 12)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 13)])))
	      (plus:HI
		(vec_select:HI (match_dup 1) (parallel [(const_int 14)]))
		(vec_select:HI (match_dup 1) (parallel [(const_int 15)]))))))
	(vec_concat:V8HI
	  (vec_concat:V4HI
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI
		  (match_operand:V16HI 2 "register_operand" "Z")
		  (parallel [(const_int 0)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 1)])))
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 2)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 4)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 5)])))
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 6)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))
	  (vec_concat:V4HI
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 8)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 9)])))
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 10)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 11)]))))
	    (vec_concat:V2HI
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 12)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 13)])))
	      (plus:HI
		(vec_select:HI (match_dup 2) (parallel [(const_int 14)]))
		(vec_select:HI (match_dup 2) (parallel [(const_int 15)]))))))))]
  "TARGET_XX_VECTORS"
  "vphaddh\t%0,%1,%2"
  [(set_attr "type" "vadd")])

and this is a MADD insn-pattern :
(define_insn "xx_vpmaddubsh"
  [(set (match_operand:V16HI 0 "register_operand" "=Z")
	(ss_plus:V16HI
	  (mult:V16HI
	    (zero_extend:V16HI
	      (vec_select:V8QI
		(match_operand:V32QI 1 "register_operand" "Z")
		(parallel [(const_int 0)
			   (const_int 2)
			   (const_int 4)
			   (const_int 6)
			   (const_int 8)
			   (const_int 10)
			   (const_int 12)
			   (const_int 14)
			   (const_int 16)
			   (const_int 18)
			   (const_int 20)
			   (const_int 22)
			   (const_int 24)
			   (const_int 26)
			   (const_int 28)
			   (const_int 30)])))
	    (sign_extend:V16HI
	      (vec_select:V16QI
		(match_operand:V32QI 2 "nonimmediate_operand" "Z")
		(parallel [(const_int 0)
			   (const_int 2)
			   (const_int 4)
			   (const_int 6)
			   (const_int 8)
			   (const_int 10)
			   (const_int 12)
			   (const_int 14)
			   (const_int 16)
			   (const_int 18)
			   (const_int 20)
			   (const_int 22)
			   (const_int 24)
			   (const_int 26)
			   (const_int 28)
			   (const_int 30)]))))
	  (mult:V16HI
	    (zero_extend:V16HI
	      (vec_select:V32QI (match_dup 1)
		(parallel [(const_int 1)
			   (const_int 3)
			   (const_int 5)
			   (const_int 7)
			   (const_int 9)
			   (const_int 11)
			   (const_int 13)
			   (const_int 15)
			   (const_int 17)
			   (const_int 19)
			   (const_int 21)
			   (const_int 23)
			   (const_int 25)
			   (const_int 27)
			   (const_int 29)
			   (const_int 31)])))
	    (sign_extend:V16HI
	      (vec_select:V32QI (match_dup 2)
		(parallel [(const_int 1)
			   (const_int 3)
			   (const_int 5)
			   (const_int 7)
			   (const_int 9)
			   (const_int 11)
			   (const_int 13)
			   (const_int 15)
			   (const_int 17)
			   (const_int 19)
			   (const_int 21)
			   (const_int 23)
			   (const_int 25)
			   (const_int 27)
			   (const_int 29)
			   (const_int 31)]))))))]
  "TARGET_XX_VECTORS"
  "vpmaddubsh\t%0,%1,%2"
  [(set_attr "type" "vmin")])

Thank you, Ian.


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