[PATCH v4 09/12] RISC-V: add U-type imm parsing to insn.h header
Lad, Prabhakar
prabhakar.csengg at gmail.com
Sun Dec 11 09:36:51 PST 2022
On Wed, Dec 7, 2022 at 6:08 PM Heiko Stuebner <heiko at sntech.de> wrote:
>
> From: Heiko Stuebner <heiko.stuebner at vrull.eu>
>
> Similar to other existing types, allow extracting the immediate
> for a U-type instruction.
>
> U-type immediates are special in that regard, that the value
> in the instruction in bits [31:12] already represents the same
> bits of the immediate, so no shifting is required.
>
> U-type immediates are for example used in the auipc instruction,
> so these constants make it easier to parse such instructions.
>
> Reviewed-by: Conor Dooley <conor.dooley at microchip.com>
> Reviewed-by: Andrew Jones <ajones at ventanamicro.com>
> Signed-off-by: Heiko Stuebner <heiko.stuebner at vrull.eu>
> ---
> arch/riscv/include/asm/insn.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj at bp.renesas.com>
Cheers,
Prabhakar
More information about the linux-riscv
mailing list