]> git.proxmox.com Git - qemu.git/commitdiff
Implement TCG not ops for x86-64
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 9 Mar 2009 22:35:13 +0000 (22:35 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 9 Mar 2009 22:35:13 +0000 (22:35 +0000)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6797 c046a42c-6fe2-441c-8c8c-71466251a162

tcg/tcg-op.h
tcg/tcg-opc.h
tcg/x86_64/tcg-target.c
tcg/x86_64/tcg-target.h

index 4c1c5bddb0ecf7123c1ca38171fa0532f465b4fd..1cf8b15e36ae75ee9fa7ef3d52fa69754629d429 100644 (file)
@@ -1425,12 +1425,20 @@ static inline void tcg_gen_neg_i64(TCGv_i64 ret, TCGv_i64 arg)
 
 static inline void tcg_gen_not_i32(TCGv_i32 ret, TCGv_i32 arg)
 {
+#ifdef TCG_TARGET_HAS_not_i32
+    tcg_gen_op2_i32(INDEX_op_not_i32, ret, arg);
+#else
     tcg_gen_xori_i32(ret, arg, -1);
+#endif
 }
 
 static inline void tcg_gen_not_i64(TCGv_i64 ret, TCGv_i64 arg)
 {
+#ifdef TCG_TARGET_HAS_not_i64
+    tcg_gen_op2_i32(INDEX_op_not_i64, ret, arg);
+#else
     tcg_gen_xori_i64(ret, arg, -1);
+#endif
 }
 
 static inline void tcg_gen_discard_i32(TCGv_i32 arg)
index cb56323db71355597faf6e3c850c54f8aaca06cb..cca611427dee1ed7502f8a79146bc38e6e175028 100644 (file)
@@ -147,6 +147,12 @@ DEF2(ext32s_i64, 1, 1, 0, 0)
 DEF2(bswap_i64, 1, 1, 0, 0)
 #endif
 #endif
+#ifdef TCG_TARGET_HAS_not_i32
+DEF2(not_i32, 1, 1, 0, 0)
+#endif
+#ifdef TCG_TARGET_HAS_not_i64
+DEF2(not_i64, 1, 1, 0, 0)
+#endif
 #ifdef TCG_TARGET_HAS_neg_i32
 DEF2(neg_i32, 1, 1, 0, 0)
 #endif
index 60968327b3923538f5bd31a6013edd74e12e5674..a840ac691dd5c37c550d08f18c0ed75f63050b35 100644 (file)
@@ -1108,6 +1108,13 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
         tcg_out_modrm(s, 0xf7 | P_REXW, 3, args[0]);
         break;
 
+    case INDEX_op_not_i32:
+        tcg_out_modrm(s, 0xf7, 2, args[0]);
+        break;
+    case INDEX_op_not_i64:
+        tcg_out_modrm(s, 0xf7 | P_REXW, 2, args[0]);
+        break;
+
     case INDEX_op_ext8s_i32:
         tcg_out_modrm(s, 0xbe | P_EXT | P_REXB, args[0], args[1]);
         break;
@@ -1286,6 +1293,9 @@ static const TCGTargetOpDef x86_64_op_defs[] = {
     { INDEX_op_neg_i32, { "r", "0" } },
     { INDEX_op_neg_i64, { "r", "0" } },
 
+    { INDEX_op_not_i32, { "r", "0" } },
+    { INDEX_op_not_i64, { "r", "0" } },
+
     { INDEX_op_ext8s_i32, { "r", "r"} },
     { INDEX_op_ext16s_i32, { "r", "r"} },
     { INDEX_op_ext8s_i64, { "r", "r"} },
index 1eadf422f12cab833aa1e3cfb418fed7bc34340e..b7e7decf685ff2bc012ad531ca3a2d143d4620d1 100644 (file)
@@ -60,6 +60,8 @@ enum {
 #define TCG_TARGET_HAS_bswap_i64
 #define TCG_TARGET_HAS_neg_i32
 #define TCG_TARGET_HAS_neg_i64
+#define TCG_TARGET_HAS_not_i32
+#define TCG_TARGET_HAS_not_i64
 #define TCG_TARGET_HAS_ext8s_i32
 #define TCG_TARGET_HAS_ext16s_i32
 #define TCG_TARGET_HAS_ext8s_i64