[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <FA38B840-8F81-4D95-B0FE-797291BA38B3@zytor.com>
Date: Sat, 22 Mar 2025 15:03:01 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: David Laight <david.laight.linux@...il.com>,
Arnd Bergmann <arnd@...nel.org>
CC: Tor Vic <torvic9@...lbox.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] arch/x86: Add an option to build the kernel with '-march=native' on x86-64
On March 22, 2025 2:53:10 PM PDT, David Laight <david.laight.linux@...il.com> wrote:
>On Sat, 22 Mar 2025 12:40:08 +0100
>"Arnd Bergmann" <arnd@...nel.org> wrote:
>
>...
>> I assume that the difference here is that -march=native on
>> your machine gets turned into -march=skylake, which then turns
>> on both additional instructions and a different instruction
>> scheduler.
>>
>> Are you able to quickly run the same tests again using
>> just one of the two?
>>
>> a) -march=x86-64 -mtune=skylake
>> b) -march=skylake -mtune=generic
>
>I've wondered what -mtune=generic is actually optimised for?
>I've seen gcc convert 32 bit add into an lea and then have
>to use another instruction to clear the high bits.
>I've not fiddled with the options to see why it does that.
>My only guess is it is avoiding false dependencies against
>the flags register - but the flags are split on non-archaic
>cpu so that doesn't matter.
>
> David
Not to mention that you can use leal to get the zero-extended low 32 bits. Sounds like a gcc bug report is in order.
The general idea, I believe, is that "generic" is supposed to produce coffee that performs well on the majority of hardware currently in production, and doesn't outright suck on older hardware either. In other words, it is intentionally a moving target.
Powered by blists - more mailing lists