RISC-V: detach funct-values from their offset
authorHeiko Stuebner <heiko.stuebner@vrull.eu>
Fri, 23 Dec 2022 22:13:23 +0000 (23:13 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Dec 2022 14:59:43 +0000 (06:59 -0800)
commit33e41480b233eb3ae8e3b523062a1916693ac267
tree60a0a12334f241551f8eb01b8fd3c341d4d63825
parentbf0cc402d7cd4277ece55dd0ace6be43916f713b
RISC-V: detach funct-values from their offset

Rather than defining funct3, funct4, etc values pre-shifted to their
target-position in an instruction, define the values themselves and
only shift them where needed.

This allows using these funct-values in other places as well, for example
when decoding functions.

At the same time also reduces the use of magic numbers, one would need
a spec manual to understand.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Link: https://lore.kernel.org/r/20221223221332.4127602-4-heiko@sntech.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/parse_asm.h