public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "Koval, Julia" <julia.koval@intel.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Kirill Yukhin <kirill.yukhin@gmail.com>
Subject: Re: [patch][x86] -march=icelake
Date: Sun, 12 Nov 2017 16:34:00 -0000	[thread overview]
Message-ID: <CAFULd4YbezpXsDTgOohBvY5u68tTb0vtL5bTBVtUcV4owJ4b9Q@mail.gmail.com> (raw)
In-Reply-To: <4E89A029A0F8D443B436A5167BA3C53F42ACE34D@IRSMSX101.ger.corp.intel.com>

On Sun, Nov 12, 2017 at 1:04 AM, Koval, Julia <julia.koval@intel.com> wrote:
> Hi, this patch adds new option -march=icelake. Isasets defined in: https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf
> I didn't add arch code to driver-i386.c, because there is no code available in SDM yet, only for cannonlake (https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf Chapter 2).

This means the driver will go through generic detection for
-march=native. Perhaps a comment should be added, so we won't forget
to add the model number when one is available.

> gcc/
>         * config.gcc: Add -march=icelake.
>         * config/i386/driver-i386.c (host_detect_local_cpu): Detect icelake.
>         * config/i386/i386-c.c (ix86_target_macros_internal): Handle icelake.
>         * config/i386/i386.c (processor_costs): Add m_ICELAKE.
>         (PTA_ICELAKE, PTA2_ICELAKE, PTA2_GFNI, PTA2_AVX512VBMI2, PTA2_VAES,
>         PTA2_AVX512VNNI, PTA2_VPCLMULQDQ, PTA2_RDPID, PTA2_AVX512BITALG): New.
>         (processor_target_table): Add icelake.
>         (ix86_option_override_internal): Add flags2 for new PTA, handle GFNI, RDPID.
>         (get_builtin_code_for_version): Handle icelake.
>         (M_INTEL_COREI7_ICELAKE): New.
>         * config/i386/i386.h (TARGET_ICELAKE, PROCESSOR_ICELAKE): New.
>         * doc/invoke.texi: Add -march=icelake.
> gcc/testsuite/
>         * gcc.target/i386/funcspec-56.inc: Handle new march.
>         * g++.dg/ext/mv16.C: Ditto.
> libgcc/
>         * config/i386/cpuinfo.h (processor_subtypes): Add INTEL_COREI7_ICELAKE.

@@ -3425,6 +3427,13 @@ ix86_option_override_internal (bool main_args_p,
 #define PTA_AVX5124FMAPS    (HOST_WIDE_INT_1 << 61)
 #define PTA_AVX512VPOPCNTDQ    (HOST_WIDE_INT_1 << 62)
 #define PTA_SGX            (HOST_WIDE_INT_1 << 63)
+#define PTA2_GFNI        (HOST_WIDE_INT_1 << 0)
+#define PTA2_AVX512VBMI2    (HOST_WIDE_INT_1 << 1)
+#define PTA2_VAES        (HOST_WIDE_INT_1 << 2)
+#define PTA2_AVX512VNNI        (HOST_WIDE_INT_1 << 3)
+#define PTA2_VPCLMULQDQ        (HOST_WIDE_INT_1 << 4)
+#define PTA2_RDPID        (HOST_WIDE_INT_1 << 5)
+#define PTA2_AVX512BITALG    (HOST_WIDE_INT_1 << 6)

Please add these options first.

On a related note, there should probably be a better way to extend
various bitmapped flag variables beyond 64bit words. We are constantly
going over 64bit sizes in target option masks, now the number of
processor flags doesn't fit in a word anymore. There are several
places one has to keep in mind in which word some specific flag lives,
and this  approach opens several ways to make a hard to detect
mistake. Does C++ offer a more elegant way?

Bellow, please find a suggestion of a couple of cosmetic changes.

Thanks,
Uros.

@@ -3425,6 +3427,13 @@ ix86_option_override_internal (bool main_args_p,
 #define PTA_AVX5124FMAPS    (HOST_WIDE_INT_1 << 61)
 #define PTA_AVX512VPOPCNTDQ    (HOST_WIDE_INT_1 << 62)
 #define PTA_SGX            (HOST_WIDE_INT_1 << 63)

Please add a comment here, that the folowing belongs to flags2.

+#define PTA2_GFNI        (HOST_WIDE_INT_1 << 0)
+#define PTA2_AVX512VBMI2    (HOST_WIDE_INT_1 << 1)
+#define PTA2_VAES        (HOST_WIDE_INT_1 << 2)


@@ -4105,6 +4124,12 @@ ix86_option_override_internal (bool main_args_p,
     if (processor_alias_table[i].flags & PTA_SGX
         && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_SGX))
       opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_SGX;

Please add vertical space here to visually separate flags and flags2 processing.

+    if (processor_alias_table[i].flags2 & PTA2_RDPID
+        && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_RDPID))
+      opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_RDPID;

  reply	other threads:[~2017-11-12 16:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-12  7:33 Koval, Julia
2017-11-12 16:34 ` Uros Bizjak [this message]
2017-12-18 13:42   ` Koval, Julia
2017-12-19  8:31     ` Uros Bizjak
2017-12-19 11:55       ` Richard Biener
2017-12-19 12:34         ` Koval, Julia
2017-12-19 13:08           ` Richard Biener
2017-12-19 13:49           ` Jakub Jelinek
2018-01-22 11:46             ` Koval, Julia
2018-01-22 12:12               ` Jakub Jelinek
2018-01-22 15:10                 ` Koval, Julia
2018-01-24 11:05                   ` Uros Bizjak
2018-01-24 11:18                     ` Jakub Jelinek
2018-01-24 11:24                       ` Koval, Julia
2018-01-24 11:31                         ` Richard Biener
2018-01-30  8:53                           ` Koval, Julia
2018-01-30  9:56                             ` Jakub Jelinek
2018-01-30 12:55                               ` Koval, Julia
2018-02-01  7:49                                 ` Uros Bizjak
2018-02-01 14:02                                   ` Jakub Jelinek
2017-11-12 17:33 ` Sandra Loosemore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFULd4YbezpXsDTgOohBvY5u68tTb0vtL5bTBVtUcV4owJ4b9Q@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=julia.koval@intel.com \
    --cc=kirill.yukhin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).