public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] arch/riscv: Add bitrev.h file to support rev8 and brev8
@ 2026-04-20 13:12 Jinjie Ruan
  2026-04-20 13:12 ` [PATCH v4 1/2] bitops: Define generic __bitrev8/16/32 for reuse Jinjie Ruan
  2026-04-20 13:12 ` [PATCH v4 2/2] arch/riscv: Add bitrev.h file to support rev8 and brev8 Jinjie Ruan
  0 siblings, 2 replies; 5+ messages in thread
From: Jinjie Ruan @ 2026-04-20 13:12 UTC (permalink / raw)
  To: pjw, palmer, aou, alex, yury.norov, linux, arnd, akpm, ruanjinjie,
	linux-riscv, linux-kernel, linux-arch, david.laight.linux, nathan,
	cp0613

Add bitrev.h file to support rev8 and brev8 for riscv.

Tested functionally on riscv64 QEMU with:
	"-M virt,acpi=on,zbkb=true,zbb=true"

Changes in v4:
- Update the riscv implementation as David suggested.
- Add new config called NEED_BYTE_REV_TABLE as David suggested to avoid
  bloating the .data section for architectures that have full hardware
  bit-reverse support and don't need the table.

Changes in v3:
- Fix the build issue by remving the CONFIG_HAVE_ARCH_BITREVERSE macro
  for byte_rev_table.
- Update the riscv implementation as David suggested.
- Add Reviwed-by.

Changes in v2:
- Define generic __bitrev8/16/32 for reuse in riscv.

Jinjie Ruan (2):
  bitops: Define generic __bitrev8/16/32 for reuse
  arch/riscv: Add bitrev.h file to support rev8 and brev8

 arch/riscv/Kconfig                    |  2 ++
 arch/riscv/include/asm/bitrev.h       | 51 +++++++++++++++++++++++++++
 include/asm-generic/bitops/__bitrev.h | 25 +++++++++++++
 include/linux/bitrev.h                | 20 +++--------
 lib/Kconfig                           |  4 +++
 lib/bitrev.c                          |  4 +--
 6 files changed, 88 insertions(+), 18 deletions(-)
 create mode 100644 arch/riscv/include/asm/bitrev.h
 create mode 100644 include/asm-generic/bitops/__bitrev.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-21  3:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 13:12 [PATCH v4 0/2] arch/riscv: Add bitrev.h file to support rev8 and brev8 Jinjie Ruan
2026-04-20 13:12 ` [PATCH v4 1/2] bitops: Define generic __bitrev8/16/32 for reuse Jinjie Ruan
2026-04-21  2:03   ` Yury Norov
2026-04-21  3:17     ` Jinjie Ruan
2026-04-20 13:12 ` [PATCH v4 2/2] arch/riscv: Add bitrev.h file to support rev8 and brev8 Jinjie Ruan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox