Address generation
Type: unprivileged
| Version | State | Ratified |
|---|---|---|
| 1.0.0 | ratified | 2021-06 |
The Zba instructions can be used to accelerate the generation of addresses that index into arrays of basic types (halfword, word, doubleword) using both unsigned word-sized and XLEN-sized indices: a shifted index is added to a base address.
The shift and add instructions do a left shift of 1, 2, or 3 because these are commonly found in real-world code and because they can be implemented with a minimal amount of additional hardware beyond that of the simple adder. This avoids lengthening the critical path in implementations.
While the shift and add instructions are limited to a maximum left shift of 3, the `slli` instruction (from the base ISA) can be used to perform similar shifts for indexing into arrays of wider elements. The `slli.uw` -- added in this extension -- can be used when the index is to be interpreted as an unsigned word.
add.uw — Add unsigned wordc.zext.w — Zero-extend word, 16-bit encodingsh1add — Shift left by 1 and addsh1add.uw — Shift unsigned word left by 1 and addsh2add — Shift left by 2 and addsh2add.uw — Shift unsigned word left by 2 and addsh3add — Shift left by 3 and addsh3add.uw — Shift unsigned word left by 3 and addslli.uw — Shift left unsigned word (Immediate)Version af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.