static void dec_modu(DisasContext *dc)

{

    int l1;



    LOG_DIS("modu r%d, r%d, %d\n", dc->r2, dc->r0, dc->r1);



    if (!(dc->features & LM32_FEATURE_DIVIDE)) {

        qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not available\n");

        t_gen_illegal_insn(dc);

        return;

    }



    l1 = gen_new_label();

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_R[dc->r1], 0, l1);

    tcg_gen_movi_tl(cpu_pc, dc->pc);

    t_gen_raise_exception(dc, EXCP_DIVIDE_BY_ZERO);

    gen_set_label(l1);

    tcg_gen_remu_tl(cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]);

}

static void dec_modu(DisasContext *dc)

{

    int l1;



    LOG_DIS("modu r%d, r%d, %d\n", dc->r2, dc->r0, dc->r1);



    if (!(dc->features & LM32_FEATURE_DIVIDE)) {

        qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not available\n");

        t_gen_illegal_insn(dc);

        return;

    }



    l1 = gen_new_label();

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_R[dc->r1], 0, l1);

    tcg_gen_movi_tl(cpu_pc, dc->pc);

    t_gen_raise_exception(dc, EXCP_DIVIDE_BY_ZERO);

    gen_set_label(l1);

    tcg_gen_remu_tl(cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]);

}

static void FUNC_0(DisasContext *VAR_0)

{

    int VAR_1;



    LOG_DIS("modu r%d, r%d, %d\n", VAR_0->r2, VAR_0->r0, VAR_0->r1);



    if (!(VAR_0->features & LM32_FEATURE_DIVIDE)) {

        qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not available\n");

        t_gen_illegal_insn(VAR_0);

        return;

    }



    VAR_1 = gen_new_label();

    tcg_gen_brcondi_tl(TCG_COND_NE, cpu_R[VAR_0->r1], 0, VAR_1);

    tcg_gen_movi_tl(cpu_pc, VAR_0->pc);

    t_gen_raise_exception(VAR_0, EXCP_DIVIDE_BY_ZERO);

    gen_set_label(VAR_1);

    tcg_gen_remu_tl(cpu_R[VAR_0->r2], cpu_R[VAR_0->r0], cpu_R[VAR_0->r1]);

}

static void FUNC_0(DisasContext *VAR_0)
{ int VAR_1; LOG_DIS("modu r%d, r%d, %d\n", VAR_0->r2, VAR_0->r0, VAR_0->r1); if (!(VAR_0->features & LM32_FEATURE_DIVIDE)) { qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not available\n"); t_gen_illegal_insn(VAR_0); return; } VAR_1 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_NE, cpu_R[VAR_0->r1], 0, VAR_1); tcg_gen_movi_tl(cpu_pc, VAR_0->pc); t_gen_raise_exception(VAR_0, EXCP_DIVIDE_BY_ZERO); gen_set_label(VAR_1); tcg_gen_remu_tl(cpu_R[VAR_0->r2], cpu_R[VAR_0->r0], cpu_R[VAR_0->r1]); }