]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add some flag-specialisation cases that profiling showed the need for.
authorJulian Seward <jseward@acm.org>
Sun, 13 Nov 2005 19:51:04 +0000 (19:51 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 13 Nov 2005 19:51:04 +0000 (19:51 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1453

VEX/priv/guest-amd64/ghelpers.c

index a1cfb5a26c0f3cf635468b8a77c073411433b36c..318f39c0db934cd5f07ea37c1c849df2a98e5d06 100644 (file)
@@ -897,6 +897,22 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
                            mkU64(0)));
       }
 
+      /*---------------- SUBQ ----------------*/
+
+      if (isU64(cc_op, AMD64G_CC_OP_SUBQ) && isU64(cond, AMD64CondL)) {
+         /* long long sub/cmp, then L (signed less than) 
+            --> test dst <s src */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpLT64S, cc_dep1, cc_dep2));
+      }
+
+      if (isU64(cc_op, AMD64G_CC_OP_SUBQ) && isU64(cond, AMD64CondB)) {
+         /* long long sub/cmp, then B (unsigned less than)
+            --> test dst <u src */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpLT64U, cc_dep1, cc_dep2));
+      }
+
       /*---------------- SUBL ----------------*/
 
       if (isU64(cc_op, AMD64G_CC_OP_SUBL) && isU64(cond, AMD64CondZ)) {
@@ -997,6 +1013,14 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
 //..                      binop(Iop_And32,cc_dep1,mkU32(0xFF))));
 //..       }
 
+      /*---------------- LOGICQ ----------------*/
+
+      if (isU64(cc_op, AMD64G_CC_OP_LOGICQ) && isU64(cond, AMD64CondZ)) {
+         /* long long and/or/xor, then Z --> test dst==0 */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpEQ64, cc_dep1, mkU64(0)));
+      }
+
       /*---------------- LOGICL ----------------*/
 
       if (isU64(cc_op, AMD64G_CC_OP_LOGICL) && isU64(cond, AMD64CondZ)) {
@@ -1050,16 +1074,15 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
 //..                      binop(Iop_CmpEQ32, binop(Iop_And32,cc_dep1,mkU32(0xFFFF)), 
 //..                                         mkU32(0)));
 //..       }
-//.. 
-//..       /*---------------- LOGICB ----------------*/
-//.. 
-//..       if (isU32(cc_op, AMD64G_CC_OP_LOGICB) && isU32(cond, X86CondZ)) {
-//..          /* byte and/or/xor, then Z --> test dst==0 */
-//..          return unop(Iop_1Uto32,
-//..                      binop(Iop_CmpEQ32, binop(Iop_And32,cc_dep1,mkU32(255)), 
-//..                                         mkU32(0)));
-//..       }
-//.. 
+
+      /*---------------- LOGICB ----------------*/
+
+      if (isU64(cc_op, AMD64G_CC_OP_LOGICB) && isU64(cond, AMD64CondZ)) {
+         /* byte and/or/xor, then Z --> test dst==0 */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpEQ64, binop(Iop_And64,cc_dep1,mkU64(255)), 
+                                        mkU64(0)));
+      }
 
       /*---------------- INCB ----------------*/