Re: [4.7 PATCH, i386]: Enable prefetchw for selected AMD targets

2012-09-12 Thread H.J. Lu
On Wed, Sep 12, 2012 at 11:20 AM, Uros Bizjak ubiz...@gmail.com wrote:
 Hello!

 Newer AMD processors does not enable 3dNOW anymore. However, prefetchw
 depends on TARGET_3DNOW, so it is not generated anymore. Following
 patch is a 4.7 version of mainline patch [1].

 2012-09-12  Uros Bizjak  ubiz...@gmail.com

 * config/i386/i386.h (x86_prefetchw): New global variable.
 (TARGET_PREFETCHW): New macro.
 * config/i386/i386.c (PTA_PREFETCHW): Ditto.
 (processor_alias_table): Add PTA_PREFETCHW to
 bdver1, bdver2 and btver1.
 (ix86_option_override_internal): Set x86_prefetchw for
 PTA_PREFETCHW targets.
 * config/i386/i386.md (prefetch): Expand to prefetchw
 for TARGET_PREFETCHW.
 (*prefetch_3dnow_mode): Also enable for TARGET_PREFETCHW.

 Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
 {,-m32}. Will be committed to 4.7 branch after [1] is committed to
 mainline.

 [1] http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00670.html

Do we need to update driver-i386.c?

-- 
H.J.


Re: [4.7 PATCH, i386]: Enable prefetchw for selected AMD targets

2012-09-12 Thread Uros Bizjak
On Wed, Sep 12, 2012 at 8:30 PM, H.J. Lu hjl.to...@gmail.com wrote:

 Newer AMD processors does not enable 3dNOW anymore. However, prefetchw
 depends on TARGET_3DNOW, so it is not generated anymore. Following
 patch is a 4.7 version of mainline patch [1].

 2012-09-12  Uros Bizjak  ubiz...@gmail.com

 * config/i386/i386.h (x86_prefetchw): New global variable.
 (TARGET_PREFETCHW): New macro.
 * config/i386/i386.c (PTA_PREFETCHW): Ditto.
 (processor_alias_table): Add PTA_PREFETCHW to
 bdver1, bdver2 and btver1.
 (ix86_option_override_internal): Set x86_prefetchw for
 PTA_PREFETCHW targets.
 * config/i386/i386.md (prefetch): Expand to prefetchw
 for TARGET_PREFETCHW.
 (*prefetch_3dnow_mode): Also enable for TARGET_PREFETCHW.

 Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
 {,-m32}. Will be committed to 4.7 branch after [1] is committed to
 mainline.

 [1] http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00670.html

 Do we need to update driver-i386.c?

No, the patch is not a backport of -mprfchw, but statically enables
prefetchw for targets that have prefetchw, but don't define
TARGET_3DNOW anymore.

Uros.