This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
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~