From 86057426d037ca023632156777a28d8493eaeb9d Mon Sep 17 00:00:00 2001 From: Fernando Valle Date: Fri, 29 Oct 2021 16:24:05 -0300 Subject: [PATCH] target/ppc: Introduce REQUIRE_FPU MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Fernando Valle Signed-off-by: Luis Pires Reviewed-by: Richard Henderson Message-Id: <20211029192417.400707-4-luis.pires@eldorado.org.br> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- target/ppc/translate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 1d24b85746..d4e72affa6 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -7349,6 +7349,14 @@ static int times_16(DisasContext *ctx, int x) } \ } while (0) +#define REQUIRE_FPU(ctx) \ + do { \ + if (unlikely(!(ctx)->fpu_enabled)) { \ + gen_exception((ctx), POWERPC_EXCP_FPU); \ + return true; \ + } \ + } while (0) + /* * Helpers for implementing sets of trans_* functions. * Defer the implementation of NAME to FUNC, with optional extra arguments. -- 2.30.2