]> git.proxmox.com Git - qemu.git/commit
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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Oct 2012 06:42:09 +0000 (01:42 -0500)
commit3b63392482a72f89e08dbbd221f56fda8907803c
tree37589b7ce5afab283ba6bbff7fe6dd40bfc9b36c
parent86b4f7ca0571f50f5727cfaaf31aa94bb4437cc9
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>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
tcg/mips/tcg-target.c
tcg/mips/tcg-target.h