From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Li3o6-00034s-HS for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Li3o5-00033K-8T for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:57 -0400 Received: from [199.232.76.173] (port=34677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Li3o5-00032x-0I for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:57 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54201 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 1Li3o4-0006S0-ML for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:56 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Li3o4-000764-16 for qemu-devel@nongnu.org; Fri, 13 Mar 2009 09:35:56 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Li3o3-00075z-NC for qemu-devel@nongnu.org; Fri, 13 Mar 2009 09:35:55 +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: Fri, 13 Mar 2009 09:35:55 +0000 Subject: [Qemu-devel] [6838] tcg/x86_64: add bswap16_i{32, 64} and bswap32_i64 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: 6838 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6838 Author: aurel32 Date: 2009-03-13 09:35:55 +0000 (Fri, 13 Mar 2009) Log Message: ----------- tcg/x86_64: add bswap16_i{32,64} and bswap32_i64 ops Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/tcg/x86_64/tcg-target.c trunk/tcg/x86_64/tcg-target.h Modified: trunk/tcg/x86_64/tcg-target.c =================================================================== --- trunk/tcg/x86_64/tcg-target.c 2009-03-13 09:35:49 UTC (rev 6837) +++ trunk/tcg/x86_64/tcg-target.c 2009-03-13 09:35:55 UTC (rev 6838) @@ -1094,7 +1094,14 @@ args[3], P_REXW); break; + case INDEX_op_bswap16_i32: + case INDEX_op_bswap16_i64: + tcg_out8(s, 0x66); + tcg_out_modrm(s, 0xc1, SHIFT_ROL, args[0]); + tcg_out8(s, 8); + break; case INDEX_op_bswap32_i32: + case INDEX_op_bswap32_i64: tcg_out_opc(s, (0xc8 + (args[0] & 7)) | P_EXT, 0, args[0], 0); break; case INDEX_op_bswap64_i64: @@ -1287,7 +1294,10 @@ { INDEX_op_brcond_i64, { "r", "re" } }, + { INDEX_op_bswap16_i32, { "r", "0" } }, + { INDEX_op_bswap16_i64, { "r", "0" } }, { INDEX_op_bswap32_i32, { "r", "0" } }, + { INDEX_op_bswap32_i64, { "r", "0" } }, { INDEX_op_bswap64_i64, { "r", "0" } }, { INDEX_op_neg_i32, { "r", "0" } }, Modified: trunk/tcg/x86_64/tcg-target.h =================================================================== --- trunk/tcg/x86_64/tcg-target.h 2009-03-13 09:35:49 UTC (rev 6837) +++ trunk/tcg/x86_64/tcg-target.h 2009-03-13 09:35:55 UTC (rev 6838) @@ -56,7 +56,10 @@ #define TCG_TARGET_CALL_STACK_OFFSET 0 /* optional instructions */ +#define TCG_TARGET_HAS_bswap16_i32 +#define TCG_TARGET_HAS_bswap16_i64 #define TCG_TARGET_HAS_bswap32_i32 +#define TCG_TARGET_HAS_bswap32_i64 #define TCG_TARGET_HAS_bswap64_i64 #define TCG_TARGET_HAS_neg_i32 #define TCG_TARGET_HAS_neg_i64