On Tue, Feb 25, 2014 at 5:04 PM, Ilya Tocar <tocarip.in...@gmail.com> wrote:

>> > Latest version of AVX512 spec
>> > http://download-software.intel.com/sites/default/files/managed/50/1a/319433-018.pdf
>> > Has a few changes.
>
>> > 2)Currently for scatter/gather prefetches intrinsics we accept 1 as
>> > possible hint parameter. This is consistent with ICC. However as
>> > GCC defines _MM_HINT_T0 to 3 and not to 1 as ICC
>> > (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56603), gather prefethces
>> > are inconsistent with normal prefetches as they won't accept _MM_HINT_T0 as
>> > hint. We can either change gather prefetches to accept 1 instead of 3 and
>> > hope that everyone will use _MM_HINT_T0 and not the raw value, or we can
>> > change _MM_HINT_T0 to be consistent with ICC. What solution do you
>> > prefer?
>>
>> Builtins, including __builtin_prefetch, are considered as internal
>> implementation detail, so we can pass to them wharever we like. The
>> published interface is in *.h files, and this includes _MM_HINT_T0.
>> For now, I suggest to change prefetches, so they will accept
>> _MM_HINT_T0, as this is the least invasive change.
>>
> Patch bellow changes prefetches to accept 3 (_MM_HINT_T0),
> and replaces all hint's values in tests with corresponding _MM_HINT.
> Testing passes. Ok for trunk?
>
> ChangeLog:
>
> 2014-02-25  Ilya Tocar  <ilya.to...@intel.com>
>
>         * common/config/i386/predicates.md (const1256_operand): Remove.
>         (const2356_operand): New.
>         (const_1_to_2_operand): Remove.
>         * config/i386/sse.md (avx512pf_gatherpf<mode>sf): Change hint value.
>         (*avx512pf_gatherpf<mode>sf_mask): Ditto.
>         (*avx512pf_gatherpf<mode>sf): Ditto.
>         (avx512pf_gatherpf<mode>df): Ditto.
>         (*avx512pf_gatherpf<mode>df_mask): Ditto.
>         (*avx512pf_gatherpf<mode>df): Ditto.
>         (avx512pf_scatterpf<mode>sf): Ditto.
>         (*avx512pf_scatterpf<mode>sf_mask): Ditto.
>         (*avx512pf_scatterpf<mode>sf): Ditto.
>         (avx512pf_scatterpf<mode>df): Ditto.
>         (*avx512pf_scatterpf<mode>df_mask): Ditto.
>         (*avx512pf_scatterpf<mode>df): Ditto.
>         * common/config/i386/xmmintrin.h (_mm_hint): Add _MM_HINT_ET0.
>
> And for tests:
>
> 2014-02-25  Ilya Tocar  <ilya.to...@intel.com>
>
>         * gcc.target/i386/avx-1.c: Use _MM_HINT_T0 in 
> __builtin_ia32_gatherpfdps,
>         __builtin_ia32_gatherpfqps, __builtin_ia32_scatterpfdps,
>         __builtin_ia32_scatterpfqps, __builtin_ia32_gatherpfdpd,
>         __builtin_ia32_gatherpfqpd, __builtin_ia32_scatterpfdpd,
>         __builtin_ia32_scatterpfqpd.
>         * gcc.target/i386/avx512pf-vgatherpf0dpd-1.c: Use enum values instead
>         of raw ints.
>         * gcc.target/i386/avx512pf-vgatherpf0dps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vgatherpf0qpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vgatherpf0qps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vgatherpf1dpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vgatherpf1dps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vgatherpf1qpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vgatherpf1qps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf0dpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf0qpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf1dpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf1qpd-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf0dps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf0qps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf1dps-1.c: Ditto.
>         * gcc.target/i386/avx512pf-vscatterpf1qps-1.c: Ditto.
>         * gcc.target/i386/sse-14.c: Ditto.
>         * gcc.target/i386/sse-22.c: Ditto.
>         * gcc.target/i386/sse-23.c: Ditto.

OK for mainline with a small change below.

> --- a/gcc/config/i386/xmmintrin.h
> +++ b/gcc/config/i386/xmmintrin.h
> @@ -55,6 +55,7 @@ enum _mm_hint
>  {
>    /* _MM_HINT_ET is _MM_HINT_T with set 3rd bit.  */
>    _MM_HINT_ET1 = 6,
> +  _MM_HINT_ET0 = 5,

Please put new hint above HINT_ET1, to be consistent with the part below.

>    _MM_HINT_T0 = 3,
>    _MM_HINT_T1 = 2,
>    _MM_HINT_T2 = 1,

Uros.

Reply via email to