[PATCH, i386] Introduce a flag to generate only 128-bit avx instructions

Fang, Changpeng Changpeng.Fang@amd.com
Thu Mar 3 18:01:00 GMT 2011


Yes, you are right. I renamed the flag to -mprefers-avx128 and modified
the documentation.

Is this OK to commit to 4.6?

Thanks,

Changpeng



________________________________________
From: Richard Henderson [rth@redhat.com]
Sent: Wednesday, March 02, 2011 3:50 PM
To: Fang, Changpeng
Cc: Jakub Jelinek; H.J. Lu; Richard Guenther; gcc-patches@gcc.gnu.org; hubicka@ucw.cz
Subject: Re: [PATCH, i386] Introduce a flag to generate only 128-bit avx instructions

On 03/03/2011 03:39 AM, Fang, Changpeng wrote:
>      case SFmode:
> -      return TARGET_AVX ? V8SFmode : V4SFmode;
> +      return (TARGET_AVX && !flag_avx_m128_only) ? V8SFmode : V4SFmode;
>      case DFmode:
> -      return TARGET_AVX ? V4DFmode : V2DFmode;
> +      return (TARGET_AVX && !flag_avx_m128_only) ? V4DFmode : V2DFmode;
>      case DImode:
>        return V2DImode;
>      case SImode:
> diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
> index 85362d7..8968b25 100644
> --- a/gcc/config/i386/i386.opt
> +++ b/gcc/config/i386/i386.opt
> @@ -266,6 +266,10 @@ Target RejectNegative Var(flag_dispatch_scheduler)
>  Do dispatch scheduling if processor is bdver1 and Haifa scheduling
>  is selected.
>
> +mavx-m128-only
> +Target Report Var(flag_avx_m128_only) Init(0)
> +Generate only 128-bit AVX instructions.

You've not actually disabled 256-bit avx insns.  The documentation for
that switch suggests that you should.  Perhaps you want to expand the
documentation to say use only 128-bit insns for auto-vectorization?


r~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Introduce-flag-mprefers-avx128-for-the-vectorizer-to.patch
Type: text/x-patch
Size: 1649 bytes
Desc: 0001-Introduce-flag-mprefers-avx128-for-the-vectorizer-to.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110303/3953ca54/attachment.bin>


More information about the Gcc-patches mailing list