diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-11 11:46:58 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-11 11:46:58 +0000 |
commit | 505ad7c2ffd1caf82a6789b610bff82b8b6ad472 (patch) | |
tree | acdc27b38fb8a32d1ac3abc7630b5d1fff3ce7c2 /target-mips/op_helper.c | |
parent | 2623c1ecfc87a0a86188c75598410e6b3d0f18a3 (diff) | |
download | qemu-505ad7c2ffd1caf82a6789b610bff82b8b6ad472.zip qemu-505ad7c2ffd1caf82a6789b610bff82b8b6ad472.tar.gz qemu-505ad7c2ffd1caf82a6789b610bff82b8b6ad472.tar.bz2 |
target-mips: convert bitfield ops to TCG
Bitfield operations can be written with very few TCG instructions
(between 2 and 5), so it is worth converting them to TCG.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5678 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op_helper.c')
-rw-r--r-- | target-mips/op_helper.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 3744728..b642593 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -1781,37 +1781,13 @@ target_ulong do_rdhwr_ccres(void) return 0; } -/* Bitfield operations. */ -target_ulong do_ext(target_ulong t1, uint32_t pos, uint32_t size) -{ - return (int32_t)((t1 >> pos) & ((size < 32) ? ((1 << size) - 1) : ~0)); -} - -target_ulong do_ins(target_ulong t0, target_ulong t1, uint32_t pos, uint32_t size) -{ - target_ulong mask = ((size < 32) ? ((1 << size) - 1) : ~0) << pos; - - return (int32_t)((t0 & ~mask) | ((t1 << pos) & mask)); -} - +/* Bit shuffle operations. */ target_ulong do_wsbh(target_ulong t1) { return (int32_t)(((t1 << 8) & ~0x00FF00FF) | ((t1 >> 8) & 0x00FF00FF)); } #if defined(TARGET_MIPS64) -target_ulong do_dext(target_ulong t1, uint32_t pos, uint32_t size) -{ - return (t1 >> pos) & ((size < 64) ? ((1ULL << size) - 1) : ~0ULL); -} - -target_ulong do_dins(target_ulong t0, target_ulong t1, uint32_t pos, uint32_t size) -{ - target_ulong mask = ((size < 64) ? ((1ULL << size) - 1) : ~0ULL) << pos; - - return (t0 & ~mask) | ((t1 << pos) & mask); -} - target_ulong do_dsbh(target_ulong t1) { return ((t1 << 8) & ~0x00FF00FF00FF00FFULL) | ((t1 >> 8) & 0x00FF00FF00FF00FFULL); |