Reviewers: Benedikt Meurer,

Message:
PTAL


Description:
[turbofan] Second round of optimisation for unordered comparisons on arm/arm64.

Avoid explicitly branching to the false label on unordered when the condition
on the true branch will not catch the unordered case and let the code fall
through.

[email protected]

Please review this at https://codereview.chromium.org/794203003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+18, -12 lines):
  M src/compiler/arm/code-generator-arm.cc
  M src/compiler/arm64/code-generator-arm64.cc


Index: src/compiler/arm/code-generator-arm.cc
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc index dcf03a4a29854fa2afe6323805703270ad6767e9..cfa4de9b3c0a02a4a17be5a1ced19a48c2cdbe08 100644
--- a/src/compiler/arm/code-generator-arm.cc
+++ b/src/compiler/arm/code-generator-arm.cc
@@ -687,8 +687,9 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
   Label* flabel = branch->false_label;
   switch (branch->condition) {
     case kUnorderedEqual:
-      __ b(vs, flabel);
-    // Fall through.
+      // The "eq" condition will not catch the unordered case.
+ // The jump/fall through to false label will be used if the comparison
+      // was unordered.
     case kEqual:
       __ b(eq, tlabel);
       break;
@@ -711,8 +712,9 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
       __ b(gt, tlabel);
       break;
     case kUnorderedLessThan:
-      __ b(vs, flabel);
-    // Fall through.
+      // The "lo" condition will not catch the unordered case.
+ // The jump/fall through to false label will be used if the comparison
+      // was unordered.
     case kUnsignedLessThan:
       __ b(lo, tlabel);
       break;
@@ -723,8 +725,9 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
       __ b(hs, tlabel);
       break;
     case kUnorderedLessThanOrEqual:
-      __ b(vs, flabel);
-    // Fall through.
+      // The "ls" condition will not catch the unordered case.
+ // The jump/fall through to false label will be used if the comparison
+      // was unordered.
     case kUnsignedLessThanOrEqual:
       __ b(ls, tlabel);
       break;
Index: src/compiler/arm64/code-generator-arm64.cc
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc index 8cd03784e54e7cc11bea019186d7b8f1cb53ed74..cc46fd677e13bf7d76fd87f2f96a9178b20df04d 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -781,8 +781,9 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
   } else {
     switch (condition) {
       case kUnorderedEqual:
-        __ B(vs, flabel);
-      // Fall through.
+        // The "eq" condition will not catch the unordered case.
+ // The jump/fall through to false label will be used if the comparison
+        // was unordered.
       case kEqual:
         __ B(eq, tlabel);
         break;
@@ -805,8 +806,9 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
         __ B(gt, tlabel);
         break;
       case kUnorderedLessThan:
-        __ B(vs, flabel);
-      // Fall through.
+        // The "lo" condition will not catch the unordered case.
+ // The jump/fall through to false label will be used if the comparison
+        // was unordered.
       case kUnsignedLessThan:
         __ B(lo, tlabel);
         break;
@@ -817,8 +819,9 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
         __ B(hs, tlabel);
         break;
       case kUnorderedLessThanOrEqual:
-        __ B(vs, flabel);
-      // Fall through.
+        // The "ls" condition will not catch the unordered case.
+ // The jump/fall through to false label will be used if the comparison
+        // was unordered.
       case kUnsignedLessThanOrEqual:
         __ B(ls, tlabel);
         break;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to