Title: [194604] trunk/Source/_javascript_Core
Revision
194604
Author
fpi...@apple.com
Date
2016-01-05 13:25:47 -0800 (Tue, 05 Jan 2016)

Log Message

FTL B3 should do ArithNegate
https://bugs.webkit.org/show_bug.cgi?id=152745

Reviewed by Geoffrey Garen.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithNegate):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (194603 => 194604)


--- trunk/Source/_javascript_Core/ChangeLog	2016-01-05 21:19:20 UTC (rev 194603)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-01-05 21:25:47 UTC (rev 194604)
@@ -1,3 +1,13 @@
+2016-01-05  Filip Pizlo  <fpi...@apple.com>
+
+        FTL B3 should do ArithNegate
+        https://bugs.webkit.org/show_bug.cgi?id=152745
+
+        Reviewed by Geoffrey Garen.
+
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::DFG::LowerDFGToLLVM::compileArithNegate):
+
 2016-01-05  Andy VanWagoner  <thetalecraf...@gmail.com>
 
         [ES6] Date.prototype should be a plain object

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (194603 => 194604)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2016-01-05 21:19:20 UTC (rev 194603)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2016-01-05 21:25:47 UTC (rev 194604)
@@ -2247,11 +2247,19 @@
             if (!shouldCheckOverflow(m_node->arithMode()))
                 result = m_out.neg(value);
             else if (!shouldCheckNegativeZero(m_node->arithMode())) {
+                // "0 - x" is the canonical way of saying "-x" in both B3 and LLVM. This gets
+                // lowered to the right thing.
+#if FTL_USES_B3
+                CheckValue* check = m_out.speculateSub(m_out.int32Zero, value);
+                blessSpeculation(check, Overflow, noValue(), nullptr, m_origin);
+                result = check;
+#else // FTL_USES_B3
                 // We don't have a negate-with-overflow intrinsic. Hopefully this
                 // does the trick, though.
                 LValue overflowResult = m_out.subWithOverflow32(m_out.int32Zero, value);
                 speculate(Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
                 result = m_out.extractValue(overflowResult, 0);
+#endif // FTL_USES_B3
             } else {
                 speculate(Overflow, noValue(), 0, m_out.testIsZero32(value, m_out.constInt32(0x7fffffff)));
                 result = m_out.neg(value);
@@ -2273,9 +2281,14 @@
             }
             
             LValue value = lowInt52(m_node->child1());
+#if FTL_USES_B3
+            CheckValue* result = m_out.speculateSub(m_out.int64Zero, value);
+            blessSpeculation(result, Int52Overflow, noValue(), nullptr, m_origin);
+#else // FTL_USES_B3
             LValue overflowResult = m_out.subWithOverflow64(m_out.int64Zero, value);
             speculate(Int52Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
             LValue result = m_out.extractValue(overflowResult, 0);
+#endif // FTL_USES_B3
             speculate(NegativeZero, noValue(), 0, m_out.isZero64(result));
             setInt52(result);
             break;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to