static void gen_load_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp)

{

    TCGv tmp;

    TCGv_i64 t64;

    int index = IS_USER(s);



    t64 = tcg_temp_new_i64();

    tmp = tcg_temp_new();

    switch (opsize) {

    case OS_BYTE:

        tcg_gen_qemu_ld8s(tmp, addr, index);

        gen_helper_exts32(cpu_env, fp, tmp);

        break;

    case OS_WORD:

        tcg_gen_qemu_ld16s(tmp, addr, index);

        gen_helper_exts32(cpu_env, fp, tmp);

        break;

    case OS_LONG:

        tcg_gen_qemu_ld32u(tmp, addr, index);

        gen_helper_exts32(cpu_env, fp, tmp);

        break;

    case OS_SINGLE:

        tcg_gen_qemu_ld32u(tmp, addr, index);

        gen_helper_extf32(cpu_env, fp, tmp);

        break;

    case OS_DOUBLE:

        tcg_gen_qemu_ld64(t64, addr, index);

        gen_helper_extf64(cpu_env, fp, t64);

        tcg_temp_free_i64(t64);

        break;

    case OS_EXTENDED:

        if (m68k_feature(s->env, M68K_FEATURE_CF_FPU)) {

            gen_exception(s, s->insn_pc, EXCP_FP_UNIMP);

            break;

        }

        tcg_gen_qemu_ld32u(tmp, addr, index);

        tcg_gen_shri_i32(tmp, tmp, 16);

        tcg_gen_st16_i32(tmp, fp, offsetof(FPReg, l.upper));

        tcg_gen_addi_i32(tmp, addr, 4);

        tcg_gen_qemu_ld64(t64, tmp, index);

        tcg_gen_st_i64(t64, fp, offsetof(FPReg, l.lower));

        break;

    case OS_PACKED:

        /* unimplemented data type on 68040/ColdFire

         * FIXME if needed for another FPU

         */

        gen_exception(s, s->insn_pc, EXCP_FP_UNIMP);

        break;

    default:

        g_assert_not_reached();

    }

    tcg_temp_free(tmp);

    tcg_temp_free_i64(t64);

}

static void gen_load_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp)

{

    TCGv tmp;

    TCGv_i64 t64;

    int index = IS_USER(s);



    t64 = tcg_temp_new_i64();

    tmp = tcg_temp_new();

    switch (opsize) {

    case OS_BYTE:

        tcg_gen_qemu_ld8s(tmp, addr, index);

        gen_helper_exts32(cpu_env, fp, tmp);

        break;

    case OS_WORD:

        tcg_gen_qemu_ld16s(tmp, addr, index);

        gen_helper_exts32(cpu_env, fp, tmp);

        break;

    case OS_LONG:

        tcg_gen_qemu_ld32u(tmp, addr, index);

        gen_helper_exts32(cpu_env, fp, tmp);

        break;

    case OS_SINGLE:

        tcg_gen_qemu_ld32u(tmp, addr, index);

        gen_helper_extf32(cpu_env, fp, tmp);

        break;

    case OS_DOUBLE:

        tcg_gen_qemu_ld64(t64, addr, index);

        gen_helper_extf64(cpu_env, fp, t64);

        tcg_temp_free_i64(t64);

        break;

    case OS_EXTENDED:

        if (m68k_feature(s->env, M68K_FEATURE_CF_FPU)) {

            gen_exception(s, s->insn_pc, EXCP_FP_UNIMP);

            break;

        }

        tcg_gen_qemu_ld32u(tmp, addr, index);

        tcg_gen_shri_i32(tmp, tmp, 16);

        tcg_gen_st16_i32(tmp, fp, offsetof(FPReg, l.upper));

        tcg_gen_addi_i32(tmp, addr, 4);

        tcg_gen_qemu_ld64(t64, tmp, index);

        tcg_gen_st_i64(t64, fp, offsetof(FPReg, l.lower));

        break;

    case OS_PACKED:

        





        gen_exception(s, s->insn_pc, EXCP_FP_UNIMP);

        break;

    default:

        g_assert_not_reached();

    }

    tcg_temp_free(tmp);

    tcg_temp_free_i64(t64);

}

        tcg_temp_free_i64(t64);
static void FUNC_0(DisasContext *VAR_0, int VAR_1, TCGv VAR_2, TCGv_ptr VAR_3)

