Open
Description
The sBPFv1 instruction set features a 32-bit ALU instruction class.
The SBF LLVM target currently doesn't make use of it (the ALU32
feature is not enabled for the sBPFv1 target).
Allowing the compiler to generate 32-bit ALU instructions has potential performance benefits:
- The compiled code currently has to emulate wraparound behavior when using 32-bit integer types.
- On x86_64, instructions with 32-bit operands are typically shorter than their 64-bit counterparts, which could lead to improved instruction fetch performance when using a JIT compiler.
There are a few problems:
- A bug byte swapping short strings https://github.com/anza-xyz/agave/blob/45a4792d063e18e8c19f489d72ad37ee7b7b352b/programs/sbf/rust/sanity/src/lib.rs#L60-L64
- Enabling ALU32 results in significantly worse code (~20% code bloat) as of 2024-07-04
Metadata
Metadata
Assignees
Labels
No labels