Skip to content

Commit

Permalink
tcg/mips: inline bswap16/bswap32 ops
Browse files Browse the repository at this point in the history
Use an inline version for the bswap16 and bswap32 ops to avoid
testing for MIPS32R2 instructions availability, as these ops are
only available in that case.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
  • Loading branch information
aurel32 committed Sep 2, 2013
1 parent 988902f commit df81ff5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tcg/mips/tcg-target.c
Expand Up @@ -1506,13 +1506,12 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
}
break;

/* The bswap routines do not work on non-R2 CPU. In that case
we let TCG generating the corresponding code. */
case INDEX_op_bswap16_i32:
tcg_out_bswap16(s, args[0], args[1]);
tcg_out_opc_reg(s, OPC_WSBH, args[0], 0, args[1]);
break;
case INDEX_op_bswap32_i32:
tcg_out_bswap32(s, args[0], args[1]);
tcg_out_opc_reg(s, OPC_WSBH, args[0], 0, args[1]);
tcg_out_opc_sa(s, OPC_ROTR, args[0], args[0], 16);
break;

case INDEX_op_ext8s_i32:
Expand Down

0 comments on commit df81ff5

Please sign in to comment.