{

    TCGv tmp;

    TCGv_i64 t64;

    int VAR_4 = IS_USER(VAR_0);



    t64 = tcg_temp_new_i64();

    tmp = tcg_temp_new();

    switch (VAR_1) {

    case OS_BYTE:

        tcg_gen_qemu_ld8s(tmp, VAR_2, VAR_4);

        gen_helper_exts32(cpu_env, VAR_3, tmp);

        break;

    case OS_WORD:

        tcg_gen_qemu_ld16s(tmp, VAR_2, VAR_4);

        gen_helper_exts32(cpu_env, VAR_3, tmp);

        break;

    case OS_LONG:

        tcg_gen_qemu_ld32u(tmp, VAR_2, VAR_4);

        gen_helper_exts32(cpu_env, VAR_3, tmp);

        break;

    case OS_SINGLE:

        tcg_gen_qemu_ld32u(tmp, VAR_2, VAR_4);

        gen_helper_extf32(cpu_env, VAR_3, tmp);

        break;

    case OS_DOUBLE:

        tcg_gen_qemu_ld64(t64, VAR_2, VAR_4);

        gen_helper_extf64(cpu_env, VAR_3, t64);

        tcg_temp_free_i64(t64);

        break;

    case OS_EXTENDED:

        if (m68k_feature(VAR_0->env, M68K_FEATURE_CF_FPU)) {

            gen_exception(VAR_0, VAR_0->insn_pc, EXCP_FP_UNIMP);

            break;

        }

        tcg_gen_qemu_ld32u(tmp, VAR_2, VAR_4);

        tcg_gen_shri_i32(tmp, tmp, 16);

        tcg_gen_st16_i32(tmp, VAR_3, offsetof(FPReg, l.upper));

        tcg_gen_addi_i32(tmp, VAR_2, 4);

        tcg_gen_qemu_ld64(t64, tmp, VAR_4);

        tcg_gen_st_i64(t64, VAR_3, offsetof(FPReg, l.lower));

        break;

    case OS_PACKED:

        





        gen_exception(VAR_0, VAR_0->insn_pc, EXCP_FP_UNIMP);

        break;

    default:

        g_assert_not_reached();

    }

    tcg_temp_free(tmp);

    tcg_temp_free_i64(t64);

}

static void FUNC_0(DisasContext *VAR_0, int VAR_1, TCGv VAR_2, TCGv_ptr VAR_3)
{ TCGv tmp; TCGv_i64 t64; int VAR_4 = IS_USER(VAR_0); t64 = tcg_temp_new_i64(); tmp = tcg_temp_new(); switch (VAR_1) { case OS_BYTE:
tcg_gen_qemu_ld8s(tmp, VAR_2, VAR_4); gen_helper_exts32(cpu_env, VAR_3, tmp); break; case OS_WORD:
tcg_gen_qemu_ld16s(tmp, VAR_2, VAR_4); gen_helper_exts32(cpu_env, VAR_3, tmp); break; case OS_LONG:
tcg_gen_qemu_ld32u(tmp, VAR_2, VAR_4); gen_helper_exts32(cpu_env, VAR_3, tmp); break; case OS_SINGLE:
tcg_gen_qemu_ld32u(tmp, VAR_2, VAR_4); gen_helper_extf32(cpu_env, VAR_3, tmp); break; case OS_DOUBLE:
tcg_gen_qemu_ld64(t64, VAR_2, VAR_4); gen_helper_extf64(cpu_env, VAR_3, t64); tcg_temp_free_i64(t64); break; case OS_EXTENDED:
if (m68k_feature(VAR_0->env, M68K_FEATURE_CF_FPU)) { gen_exception(VAR_0, VAR_0->insn_pc, EXCP_FP_UNIMP); break; } tcg_gen_qemu_ld32u(tmp, VAR_2, VAR_4); tcg_gen_shri_i32(tmp, tmp, 16); tcg_gen_st16_i32(tmp, VAR_3, offsetof(FPReg, l.upper)); tcg_gen_addi_i32(tmp, VAR_2, 4); tcg_gen_qemu_ld64(t64, tmp, VAR_4); tcg_gen_st_i64(t64, VAR_3, offsetof(FPReg, l.lower)); break; case OS_PACKED:
gen_exception(VAR_0, VAR_0->insn_pc, EXCP_FP_UNIMP); break; default:
g_assert_not_reached(); } tcg_temp_free(tmp); tcg_temp_free_i64(t64); }