[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <B47FE4E4-477A-44EA-ABC9-C50E31D71135@zytor.com>
Date: Sun, 21 Dec 2025 20:25:42 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Eric Dumazet <edumazet@...gle.com>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Uros Bizjak <ubizjak@...il.com>, x86@...nel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()
On December 21, 2025 5:38:24 PM PST, Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>On Sun, 21 Dec 2025 at 15:44, H. Peter Anvin <hpa@...or.com> wrote:
>>
>> Sigh.
>>
>> It's just disappointing to see this kind of stuff.
>
>I actually find all these builtins existing in the first place more
>disappointing.
>
>Inline asm is the *generic* answer, and the one that works for pretty
>much any situation. It's required in the general case, and it's the
>thing that works with older compilers.
>
>Having a builtin for things like this - without any appreciable
>improvement in code - is just pointless and stupid.
>
>Now, generic cross-architecture builtins are one thing: then you can
>use them "portably". So having a builtin for 'ffs()' is not wrong.
>
>But something like __builtin_ia32_readeflags_u64() is just entirely
>pointless. What is the supposed advantage over just doing inline
>assembly?
>
> Linus
Unless they are doing something like actually leaving it on the stack... yeah.
Powered by blists - more mailing lists