From 76d40fa9e54fdf790f9d1a4b97be93f94d26abfc Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Fri, 1 Apr 2022 22:00:41 -0700 Subject: RISC-V: Add the Zifencei extension Recent versions of binutils default to an ISA spec version that doesn't include Zifencei as part of I, so Linux has recently started passing this in -march. [ Luc Van Oostenryck: move this patch at the start of the series ] Signed-off-by: Palmer Dabbelt Signed-off-by: Luc Van Oostenryck --- target-riscv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-riscv.c b/target-riscv.c index dd25bfb9..3bba7c15 100644 --- a/target-riscv.c +++ b/target-riscv.c @@ -17,6 +17,7 @@ #define RISCV_FPU (RISCV_FLOAT|RISCV_DOUBLE|RISCV_FDIV) #define RISCV_GENERIC (RISCV_MUL|RISCV_DIV|RISCV_ATOMIC|RISCV_FPU) #define RISCV_ZICSR (1 << 10) +#define RISCV_ZIFENCEI (1 << 11) static unsigned int riscv_flags; @@ -49,6 +50,7 @@ static void parse_march_riscv(const char *arg) { "h", 0 }, { "s", 0 }, { "_zicsr", RISCV_ZICSR }, + { "_zifencei", RISCV_ZIFENCEI }, }; int i; @@ -131,6 +133,8 @@ static void predefine_riscv(const struct target *self) predefine("__riscv_muldiv", 1, "1"); if (riscv_flags & RISCV_ZICSR) predefine("__riscv_zicsr", 1, "1"); + if (riscv_flags & RISCV_ZIFENCEI) + predefine("__riscv_zifencei", 1, "1"); if (cmodel) predefine_strong("__riscv_cmodel_%s", cmodel); -- cgit 1.2.3-korg