Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/riscv/tcg-target-has.h | 8 +++++++-
tcg/riscv/tcg-target.c.inc | 13 +++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h
index 10e61edc45..ea38ee5cbb 100644
--- a/tcg/riscv/tcg-target-has.h
+++ b/tcg/riscv/tcg-target-has.h
@@ -64,7 +64,13 @@ tcg_target_extract_valid(TCGType type, unsigned ofs,
unsigned len)
/* ofs > 0 uses SRLIW; ofs == 0 uses add.uw. */
return ofs || (cpuinfo & CPUINFO_ZBA);
}
- return (cpuinfo & CPUINFO_ZBB) && ofs == 0 && len == 16;
+ switch (len) {
+ case 1:
+ return (cpuinfo & CPUINFO_ZBS) && ofs != 0;