sh4: Use DREG() over XREG() if possible Replace XREG() with DREG() if the lowest register bits are known to be zero. Signed-off-by: Magnus Damm --- 0006/target-sh4/translate.c +++ work/target-sh4/translate.c 2007-05-08 13:19:40.000000000 +0900 @@ -649,8 +649,8 @@ void decode_opc(DisasContext * ctx) } else if (ctx->fpscr & FPSCR_SZ) { if (ctx->opcode & 0x0110) break; /* illegal instruction */ - gen_op_fmov_drN_DT0(XREG(B7_4)); - gen_op_fmov_DT0_drN(XREG(B11_8)); + gen_op_fmov_drN_DT0(DREG(B7_4)); + gen_op_fmov_DT0_drN(DREG(B11_8)); } else { gen_op_fmov_frN_FT0(FREG(B7_4)); gen_op_fmov_FT0_frN(FREG(B11_8)); @@ -664,7 +664,7 @@ void decode_opc(DisasContext * ctx) } else if (ctx->fpscr & FPSCR_SZ) { if (ctx->opcode & 0x0010) break; /* illegal instruction */ - gen_op_fmov_drN_DT0(XREG(B7_4)); + gen_op_fmov_drN_DT0(DREG(B7_4)); gen_op_movl_rN_T1(REG(B11_8)); gen_op_stfq_DT0_T1(ctx); } else { @@ -683,7 +683,7 @@ void decode_opc(DisasContext * ctx) break; /* illegal instruction */ gen_op_movl_rN_T0(REG(B7_4)); gen_op_ldfq_T0_DT0(ctx); - gen_op_fmov_DT0_drN(XREG(B11_8)); + gen_op_fmov_DT0_drN(DREG(B11_8)); } else { gen_op_movl_rN_T0(REG(B7_4)); gen_op_ldfl_T0_FT0(ctx); @@ -701,7 +701,7 @@ void decode_opc(DisasContext * ctx) break; /* illegal instruction */ gen_op_movl_rN_T0(REG(B7_4)); gen_op_ldfq_T0_DT0(ctx); - gen_op_fmov_DT0_drN(XREG(B11_8)); + gen_op_fmov_DT0_drN(DREG(B11_8)); gen_op_inc8_rN(REG(B7_4)); } else { gen_op_movl_rN_T0(REG(B7_4)); @@ -720,7 +720,7 @@ void decode_opc(DisasContext * ctx) if (ctx->opcode & 0x0100) break; /* illegal instruction */ gen_op_dec8_rN(REG(B11_8)); - gen_op_fmov_drN_DT0(XREG(B7_4)); + gen_op_fmov_drN_DT0(DREG(B7_4)); gen_op_movl_rN_T1(REG(B11_8)); gen_op_stfq_DT0_T1(ctx); } else { @@ -742,7 +742,7 @@ void decode_opc(DisasContext * ctx) gen_op_movl_rN_T0(REG(B7_4)); gen_op_add_rN_T0(REG(0)); gen_op_ldfq_T0_DT0(ctx); - gen_op_fmov_DT0_drN(XREG(B11_8)); + gen_op_fmov_DT0_drN(DREG(B11_8)); } else { gen_op_movl_rN_T0(REG(B7_4)); gen_op_add_rN_T0(REG(0)); @@ -759,7 +759,7 @@ void decode_opc(DisasContext * ctx) } else if (ctx->fpscr & FPSCR_SZ) { if (ctx->opcode & 0x0010) break; /* illegal instruction */ - gen_op_fmov_drN_DT0(XREG(B7_4)); + gen_op_fmov_drN_DT0(DREG(B7_4)); gen_op_movl_rN_T1(REG(B11_8)); gen_op_add_rN_T1(REG(0)); gen_op_stfq_DT0_T1(ctx);