target/m68k: implement opcode fetoxm1
PATCH 1/1 target/m68k: implement opcode fetoxm1
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 [email protected]
(gdb) x/2hx 0x800005cc
0x800005cc: 0xf200 0x0808
This patch adds the instruction.
--- target/m68k/helper.h | 1 + target/m68k/fpu_helper.c | 5 +++++ target/m68k/translate.c | 3 +++ 3 files changed, 9 insertions(+)
target/m68k/helper.h +1 -0
@@ -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)
target/m68k/fpu_helper.c +5 -0
@@ -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);
target/m68k/translate.c +3 -0
@@ -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 ;
Signature · 1 line
2.26.2
Quoted 17 lines · 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 [email protected] (gdb) x/2hx 0x800005cc 0x800005cc: 0xf200 0x0808This patch adds the instruction.
Quoted 7 lines
--- 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 <[email protected]>
r~