Hi Uros,
I fixed comments.
Btw, I haven't found skylake-avx512 in driver-i386.c at all. Is it intended or 
should I add it?

Thanks,
Julia

gcc/
        * config.gcc: Add -march=cannonlake.
        * config/i386/driver-i386.c (host_detect_local_cpu): Detect cannonlake.
        * config/i386/i386-c.c (ix86_target_macros_internal): Handle cannonlake.
        * config/i386/i386.c (processor_costs): Add m_CANNONLAKE.
        (PTA_CANNONLAKE): New.
        (processor_target_table): Add cannonlake.
        (ix86_option_override_internal): Ditto.
        (fold_builtin_cpu): Ditto.
        (get_builtin_code_for_version): Handle cannonlake.
        (M_INTEL_COREI7_CANNONLAKE): New.
        * config/i386/i386.h (TARGET_CANNONLAKE, PROCESSOR_CANNONLAKE): New.
        * doc/invoke.texi: Add -march=cannonlake.
gcc/testsuite/
        * gcc.target/i386/funcspec-56.inc: Handle new march.
        * g++.dg/ext/mv16.C: Ditto.
libgcc/
        * config/i386/cpuinfo.c (get_intel_cpu): Handle cannonlake.
        * config/i386/cpuinfo.h (processor_subtypes): Add 
INTEL_COREI7_CANNONLAKE.

> -----Original Message-----
> From: Uros Bizjak [mailto:ubiz...@gmail.com]
> Sent: Wednesday, November 08, 2017 8:45 PM
> To: Koval, Julia <julia.ko...@intel.com>
> Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Kirill Yukhin
> <kirill.yuk...@gmail.com>
> Subject: Re: [x86][patch] Add -march=cannonlake.
> 
> On Wed, Nov 8, 2017 at 9:02 AM, Koval, Julia <julia.ko...@intel.com> wrote:
> > Attachment got lost.
> >
> >> -----Original Message-----
> >> From: Koval, Julia
> >> Sent: Wednesday, November 08, 2017 9:01 AM
> >> To: 'GCC Patches' <gcc-patches@gcc.gnu.org>
> >> Cc: 'Uros Bizjak' <ubiz...@gmail.com>; 'Kirill Yukhin'
> <kirill.yuk...@gmail.com>
> >> Subject: RE: [x86][patch] Add -march=cannonlake.
> >>
> >> Hi, this patch adds new option -march=cannonlake. Isasets defined in:
> >> https://software.intel.com/sites/default/files/managed/c5/15/architecture-
> >> instruction-set-extensions-programming-reference.pdf
> >>
> >> Ok for trunk?
> >>
> >> gcc/
> >>       * config.gcc: Add -march=cannonlake.
> >>       * config/i386/driver-i386.c (host_detect_local_cpu): Detect 
> >> cannonlake.
> >>       * config/i386/i386-c.c (ix86_target_macros_internal): Handle
> >> cannonlake.
> >>       * config/i386/i386.c (processor_costs): Add m_CANNONLAKE.
> >>       (PTA_CANNONLAKE): New.
> >>       (processor_target_table): Add cannonlake.
> >>       (ix86_option_override_internal): Ditto.
> >>       (fold_builtin_cpu): Ditto.
> >>       (get_builtin_code_for_version): Handle cannonlake.
> >>       (M_INTEL_CANNONLAKE): New.
> >>       * config/i386/i386.h (TARGET_CANNONLAKE,
> >> PROCESSOR_CANNONLAKE): New.
> >>       * doc/invoke.texi: Add -march=cannonlake.
> >> gcc/testsuite/
> >>       * gcc.target/i386/funcspec-56.inc: Handle new march.
> 
> --- a/gcc/config/i386/driver-i386.c
> +++ b/gcc/config/i386/driver-i386.c
> @@ -803,9 +803,11 @@ const char *host_detect_local_cpu (int argc,
> const char **argv)
>      default:
>        if (arch)
>          {
> +          if (has_avx512vbmi)
> +        cpu = "cannonlake";
>            /* This is unknown family 0x6 CPU.  */
>            /* Assume Knights Landing.  */
> -          if (has_avx512f)
> +          else if (has_avx512f)
>          cpu = "knl";
>            /* Assume Knights Mill */
>            else if (has_avx5124vnniw)
> 
> You should add correct model numbers under <case
> PROCESSOR_PENTIUMPRO>. The above is for the unknown case (which should
> not happen), and it should read (note that "knl" is already
> misplaced):
> 
>     default:
>       /* This is unknown family 0x6 CPU.  */
>       if (arch)
>         {
>           /* Assume Cannonlake.  */
>           if (has_avx512vbmi)
>         cpu = "cannonlake";
>           /* Assume Knights Mill */
>           else if (has_avx5124vnniw)
>         cpu = "knm";
>           /* Assume Skylake.  */
>           else if (has_clflushopt)
>         cpu = "skylake";
>           /* Assume Knights Landing.  */
>           else if (has_avx512f)
>         cpu = "knl";
>           /* Assume Broadwell.  */
>           else if (has_adx)
>         ...
> 
> 
> @@ -31832,7 +31839,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
>      M_INTEL_COREI7_HASWELL,
>      M_INTEL_COREI7_BROADWELL,
>      M_INTEL_COREI7_SKYLAKE,
> -    M_INTEL_COREI7_SKYLAKE_AVX512
> +    M_INTEL_COREI7_SKYLAKE_AVX512,
> +    M_INTEL_CANNONLAKE
>    };
> 
> Please also update libgcc/config/i386/cpuinfo.h, enum processor_features.
> 
> diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> index 9ae74cb..ed0748b 100644
> --- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> +++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> @@ -144,6 +144,7 @@ extern void test_arch_core_avx2 (void)
> __attribute__((__target__("arch=core-avx
>  extern void test_arch_knl (void)
> __attribute__((__target__("arch=knl")));
>  extern void test_arch_knm (void)
> __attribute__((__target__("arch=knm")));
>  extern void test_arch_skylake_avx512 (void)
> __attribute__((__target__("arch=skylake-avx512")));
> +extern void test_arch_cannonlake (void)
> __attribute__((__target__("arch=cannonlake")));
>  extern void test_arch_k8 (void)
> __attribute__((__target__("arch=k8")));
>  extern void test_arch_k8_sse3 (void)
> __attribute__((__target__("arch=k8-sse3")));
>  extern void test_arch_opteron (void)
> __attribute__((__target__("arch=opteron")));
> 
> Please also add new architecture to multiversioning testcases, see
> gcc/testsuite/g++.dg/ext/mv*.C
> 
> Uros.

Attachment: 0001-cannonlake.patch
Description: 0001-cannonlake.patch

Reply via email to