]> git.proxmox.com Git - qemu.git/commit - tcg/mips/tcg-target.h
tcg/mips: optimize bswap{16,16s,32} on MIPS32R2
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 21 Sep 2012 16:20:26 +0000 (18:20 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 22 Sep 2012 13:10:20 +0000 (15:10 +0200)
commitc1cf85c9acb847c4871c0b241ced8fabf410d502
tree103a4dba75c4b111c829797304cb80cb3425d11f
parent0f46c064eebc9c93b8f925416e0812cc7b4bb503
tcg/mips: optimize bswap{16,16s,32} on MIPS32R2

bswap operations can be optimized on MIPS32 Release 2 using the ROTR,
WSBH and SEH instructions. We can't use the non-R2 code to implement the
ops due to registers constraints, so don't define the corresponding
TCG_TARGET_HAS_bswap* values.

Also bswap16* operations are supposed to be called with the 16 high bits
zeroed. This is the case everywhere (including for TCG by definition)
except when called from the store helper. Remove the AND instructions from
bswap16* and move it there.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/mips/tcg-target.c
tcg/mips/tcg-target.h