From: Bruno Larsen (billionai) Date: Thu, 4 Nov 2021 12:37:04 +0000 (-0300) Subject: target/ppc: Introduce REQUIRE_VSX macro X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8226cb2d9c4c309664ed3f224c29aae536475443;p=qemu.git 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 Signed-off-by: Bruno Larsen (billionai) Signed-off-by: Luis Pires Signed-off-by: Matheus Ferst Message-Id: <20211104123719.323713-11-matheus.ferst@eldorado.org.br> Signed-off-by: David Gibson --- diff --git a/target/ppc/translate.c b/target/ppc/translate.c index fc9d35a7a8..e88b613093 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)) { \