static inline void gen_op_mfspr (DisasContext *ctx)

{

    void (*read_cb)(void *opaque, int sprn);

    uint32_t sprn = SPR(ctx->opcode);



#if !defined(CONFIG_USER_ONLY)

    if (ctx->supervisor)

        read_cb = ctx->spr_cb[sprn].oea_read;

    else

#endif

        read_cb = ctx->spr_cb[sprn].uea_read;

    if (likely(read_cb != NULL)) {

        if (likely(read_cb != SPR_NOACCESS)) {

            (*read_cb)(ctx, sprn);

            gen_op_store_T0_gpr(rD(ctx->opcode));

        } else {

            /* Privilege exception */

            if (loglevel != 0) {

                fprintf(logfile, "Trying to read privileged spr %d %03x\n",

                        sprn, sprn);

            }

            printf("Trying to read privileged spr %d %03x\n", sprn, sprn);

            RET_PRIVREG(ctx);

        }

    } else {

        /* Not defined */

        if (loglevel != 0) {

            fprintf(logfile, "Trying to read invalid spr %d %03x\n",

                    sprn, sprn);

        }

        printf("Trying to read invalid spr %d %03x\n", sprn, sprn);

        RET_EXCP(ctx, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);

    }

}

static inline void gen_op_mfspr (DisasContext *ctx)

{

    void (*read_cb)(void *opaque, int sprn);

    uint32_t sprn = SPR(ctx->opcode);



#if !defined(CONFIG_USER_ONLY)

    if (ctx->supervisor)

        read_cb = ctx->spr_cb[sprn].oea_read;

    else

#endif

        read_cb = ctx->spr_cb[sprn].uea_read;

    if (likely(read_cb != NULL)) {

        if (likely(read_cb != SPR_NOACCESS)) {

            (*read_cb)(ctx, sprn);

            gen_op_store_T0_gpr(rD(ctx->opcode));

        } else {

            

            if (loglevel != 0) {

                fprintf(logfile, "Trying to read privileged spr %d %03x\n",

                        sprn, sprn);

            }

            printf("Trying to read privileged spr %d %03x\n", sprn, sprn);

            RET_PRIVREG(ctx);

        }

    } else {

        

        if (loglevel != 0) {

            fprintf(logfile, "Trying to read invalid spr %d %03x\n",

                    sprn, sprn);

        }

        printf("Trying to read invalid spr %d %03x\n", sprn, sprn);

        RET_EXCP(ctx, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);

    }

}

static inline void FUNC_0 (DisasContext *VAR_0)

{

    void (*VAR_1)(void *VAR_2, int VAR_3);

    uint32_t VAR_3 = SPR(VAR_0->opcode);



#if !defined(CONFIG_USER_ONLY)

    if (VAR_0->supervisor)

        VAR_1 = VAR_0->spr_cb[VAR_3].oea_read;

    else

#endif

        VAR_1 = VAR_0->spr_cb[VAR_3].uea_read;

    if (likely(VAR_1 != NULL)) {

        if (likely(VAR_1 != SPR_NOACCESS)) {

            (*VAR_1)(VAR_0, VAR_3);

            gen_op_store_T0_gpr(rD(VAR_0->opcode));

        } else {

            

            if (loglevel != 0) {

                fprintf(logfile, "Trying to read privileged spr %d %03x\n",

                        VAR_3, VAR_3);

            }

            printf("Trying to read privileged spr %d %03x\n", VAR_3, VAR_3);

            RET_PRIVREG(VAR_0);

        }

    } else {

        

        if (loglevel != 0) {

            fprintf(logfile, "Trying to read invalid spr %d %03x\n",

                    VAR_3, VAR_3);

        }

        printf("Trying to read invalid spr %d %03x\n", VAR_3, VAR_3);

        RET_EXCP(VAR_0, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR);

    }

}

static inline void FUNC_0 (DisasContext *VAR_0)
{ void (*VAR_1)(void *VAR_2, int VAR_3); uint32_t VAR_3 = SPR(VAR_0->opcode); #if !defined(CONFIG_USER_ONLY)
if (VAR_0->supervisor)
VAR_1 = VAR_0->spr_cb[VAR_3].oea_read; else
#endif
VAR_1 = VAR_0->spr_cb[VAR_3].uea_read; if (likely(VAR_1 != NULL)) { if (likely(VAR_1 != SPR_NOACCESS)) { (*VAR_1)(VAR_0, VAR_3); gen_op_store_T0_gpr(rD(VAR_0->opcode)); } else { if (loglevel != 0) { fprintf(logfile, "Trying to read privileged spr %d %03x\n",
VAR_3, VAR_3); } printf("Trying to read privileged spr %d %03x\n", VAR_3, VAR_3); RET_PRIVREG(VAR_0); } } else { if (loglevel != 0) { fprintf(logfile, "Trying to read invalid spr %d %03x\n",
VAR_3, VAR_3); } printf("Trying to read invalid spr %d %03x\n", VAR_3, VAR_3); RET_EXCP(VAR_0, EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_SPR); } }