GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/loongarch

LoongArch: Rename rbit to bitreverse for consistency.

The LoongArch-specific reverse-bits builtin is now named bitreverse instead of rbit to match standard optab names.

The LoongArch backend now uses bitreverse instead of rbit for its reverse-bits builtin. This change aligns the backend with standard optab names and leverages the __builtin_bitreverse{8,16,32,64} builtins introduced in r17-523. The old rbit expanders are no longer needed, as their uses were removed in r17-567.

In Details

The LoongArch backend defines patterns and expanders in loongarch.md for bit manipulation. The rbit<mode> pattern is renamed to bitreverse<mode> to align with the standard optab names used for the __builtin_bitreverse family. This change simplifies builtin handling and improves code consistency within the LoongArch backend.

For Context

Compilers use instruction patterns to recognize high-level operations and translate them into low-level machine code. These patterns often rely on a table of operators (optab) to map generic operations to specific instructions for a target architecture. This commit ensures the LoongArch backend's bit-reversal pattern aligns with the standard naming convention, improving consistency and maintainability.

Filed Under: loongarchbuiltincode generationrenameconsistency