This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] x86: Add -march=cascadelake
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Wei Xiao <wei dot william dot xiao at gmail dot com>
- Cc: ubizjak at gmail dot com, mliska at suse dot cz, ak at linux dot intel dot com, gcc-patches at gcc dot gnu dot org, hongjiu dot lu at intel dot com, law at redhat dot com, Kirill Yukhin <kirill dot yukhin at gmail dot com>, hjl dot tools at gmail dot com, wei3 dot xiao at intel dot com
- Date: Fri, 14 Dec 2018 11:47:29 +0100
- Subject: Re: [PATCH] x86: Add -march=cascadelake
- References: <CAFULd4ayacr6HEYa=4AWfN=2e38oW86QLhPk+uMqtTw3i6YmDg@mail.gmail.com> <87o9afz7tv.fsf@linux.intel.com> <86f4e1a9-0ace-27d0-1dcf-e0611adae798@suse.cz> <20181126111828.GG12380@tucnak> <bc9e5e31-122f-2fab-5110-35c33e1a2bb5@suse.cz> <CAHFC=NnWqP03jeF2rrypVvwQj9K_1otWfVx-q+WJziQ3bOmJcA@mail.gmail.com> <CAHFC=NkVpSPm7mPHdRQD=ZnMJ2UZV-7n6xfLGYKZDnrxv=p_Sg@mail.gmail.com> <CAHFC=NnAKcCEMwfQL+a62xC7DEb4D=D+NAiCyA5aJRUMD9koKA@mail.gmail.com> <CAFULd4Ytv63RbH+HoLg41VCu63xU0Cnc=0wU=+XB+qindEMnGw@mail.gmail.com> <CAHFC=NmZEzCdYhjD54xvViQq_hRf55zK=88yD75O3fh3r0-M5w@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Dec 14, 2018 at 06:33:37PM +0800, Wei Xiao wrote:
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -832,8 +832,16 @@ const char *host_detect_local_cpu (int argc, const char **argv)
cpu = "skylake";
break;
case 0x55:
- /* Skylake with AVX-512. */
- cpu = "skylake-avx512";
+ if (has_avx512vnni)
+ {
+ /* Cascade Lake. */
+ cpu = "cascadelake";
+ }
+ else
+ {
+ /* Skylake with AVX-512. */
+ cpu = "skylake-avx512";
+ }
break;
Just a formatting nit here, if {}s are used, they should be indented
2 columns to the right from the if or else and the body of {} should
be indented by two further columns over {.
But, in this case, there is another rule, that if the body has a single
statement, then there shouldn't be {}s around it. Thus just:
if (has_avx512vnni)
/* Cascade Lake. */
cpu = "cascadelake";
else
/* Skylake with AVX-512. */
cpu = "skylake-avx512";
Jakub