Uros, I did new patch with all comments addressed as proposed. 1. old option -mprefer-avx128 is Alias(mprefer-vector-width=, 128, none) 2. Simplified default initialization (as Bernhard proposed) 3. Fixed documentation (proposed by Sandra) 4. Several tests are changed to use new style of the option but many leaved with -mprefer-avx128 (one test with new style -mprefer-vector-width=128) 2017-11-21 Sergey Shalnov gcc/ * config/i386/i386-opts.h (enum prefer_vector_width): Added new enum for the new option -mprefer-vector-width=[none|128|256|512]. * config/i386/i386.c (ix86_target_string): remove old style options -mprefer-avx256 and make -mprefer-avx128 as alias. (ix86_option_override_internal): Apply defaults for the -mprefer-vector-width=[128|256] option. * config/i386/i386.h (TARGET_PREFER_AVX128, TARGET_PREFER_AVX256): Implement macros to work with -mprefer-vector-width=. * config/i386/i386.opt: Implemented option -mprefer-vector-width=[none|128|256|512]. * doc/invoke.texi: Documentation for -mprefer-vector-width=[none|128|256|512]. gcc/testsuite/ * g++.dg/ext/pr57362.C (__attribute__): Apply new option syntax. * g++.dg/torture/pr81249.C: Ditto. * gcc.target/i386/avx512f-constant-float-return.c: Ditto. * gcc.target/i386/avx512f-prefer.c: Ditto. * gcc.target/i386/pr82460-2.c: Ditto. Please merge this patch if you think it is acceptable. Thank you Sergey -----Original Message----- From: Uros Bizjak [mailto:ubizjak@gmail.com] Sent: Tuesday, November 14, 2017 7:57 AM To: Joseph Myers Cc: Shalnov, Sergey ; gcc-patches@gcc.gnu.org; kirill.yukhin@gmail.com; Koval, Julia ; Senkevich, Andrew ; Peryt, Sebastian ; Ivchenko, Alexander Subject: Re: [PATCH, i386] Refactor -mprefer-avx[128|256] options into common -mprefer-vector-width=[none|128|256|512] On Tue, Nov 14, 2017 at 12:14 AM, Joseph Myers wrote: > On Mon, 13 Nov 2017, Uros Bizjak wrote: > >> [BTW: --mprefer-avx128 should be marked RejectNegative from the >> beginning; let's just assume nobody uses it in its (somehow weird) >> negative "-mno-prefer-avx128" form.] > > It's used in that form in various testcases that otherwise fail when > GCC is configured --with-arch= some CPU that defaults to -mprefer-avx128. In this case, an even better choice would be: Alias(mprefer-vector-width=, 128, none) So, -mno-prefer-avx128 would just set the default back to none. Uros.