From: Philipp Tomsich Date: Sat, 11 Sep 2021 14:00:12 +0000 (+0200) Subject: target/riscv: Add a REQUIRE_32BIT macro X-Git-Tag: v6.2.0-rc0~66^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e68e6c79b9de5c923e478ea6794a5143610b765;p=thirdparty%2Fqemu.git target/riscv: Add a REQUIRE_32BIT macro With the changes to Zb[abcs], there's some encodings that are different in RV64 and RV32 (e.g., for rev8 and zext.h). For these, we'll need a helper macro allowing us to select on RV32, as well. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: Bin Meng Message-id: 20210911140016.834071-13-philipp.tomsich@vrull.eu Signed-off-by: Alistair Francis --- diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 74b33fa3c90..b2d3444bc56 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -337,6 +337,12 @@ EX_SH(12) } \ } while (0) +#define REQUIRE_32BIT(ctx) do { \ + if (!is_32bit(ctx)) { \ + return false; \ + } \ +} while (0) + #define REQUIRE_64BIT(ctx) do { \ if (is_32bit(ctx)) { \ return false; \