Decode low-bit weights with Arm SME2 lookup-table instructions
Introduction
Understand why LUTI helps low-bit matrix multiplication
Use LUTI with SME2
Set up the SME2 environment
Compare plain C decoding with SME2 LUTI2
Build and validate the LUTI2 decoding example
Apply LUTI to SME2 matrix kernels
Build and validate the LUTI programming examples
Identify additional LUTI features
Next Steps
Decode low-bit weights with Arm SME2 lookup-table instructions
Introduction
Understand why LUTI helps low-bit matrix multiplication
Use LUTI with SME2
Set up the SME2 environment
Compare plain C decoding with SME2 LUTI2
Build and validate the LUTI2 decoding example
Apply LUTI to SME2 matrix kernels
Build and validate the LUTI programming examples
Identify additional LUTI features
Next Steps
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Run natively on an arm64 macOS system with Apple silicon M4 or later, or cross-compile on macOS or Linux and run on an Android phone with SME2 support. Use LLVM Clang 22 or later in both cases, and use Android NDK r29 when targeting Android.
You should see
PASS: LUTI2 SME2 matches plain C matmul. after the program compares the matrices element by element. If the device prints SKIP: No support for SME2 on this device., you haven’t validated the calculation, but you can still inspect the generated instructions on the build host.In the original SME2 forms used by the runnable examples, you load the lookup table into the fixed 512-bit
ZT0 register. LUTI2 and LUTI4 then use packed indices from source Z registers to select table entries. With FEAT_LUT, you can instead use one or two scalable Z registers as the table source.Use LUTI2 for 2-bit packed indices and LUTI4 for 4-bit packed indices. You can use LUTI4 with
FMOPA, or chain LUTI4 and LUTI2 before SDOT.Run
make disassemble-example-1 for the native macOS executable or make disassemble-example-1-android for the Android executable. Confirm that the output contains one LUTI2 instruction followed by four SMOPA instructions that target ZA0 through ZA3. You can disassemble either executable without SME2 hardware.