Landing: af981ba6b6df

Project / Subsystem

gcc / risc-v

Date

2026-09-04

Author

Jakub Jelinek

Commit

af981ba6b6dfb1a7e15e4472318535ab7d866893

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
risc-v
patch_id
—
commit_hash
af981ba6b6dfb1a7e15e4472318535ab7d866893
source_type
github
headline
RISC-V: Improve __builtin_bitreverse code generation with ZBKB extension.
tldr
RISC-V __builtin_bitreverse functions now use more efficient instructions when the ZBKB extension is enabled.
author
Jakub Jelinek
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • risc-v
  • • optimization
  • • builtin
discussion_id_link
—
bugzilla_pr
—
date
2026-09-04T00:00:00.000Z

GCC improves code generation for __builtin_bitreverse{8,16,32,64} on RISC-V when the ZBKB extension is enabled. It now utilizes specific brev8 or rev8 instructions for better performance. The change also adjusts the condition for using the bswaphi2 instruction to include the ZBKB extension.