This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH, i386] Fix behavior for –mprefer-vector-width= option


Uros,
Thank you for review. New patch with addressed comments is attached.
Could you please merge it?

Thank you
Sergey

2017-11-23  Sergey Shalnov  <Sergey.Shalnov@intel.com>

gcc/
	* config/i386/i386.h (TARGET_PREFER_AVX256): Also
	enable when TARGET_PREFER_AVX128 is set.


-----Original Message-----
From: Uros Bizjak [mailto:ubizjak@gmail.com] 
Sent: Wednesday, November 22, 2017 9:18 PM
To: Shalnov, Sergey <sergey.shalnov@intel.com>
Cc: gcc-patches@gcc.gnu.org; kirill.yukhin@gmail.com; Koval, Julia <julia.koval@intel.com>; Senkevich, Andrew <andrew.senkevich@intel.com>; Peryt, Sebastian <sebastian.peryt@intel.com>; Ivchenko, Alexander <alexander.ivchenko@intel.com>; Joseph Myers <joseph@codesourcery.com>
Subject: Re: [PATCH, i386] Fix behavior for –mprefer-vector-width= option

On Wed, Nov 22, 2017 at 3:58 PM, Shalnov, Sergey <sergey.shalnov@intel.com> 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  <Sergey.Shalnov@intel.com> 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.

Attachment: 0006-Fix-behavior-for-mprefer-vector-width-option.patch
Description: 0006-Fix-behavior-for-mprefer-vector-width-option.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]