[5678] target-mips: convert bitfield ops to TCG
Revision: 5678
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5678 Author: aurel32 Date: 2008-11-11 11:46:58 +0000 (Tue, 11 Nov 2008)
Log Message:
-----------
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 <[email protected]>
Modified Paths:
--------------
trunk/target-mips/helper.h
trunk/target-mips/op_helper.c
trunk/target-mips/translate.c
Modified: trunk/target-mips/helper.h
===================================================================
target-mips/helper.h +1 -5
@@ -270,13 +270,9 @@ DEF_HELPER(void, do_pmon, (int function)) DEF_HELPER(void, do_wait, (void)) -/* Bitfield operations. */ -DEF_HELPER(target_ulong, do_ext, (target_ulong t1, uint32_t pos, uint32_t size)) -DEF_HELPER(target_ulong, do_ins, (target_ulong t0, target_ulong t1, uint32_t pos, uint32_t size)) +/* Bit shuffle operations. */ DEF_HELPER(target_ulong, do_wsbh, (target_ulong t1)) #ifdef TARGET_MIPS64 -DEF_HELPER(target_ulong, do_dext, (target_ulong t1, uint32_t pos, uint32_t size)) -DEF_HELPER(target_ulong, do_dins, (target_ulong t0, target_ulong t1, uint32_t pos, uint32_t size)) DEF_HELPER(target_ulong, do_dsbh, (target_ulong t1)) DEF_HELPER(target_ulong, do_dshd, (target_ulong t1)) #endif
Modified: trunk/target-mips/op_helper.c
===================================================================
target-mips/op_helper.c +1 -25
@@ -1781,37 +1781,13 @@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 );
Modified: trunk/target-mips/translate.c
===================================================================
target-mips/translate.c +39 -16
96 lines not on this page · raw message