static void tgen_ext16s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src)

{

    if (facilities & FACILITY_EXT_IMM) {

        tcg_out_insn(s, RRE, LGHR, dest, src);

        return;

    }



    if (type == TCG_TYPE_I32) {

        if (dest == src) {

            tcg_out_sh32(s, RS_SLL, dest, TCG_REG_NONE, 16);

        } else {

            tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 16);

        }

        tcg_out_sh32(s, RS_SRA, dest, TCG_REG_NONE, 16);

    } else {

        tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 48);

        tcg_out_sh64(s, RSY_SRAG, dest, dest, TCG_REG_NONE, 48);

    }

}

static void tgen_ext16s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src)

{

    if (facilities & FACILITY_EXT_IMM) {

        tcg_out_insn(s, RRE, LGHR, dest, src);

        return;

    }



    if (type == TCG_TYPE_I32) {

        if (dest == src) {

            tcg_out_sh32(s, RS_SLL, dest, TCG_REG_NONE, 16);

        } else {

            tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 16);

        }

        tcg_out_sh32(s, RS_SRA, dest, TCG_REG_NONE, 16);

    } else {

        tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, 48);

        tcg_out_sh64(s, RSY_SRAG, dest, dest, TCG_REG_NONE, 48);

    }

}

static void FUNC_0(TCGContext *VAR_0, TCGType VAR_1, TCGReg VAR_2, TCGReg VAR_3)

{

    if (facilities & FACILITY_EXT_IMM) {

        tcg_out_insn(VAR_0, RRE, LGHR, VAR_2, VAR_3);

        return;

    }



    if (VAR_1 == TCG_TYPE_I32) {

        if (VAR_2 == VAR_3) {

            tcg_out_sh32(VAR_0, RS_SLL, VAR_2, TCG_REG_NONE, 16);

        } else {

            tcg_out_sh64(VAR_0, RSY_SLLG, VAR_2, VAR_3, TCG_REG_NONE, 16);

        }

        tcg_out_sh32(VAR_0, RS_SRA, VAR_2, TCG_REG_NONE, 16);

    } else {

        tcg_out_sh64(VAR_0, RSY_SLLG, VAR_2, VAR_3, TCG_REG_NONE, 48);

        tcg_out_sh64(VAR_0, RSY_SRAG, VAR_2, VAR_2, TCG_REG_NONE, 48);

    }

}

static void FUNC_0(TCGContext *VAR_0, TCGType VAR_1, TCGReg VAR_2, TCGReg VAR_3)
{ if (facilities & FACILITY_EXT_IMM) { tcg_out_insn(VAR_0, RRE, LGHR, VAR_2, VAR_3); return; } if (VAR_1 == TCG_TYPE_I32) { if (VAR_2 == VAR_3) { tcg_out_sh32(VAR_0, RS_SLL, VAR_2, TCG_REG_NONE, 16); } else { tcg_out_sh64(VAR_0, RSY_SLLG, VAR_2, VAR_3, TCG_REG_NONE, 16); } tcg_out_sh32(VAR_0, RS_SRA, VAR_2, TCG_REG_NONE, 16); } else { tcg_out_sh64(VAR_0, RSY_SLLG, VAR_2, VAR_3, TCG_REG_NONE, 48); tcg_out_sh64(VAR_0, RSY_SRAG, VAR_2, VAR_2, TCG_REG_NONE, 48); } }