All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/m68k: implement opcode fetoxm1
@ 2020-05-31 13:19 Laurent Vivier
  2020-06-01 22:18 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2020-05-31 13:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

Example provided in the launchpad bug fails with:

   qemu: uncaught target signal 4 (Illegal instruction) - core dumped
   Illegal instruction (core dumped)

It appears fetoxm1 is not implemented:

   IN: expm1f
   0x800005cc: fetoxm1x %fp2,%fp0
   Disassembler disagrees with translator over instruction decoding
   Please report this to qemu-devel@nongnu.org

   (gdb) x/2hx 0x800005cc
   0x800005cc: 0xf200 0x0808

This patch adds the instruction.

Bug: https://bugs.launchpad.net/qemu/+bug/1881450
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/helper.h     | 1 +
 target/m68k/fpu_helper.c | 5 +++++
 target/m68k/translate.c  | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/target/m68k/helper.h b/target/m68k/helper.h
index feee7be62655..77808497a95c 100644
--- a/target/m68k/helper.h
+++ b/target/m68k/helper.h
@@ -83,6 +83,7 @@ DEF_HELPER_3(fatan, void, env, fp, fp)
 DEF_HELPER_3(fasin, void, env, fp, fp)
 DEF_HELPER_3(facos, void, env, fp, fp)
 DEF_HELPER_3(fatanh, void, env, fp, fp)
+DEF_HELPER_3(fetoxm1, void, env, fp, fp)
 DEF_HELPER_3(ftanh, void, env, fp, fp)
 DEF_HELPER_3(fsinh, void, env, fp, fp)
 DEF_HELPER_3(fcosh, void, env, fp, fp)
diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c
index 36e6c704d1d0..9acf60dfd443 100644
--- a/target/m68k/fpu_helper.c
+++ b/target/m68k/fpu_helper.c
@@ -641,6 +641,11 @@ void HELPER(fatanh)(CPUM68KState *env, FPReg *res, FPReg *val)
     res->d = floatx80_atanh(val->d, &env->fp_status);
 }
 
+void HELPER(fetoxm1)(CPUM68KState *env, FPReg *res, FPReg *val)
+{
+    res->d = floatx80_etoxm1(val->d, &env->fp_status);
+}
+
 void HELPER(ftanh)(CPUM68KState *env, FPReg *res, FPReg *val)
 {
     res->d = floatx80_tanh(val->d, &env->fp_status);
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 0f80888203d3..db4e69bac195 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -5146,6 +5146,9 @@ DISAS_INSN(fpu)
     case 0x06: /* flognp1 */
         gen_helper_flognp1(cpu_env, cpu_dest, cpu_src);
         break;
+    case 0x08: /* fetoxm1 */
+        gen_helper_fetoxm1(cpu_env, cpu_dest, cpu_src);
+        break;
     case 0x09: /* ftanh */
         gen_helper_ftanh(cpu_env, cpu_dest, cpu_src);
         break;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] target/m68k: implement opcode fetoxm1
  2020-05-31 13:19 [PATCH] target/m68k: implement opcode fetoxm1 Laurent Vivier
@ 2020-06-01 22:18 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2020-06-01 22:18 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel

On 5/31/20 6:19 AM, Laurent Vivier wrote:
> Example provided in the launchpad bug fails with:
> 
>    qemu: uncaught target signal 4 (Illegal instruction) - core dumped
>    Illegal instruction (core dumped)
> 
> It appears fetoxm1 is not implemented:
> 
>    IN: expm1f
>    0x800005cc: fetoxm1x %fp2,%fp0
>    Disassembler disagrees with translator over instruction decoding
>    Please report this to qemu-devel@nongnu.org
> 
>    (gdb) x/2hx 0x800005cc
>    0x800005cc: 0xf200 0x0808
> 
> This patch adds the instruction.
> 
> Bug: https://bugs.launchpad.net/qemu/+bug/1881450
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  target/m68k/helper.h     | 1 +
>  target/m68k/fpu_helper.c | 5 +++++
>  target/m68k/translate.c  | 3 +++
>  3 files changed, 9 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-01 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31 13:19 [PATCH] target/m68k: implement opcode fetoxm1 Laurent Vivier
2020-06-01 22:18 ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.