Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lh7ls-0003yw-64 for qemu-devel@nongnu.org; Tue, 10 Mar 2009 15:37:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lh7lr-0003yE-FO for qemu-devel@nongnu.org; Tue, 10 Mar 2009 15:37:47 -0400 Received: from [199.232.76.173] (port=55222 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lh7lr-0003xx-BA for qemu-devel@nongnu.org; Tue, 10 Mar 2009 15:37:47 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54754 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lh7lq-0005CC-VV for qemu-devel@nongnu.org; Tue, 10 Mar 2009 15:37:47 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Lh7lq-0005un-Gi for qemu-devel@nongnu.org; Tue, 10 Mar 2009 19:37:46 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Lh7lq-0005ui-9a for qemu-devel@nongnu.org; Tue, 10 Mar 2009 19:37:46 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Tue, 10 Mar 2009 19:37:46 +0000 Subject: [Qemu-devel] [6806] tcg/x86: add not/neg/extu/bswap/rot i32 ops Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Modified Paths: -------------- trunk/tcg/i386/tcg-target.c trunk/tcg/i386/tcg-target.h Modified: trunk/tcg/i386/tcg-target.c =================================================================== --- trunk/tcg/i386/tcg-target.c 2009-03-10 19:37:39 UTC (rev 6805) +++ trunk/tcg/i386/tcg-target.c 2009-03-10 19:37:46 UTC (rev 6806) @@ -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 =================================================================== --- trunk/tcg/i386/tcg-target.h 2009-03-10 19:37:39 UTC (rev 6805) +++ trunk/tcg/i386/tcg-target.h 2009-03-10 19:37:46 UTC (rev 6806) @@ -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