[6806] tcg/x86: add not/neg/extu/bswap/rot i32 ops
Revision: 6806
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6806 Author: aurel32 Date: 2009-03-10 19:37:46 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
tcg/x86: add not/neg/extu/bswap/rot i32 ops
Signed-off-by Aurelien Jarno <[email protected]>
Modified Paths:
--------------
trunk/tcg/i386/tcg-target.c
trunk/tcg/i386/tcg-target.hModified: trunk/tcg/i386/tcg-target.c
===================================================================
tcg/i386/tcg-target.c +40 -1
@@ -158,6 +158,8 @@#define ARITH_XOR 6#define ARITH_CMP 7 +#define SHIFT_ROL 0 +#define SHIFT_ROR 1#define SHIFT_SHL 4#define SHIFT_SHR 5#define SHIFT_SAR 7
@@ -998,7 +1000,13 @@case INDEX_op_sar_i32: c =SHIFT_SAR ; goto gen_shift32; - +case INDEX_op_rotl_i32: + c =SHIFT_ROL ; + goto gen_shift32; +case INDEX_op_rotr_i32: + c =SHIFT_ROR ; + goto gen_shift32; +case INDEX_op_add2_i32:if (const_args[4 ])tgen_arithi (s,ARITH_ADD , args[0 ], args[4 ]);
@@ -1026,6 +1034,25 @@tcg_out_brcond2 (s, args, const_args);break ; +case INDEX_op_bswap_i32: +tcg_out_opc (s, (0xc8 + args[0 ]) |P_EXT ); +break ; + +case INDEX_op_neg_i32: +tcg_out_modrm (s,0xf7 ,3 , args[0 ]); +break ; + +case INDEX_op_not_i32: +tcg_out_modrm (s,0xf7 ,2 , args[0 ]); +break ; + +case INDEX_op_ext8s_i32: +tcg_out_modrm (s,0xbe |P_EXT , args[0 ], args[1 ]); +break ; +case INDEX_op_ext16s_i32: +tcg_out_modrm (s,0xbf |P_EXT , args[0 ], args[1 ]); +break ; +case INDEX_op_qemu_ld8u:tcg_out_qemu_ld (s, args,0 );break ;
@@ -1093,6 +1120,9 @@ { INDEX_op_shl_i32, { "r", "0", "ci" } }, { INDEX_op_shr_i32, { "r", "0", "ci" } }, { INDEX_op_sar_i32, { "r", "0", "ci" } }, + { INDEX_op_sar_i32, { "r", "0", "ci" } }, + { INDEX_op_rotl_i32, { "r", "0", "ci" } }, + { INDEX_op_rotr_i32, { "r", "0", "ci" } }, { INDEX_op_brcond_i32, { "r", "ri" } },
@@ -1100,6 +1130,15 @@ { INDEX_op_sub2_i32, { "r", "r", "0", "1", "ri", "ri" } }, { INDEX_op_brcond2_i32, { "r", "r", "ri", "ri" } }, + { INDEX_op_bswap_i32, { "r", "0" } }, + + { INDEX_op_neg_i32, { "r", "0" } }, + + { INDEX_op_not_i32, { "r", "0" } }, + + { INDEX_op_ext8s_i32, { "r", "q" } }, + { INDEX_op_ext16s_i32, { "r", "r" } }, + #if TARGET_LONG_BITS == 32 { INDEX_op_qemu_ld8u, { "r", "L" } }, { INDEX_op_qemu_ld8s, { "r", "L" } },
Modified: trunk/tcg/i386/tcg-target.h
===================================================================
tcg/i386/tcg-target.h +8 -0
@@ -44,6 +44,14 @@#define TCG_TARGET_STACK_ALIGN 16#define TCG_TARGET_CALL_STACK_OFFSET 0 +/* optional instructions */ +#define TCG_TARGET_HAS_bswap_i32 +#define TCG_TARGET_HAS_neg_i32 +#define TCG_TARGET_HAS_not_i32 +#define TCG_TARGET_HAS_ext8s_i32 +#define TCG_TARGET_HAS_ext16s_i32 +#define TCG_TARGET_HAS_rot_i32 +/* Note: must be synced with dyngen-exec.h */ #define TCG_AREG0 TCG_REG_EBP#define TCG_AREG1 TCG_REG_EBX