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: "Parallel" mode iterators


2014-08-21 11:39 GMT+04:00 Dominik Vogt <vogt@linux.vnet.ibm.com>:
> One can define mode iterators for
>
>   (define_mode_iterator ITER1 [DI SI HI])
>   (define_mode_iterator ITER2 [SI HI QI])
>
> Is it possible to write something like this:
>
>   (define_insn "foo<mode>"
>     [(set (match_operand:ITER1 0 ...)
>      ...
>             [(match_operand:ITER1 1 ...)
>              (match_operand:ITER2 2 ...)]
>      ...
>
> so that the pattern is copied only for the combinations DI-SI,
> SI-HI and HI-QI, not for all nine combinations of the two
> iterators?  (Or is there another way to get mode of the second
> argument depending on the first argument?)

Look at ssehalfvecmode in i386/sse.md:

(define_mode_attr ssehalfvecmode
  [(V64QI "V32QI") (V32HI "V16HI") (V16SI "V8SI") (V8DI "V4DI")
   (V32QI "V16QI") (V16HI  "V8HI") (V8SI  "V4SI") (V4DI "V2DI")
   (V16QI  "V8QI") (V8HI   "V4HI") (V4SI  "V2SI")
   (V16SF "V8SF") (V8DF "V4DF")
   (V8SF  "V4SF") (V4DF "V2DF")
   (V4SF  "V2SF")])

(define_expand "avx_vextractf128<mode>"
  [(match_operand:<ssehalfvecmode> 0 "nonimmediate_operand")
   (match_operand:V_256 1 "register_operand")
   (match_operand:SI 2 "const_0_to_1_operand")]

  -- Ilya


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