This is the mail archive of the gcc-patches@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]

[PATCH, i386] Fix emitting of prefetch instructions


On Mon, Mar 3, 2014 at 1:10 PM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:

> The new gcc.target/i386/prefetchwt1-1.c test currently FAILs on Solaris 9/x86:
>
> FAIL: gcc.target/i386/prefetchwt1-1.c (test for excess errors)
> Excess errors:
> /var/gcc/regression/trunk/9-gcc-gas/build/gcc/include/xmmintrin.h:1195:1: error:
>  inlining failed in call to always_inline '_mm_prefetch': target specific option
>  mismatch
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.target/i386/prefetchwt1-1.c:12:5:
> error: called from here
>
> gcc.target/i386/prefetchwt1-1.c: output file does not exist
> UNRESOLVED: gcc.target/i386/prefetchwt1-1.c scan-assembler [ \\t]+prefetchwt1[ \
> \t]+
>
> This can be fixed by compiling with -msse2.

Actually, we should take prefetch instructions out of various GCC
target pragmas. Patterns that emit these instructions are designed to
(depending on selected ISA) always emit  the most optimal prefetch
instruction.

The patch also changes the compiler to emit prefetchwt1 only for
_MM_HINT_T1, while for _MM_HINT_T0, it still emits prefetchw. In
addition, the patch corrects wrong MM_HINT_T0 value.

Patch was bootstrapped and tested on x86_64-pc-linux-gnu {,-m32}  and
committed to mainline SVN.

2014-03-03  Uros Bizjak  <ubizjak@gmail.com>

    * config/i386/xmmintrin.h (enum _mm_hint) <_MM_HINT_ET0>: Correct
    hint value.
    (_mm_prefetch): Move out of GCC target("sse") pragma.
    * config/i386/prfchwintrin.h (_m_prefetchw): Move out of
    GCC target("prfchw") pragma.
    * config/i386/i386.md (prefetch): Emit prefetchwt1 only
    for locality <= 2.
    * config/i386/i386.c (ix86_option_override_internal): Enable
    -mprfchw with -mprefetchwt1.

Uros.

Attachment: p.diff.txt
Description: Text document


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