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]

Re: [PATCH] Intrinsics for PREFETCHW


> Please see attached patch that does all this with minimum surgery and
> also sets missing SSE prefetch for x86_32 with -mprfchw
Thanks, applied!

> +++ b/gcc/config/i386/prfchwintrin.h
>
> +#if !defined _X86INTRIN_H_INCLUDED && !defined _MM3DNOW_H_INCLUDED
> +# error "Never use <prfchwintrin.h> directly; include <x86intrin.h>\
> +or <mm3dnow.h> instead."
> +#endif
>
> No need to split the line.
Fixed.

> --- a/gcc/config/i386/x86intrin.h
> +++ b/gcc/config/i386/x86intrin.h
> @@ -61,6 +61,10 @@
>  /* For including AVX instructions */
>  #include <immintrin.h>
>
> +#if defined (__PRFCHW__) || defined (__3dNOW__)
> +#include <prfchwintrin.h>
> +#endif
>
> Not needed. This header is already included through mm3dnow.h
> inclusion and directly below
Fixed.

Updated Changelog:
2012-07-25  Kirill Yukhin  <kirill.yukhin@intel.com>
            Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

        * common/config/i386/i386-common.c (OPTION_MASK_ISA_PRFCHW_SET): New.
        (OPTION_MASK_ISA_PRFCHW_UNSET): Likewise.
        (ix86_handle_option): Handle mprfchw option.
        * config.gcc (i[34567]86-*-*): Add prfchwintrin.h.
        (x86_64-*-*): Likewise.
        * config/i386/prfchwintrin.h: New header.
        * config/i386/cpuid.h (bit_PRFCHW): New.
        (bit_BMI): Formatting fix.
        (bit_HLE): Likewise.
        (bit_RTM): Likewise.
        * config/i386/driver-i386.c (host_detect_local_cpu): Detect
        PREFETCHW support.
        * config/i386/i386-c.c: Define __PRFCHW__ if needed.
        * config/i386/i386.c (ix86_target_string): Define
        -mprfchw option. Formatting fixes.
        (PTA_HLE): Formatting fix.
        (PTA_PRFCHW): New.
        (ix86_option_override_internal): Handle new option.
        (ix86_valid_target_attribute_inner_p): Add OPT_mprfchw.
        * config/i386/i386.h (TARGET_PRFCHW): New.
        * config/i386/i386.md (prefetch): Enable for TARGET_PRFCHW.
        * config/i386/i386.opt (mprfchw): New.
        * config/i386/mm3dnow.h: Move _m_prefetchw from here to
        prfchwintrin.h.
        * config/i386/x86intrin.h: Include prfchwintrin.h.

testsuite/Changelog entry wasn't changed.

Bootstrap is passing. New & updated tests passing.

Is it OK for trunk?

Thanks, K

Attachment: bdw-prefetchw-2.gcc.patch
Description: Binary data


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