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 qemu-devel@nongnu.org

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

This patch adds the instruction.

Backports commit 250b1da35d579f42319af234f36207902ca4baa4 from qemu
This commit is contained in:
Laurent Vivier 2020-06-14 21:13:27 -04:00 committed by Lioncash
parent aa69ab54ad
commit 50aa85e560
3 changed files with 9 additions and 0 deletions

View file

@ -652,6 +652,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);

View file

@ -85,6 +85,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)

View file

@ -5371,6 +5371,9 @@ DISAS_INSN(fpu)
case 0x06: /* flognp1 */
gen_helper_flognp1(tcg_ctx, tcg_ctx->cpu_env, cpu_dest, cpu_src);
break;
case 0x08: /* fetoxm1 */
gen_helper_fetoxm1(tcg_ctx, tcg_ctx->cpu_env, cpu_dest, cpu_src);
break;
case 0x09: /* ftanh */
gen_helper_ftanh(tcg_ctx, tcg_ctx->cpu_env, cpu_dest, cpu_src);
break;