On Wed, Nov 22, 2017 at 3:58 PM, Shalnov, Sergey
<[email protected]> wrote:
> Hi,
> This patch making –mprefer-vector-width= option inclusive. This means that
> if we use –mprefer-vector-width=128 it should switch TARGET_PREFER_AVX128=ON
> and TARGET_PREFER_AVX256=ON also.
> It is minor change to generate “xmm” with –mprefer-vector-width=128
> on the platform with “zmm”.
>
> Sergey
>
> 2017-11-22 Sergey Shalnov <[email protected]>
> gcc/
> * config/i386/i386.h (TARGET_PREFER_AVX256): Add inclusiveness of
> the TARGET_PREFER_AVX256 for TARGET_PREFER_AVX128
You could just say:
* config/i386/i386.h (TARGET_PREFER_AVX256): Also
enable when TARGET_PREFER_AVX128 is set.
+#define TARGET_PREFER_AVX256 (TARGET_PREFER_AVX128 || \
+ (prefer_vector_width_type == PVW_AVX256))
No need for extra parenthesis, and following the GNU coding standard,
the condition should start on the next line:
#define TARGET_PREFER_AVX256 (TARGET_PREFER_AVX128 \
|| prefer_vector_width_type == PVW_AVX256)
Otherwise OK.
Uros.