[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250321033718.GA98513@sol.localdomain>
Date: Thu, 20 Mar 2025 20:37:18 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Ignacio Encinas <ignacio@...cinas.com>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Alexandre Ghiti <alex@...ti.fr>, Arnd Bergmann <arnd@...db.de>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linux.dev, skhan@...uxfoundation.org,
Zhihang Shao <zhihang.shao.iscas@...il.com>,
Björn Töpel <bjorn@...nel.org>,
linux-arch@...r.kernel.org
Subject: Re: [PATCH v2 2/2] riscv: introduce asm/swab.h
On Wed, Mar 19, 2025 at 10:09:46PM +0100, Ignacio Encinas wrote:
> +#define ARCH_SWAB(size) \
> +static __always_inline unsigned long __arch_swab##size(__u##size value) \
> +{ \
> + unsigned long x = value; \
> + \
> + asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0, \
> + RISCV_ISA_EXT_ZBB, 1) \
> + :::: legacy); \
Is there a reason to use this instead of
riscv_has_extension_likely(RISCV_ISA_EXT_ZBB) which seems to do the same thing,
including using a static branch?
- Eric
Powered by blists - more mailing lists