]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/riscv: Add a REQUIRE_32BIT macro
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>
Sat, 11 Sep 2021 14:00:12 +0000 (16:00 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 6 Oct 2021 22:41:33 +0000 (08:41 +1000)
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 <philipp.tomsich@vrull.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-id: 20210911140016.834071-13-philipp.tomsich@vrull.eu
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/translate.c

index 74b33fa3c909d0d15ccb77a26770d1d106c8726f..b2d3444bc564303e66753ea5c1176b330a05d597 100644 (file)
@@ -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;           \