DISAS_INSN(cas2w)

{

    uint16_t ext1, ext2;

    TCGv addr1, addr2;

    TCGv regs;



    /* cas2 Dc1:Dc2,Du1:Du2,(Rn1):(Rn2) */



    ext1 = read_im16(env, s);



    if (ext1 & 0x8000) {

        /* Address Register */

        addr1 = AREG(ext1, 12);

    } else {

        /* Data Register */

        addr1 = DREG(ext1, 12);

    }



    ext2 = read_im16(env, s);

    if (ext2 & 0x8000) {

        /* Address Register */

        addr2 = AREG(ext2, 12);

    } else {

        /* Data Register */

        addr2 = DREG(ext2, 12);

    }



    /* if (R1) == Dc1 && (R2) == Dc2 then

     *     (R1) = Du1

     *     (R2) = Du2

     * else

     *     Dc1 = (R1)

     *     Dc2 = (R2)

     */



    regs = tcg_const_i32(REG(ext2, 6) |

                         (REG(ext1, 6) << 3) |

                         (REG(ext2, 0) << 6) |

                         (REG(ext1, 0) << 9));

    gen_helper_cas2w(cpu_env, regs, addr1, addr2);

    tcg_temp_free(regs);



    /* Note that cas2w also assigned to env->cc_op.  */

    s->cc_op = CC_OP_CMPW;

    s->cc_op_synced = 1;

}

DISAS_INSN(cas2w)

{

    uint16_t ext1, ext2;

    TCGv addr1, addr2;

    TCGv regs;



    



    ext1 = read_im16(env, s);



    if (ext1 & 0x8000) {

        

        addr1 = AREG(ext1, 12);

    } else {

        

        addr1 = DREG(ext1, 12);

    }



    ext2 = read_im16(env, s);

    if (ext2 & 0x8000) {

        

        addr2 = AREG(ext2, 12);

    } else {

        

        addr2 = DREG(ext2, 12);

    }



    















    regs = tcg_const_i32(REG(ext2, 6) |

                         (REG(ext1, 6) << 3) |

                         (REG(ext2, 0) << 6) |

                         (REG(ext1, 0) << 9));

    gen_helper_cas2w(cpu_env, regs, addr1, addr2);

    tcg_temp_free(regs);



    

    s->cc_op = CC_OP_CMPW;

    s->cc_op_synced = 1;

}

FUNC_0(VAR_0)

{

    uint16_t ext1, ext2;

    TCGv addr1, addr2;

    TCGv regs;



    



    ext1 = read_im16(env, s);



    if (ext1 & 0x8000) {

        

        addr1 = AREG(ext1, 12);

    } else {

        

        addr1 = DREG(ext1, 12);

    }



    ext2 = read_im16(env, s);

    if (ext2 & 0x8000) {

        

        addr2 = AREG(ext2, 12);

    } else {

        

        addr2 = DREG(ext2, 12);

    }



    















    regs = tcg_const_i32(REG(ext2, 6) |

                         (REG(ext1, 6) << 3) |

                         (REG(ext2, 0) << 6) |

                         (REG(ext1, 0) << 9));

    gen_helper_cas2w(cpu_env, regs, addr1, addr2);

    tcg_temp_free(regs);



    

    s->cc_op = CC_OP_CMPW;

    s->cc_op_synced = 1;

}

FUNC_0(VAR_0)
{ uint16_t ext1, ext2; TCGv addr1, addr2; TCGv regs; ext1 = read_im16(env, s); if (ext1 & 0x8000) { addr1 = AREG(ext1, 12); } else { addr1 = DREG(ext1, 12); } ext2 = read_im16(env, s); if (ext2 & 0x8000) { addr2 = AREG(ext2, 12); } else { addr2 = DREG(ext2, 12); } regs = tcg_const_i32(REG(ext2, 6) |
(REG(ext1, 6) << 3) |
(REG(ext2, 0) << 6) |
(REG(ext1, 0) << 9)); gen_helper_cas2w(cpu_env, regs, addr1, addr2); tcg_temp_free(regs); s->cc_op = CC_OP_CMPW; s->cc_op_synced = 1; }