diff mbox series

[08/19] target/ppc: Introduce REQUIRE_FPU

Message ID 20210824142730.102421-9-luis.pires@eldorado.org.br
State New
Headers show
Series target/ppc: DFP instructions using decodetree | expand

Commit Message

Luis Fernando Fujita Pires Aug. 24, 2021, 2:27 p.m. UTC
From: Fernando Valle <fernando.valle@eldorado.org.br>

Signed-off-by: Fernando Valle <fernando.valle@eldorado.org.br>
Signed-off-by: Luis Pires <luis.pires@eldorado.org.br>
---
 target/ppc/translate.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

David Gibson Aug. 25, 2021, 3:46 a.m. UTC | #1
On Tue, Aug 24, 2021 at 11:27:19AM -0300, Luis Pires wrote:
> From: Fernando Valle <fernando.valle@eldorado.org.br>
> 
> Signed-off-by: Fernando Valle <fernando.valle@eldorado.org.br>
> Signed-off-by: Luis Pires <luis.pires@eldorado.org.br>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  target/ppc/translate.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 4749ecdaa9..5489b4b6e0 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -7461,6 +7461,14 @@ static int times_4(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.
diff mbox series

Patch

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 4749ecdaa9..5489b4b6e0 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7461,6 +7461,14 @@  static int times_4(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.