aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Larsen (billionai) <bruno.larsen@eldorado.org.br>2021-11-04 09:37:04 -0300
committerDavid Gibson <david@gibson.dropbear.id.au>2021-11-09 10:32:52 +1100
commit8226cb2d9c4c309664ed3f224c29aae536475443 (patch)
treea5a3c7c3882f8510e008aa490dab7c31313a2a45
parent28110b72a804e0cd8d5b4a14408ac7c38baa3f2c (diff)
downloadqemu-8226cb2d9c4c309664ed3f224c29aae536475443.zip
qemu-8226cb2d9c4c309664ed3f224c29aae536475443.tar.gz
qemu-8226cb2d9c4c309664ed3f224c29aae536475443.tar.bz2
target/ppc: Introduce REQUIRE_VSX macro
Introduce the macro to centralize checking if the VSX facility is enabled and handle it correctly. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br> Signed-off-by: Luis Pires <luis.pires@eldorado.org.br> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br> Message-Id: <20211104123719.323713-11-matheus.ferst@eldorado.org.br> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--target/ppc/translate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index fc9d35a..e88b613 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7354,6 +7354,14 @@ static int times_16(DisasContext *ctx, int x)
} \
} while (0)
+#define REQUIRE_VSX(CTX) \
+ do { \
+ if (unlikely(!(CTX)->vsx_enabled)) { \
+ gen_exception((CTX), POWERPC_EXCP_VSXU); \
+ return true; \
+ } \
+ } while (0)
+
#define REQUIRE_FPU(ctx) \
do { \
if (unlikely(!(ctx)->fpu_enabled)) { \