On Mon, Jan 27, 2014 at 11:09 AM, Kirill Yukhin <kirill.yuk...@gmail.com> wrote:

>> > (define_expand "avx512pf_scatterpf<mode>df"
>> >   [(unspec
>> >      [(match_operand:<avx512fmaskmode> 0 "register_or_constm1_operand")
>> >       (mem:DF
>> >        (match_par_dup 5
>> >          [(match_operand 2 "vsib_address_operand")
>> >           (match_operand:VI4_256_8_512 1 "register_operand")
>> >           (match_operand:SI 3 "const1248_operand")]))
>> >       (match_operand:SI 4 "const_0_to_1_operand")]
>> >      UNSPEC_SCATTER_PREFETCH)]
>> >
>> > We have this correspondence between, say, main and index modes:
>> >   SF -> (V16SI, V8DI)
>> >   DF -> (V8SI , V8DI)
>>
>> It looks to me that you should use V16SF and V8DF instead of SF and DF
>> modes here.
> I didn't find existing attributes with necessary mapping, so I invented new.
>
>> Other than this, the patch looks OK to me. Please wait a day if Jakub
>> has any remark here.
>
> Patch in the bottom and I'll check it in this evening (MS time) if no 
> objections.
> (will update ChangeLog adding new mode attributes)
>
> --
> Thanks, K
>
>  gcc/config/i386/avx512pfintrin.h                   | 113 +++++++++++--
>  gcc/config/i386/i386-builtin-types.def             |   2 +
>  gcc/config/i386/i386.c                             |  37 ++++-
>  gcc/config/i386/sse.md                             | 176 
> +++++++++++++++++++--
>  gcc/testsuite/gcc.target/i386/avx-1.c              |   4 +
>  .../gcc.target/i386/avx512pf-vgatherpf0dpd-1.c     |  15 ++
>  .../gcc.target/i386/avx512pf-vgatherpf0qpd-1.c     |  15 ++
>  .../gcc.target/i386/avx512pf-vgatherpf1dpd-1.c     |  15 ++
>  .../gcc.target/i386/avx512pf-vgatherpf1qpd-1.c     |  15 ++
>  .../gcc.target/i386/avx512pf-vscatterpf0dpd-1.c    |  17 ++
>  .../gcc.target/i386/avx512pf-vscatterpf0qpd-1.c    |  17 ++
>  .../gcc.target/i386/avx512pf-vscatterpf1dpd-1.c    |  17 ++
>  .../gcc.target/i386/avx512pf-vscatterpf1qpd-1.c    |  17 ++
>  gcc/testsuite/gcc.target/i386/sse-14.c             |   4 +
>  gcc/testsuite/gcc.target/i386/sse-22.c             |   5 +
>  gcc/testsuite/gcc.target/i386/sse-23.c             |   4 +
>  16 files changed, 442 insertions(+), 31 deletions(-)

> -(define_expand "avx512pf_gatherpf<mode>"
> +;; Packed float variants
> +(define_mode_attr GATHER_SCATTER_SF_MEM_MODE
> +                     [(V8DI "V8SF") (V16SI "V16SF")])
> +(define_mode_attr GATHER_SCATTER_DF_MEM_MODE
> +                     [(V8DI "V8DF") (V8SI "V8DF")])

You actually don't need this attribute, since it always declares V8DF.
Just use V8DF mode in the patterns instead.

(no need to repost the patch due to this trivial removal).

Uros.

Reply via email to