WebKit Bugzilla
Attachment 372977 Details for
Bug 199251
: Add b3 macro lowering for CheckMul on arm64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199251-20190626174247.patch (text/plain), 4.16 KB, created by
Justin Michaud
on 2019-06-26 17:42:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2019-06-26 17:42:48 PDT
Size:
4.16 KB
patch
obsolete
>Subversion Revision: 246840 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index c974eedc160131db94f427c18dac7291ff3c28e2..20a3cc60305b22430cc5e15367aa386d53cbdab3 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-26 Justin Michaud <justin_michaud@apple.com> >+ >+ Add b3 macro lowering for CheckMul on arm >+ https://bugs.webkit.org/show_bug.cgi?id=199251 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Lower CheckMul for 32-bit arguments on arm into a mul and then an overflow check. >+ >+ * b3/B3LowerMacros.cpp: >+ > 2019-06-26 Keith Miller <keith_miller@apple.com> > > remove unneeded didBecomePrototype() calls >diff --git a/Source/JavaScriptCore/b3/B3LowerMacros.cpp b/Source/JavaScriptCore/b3/B3LowerMacros.cpp >index 4c594d24b33bb2e41e29ecdbe5b7052709096a13..4384716f1c72a6cb390636d2c40918a7459985be 100644 >--- a/Source/JavaScriptCore/b3/B3LowerMacros.cpp >+++ b/Source/JavaScriptCore/b3/B3LowerMacros.cpp >@@ -177,6 +177,34 @@ private: > break; > } > >+ case CheckMul: { >+ if (isARM64() && m_value->child(0)->type() == Int32) { >+ CheckValue* checkMul = m_value->as<CheckValue>(); >+ >+ Value* left = m_insertionSet.insert<Value>(m_index, SExt32, m_origin, m_value->child(0)); >+ Value* right = m_insertionSet.insert<Value>(m_index, SExt32, m_origin, m_value->child(1)); >+ Value* mulResult = m_insertionSet.insert<Value>(m_index, Mul, m_origin, left, right); >+ Value* mulResult32 = m_insertionSet.insert<Value>(m_index, Trunc, m_origin, mulResult); >+ Value* upperResult = m_insertionSet.insert<Value>(m_index, Trunc, m_origin, >+ m_insertionSet.insert<Value>(m_index, SShr, m_origin, mulResult, m_insertionSet.insert<Const32Value>(m_index, m_origin, 32))); >+ Value* signBit = m_insertionSet.insert<Value>(m_index, SShr, m_origin, >+ mulResult32, >+ m_insertionSet.insert<Const32Value>(m_index, m_origin, 31)); >+ Value* hasOverflowed = m_insertionSet.insert<Value>(m_index, NotEqual, m_origin, upperResult, signBit); >+ >+ CheckValue* check = m_insertionSet.insert<CheckValue>(m_index, Check, m_origin, hasOverflowed); >+ check->setGenerator(checkMul->generator()); >+ check->clobberEarly(checkMul->earlyClobbered()); >+ check->clobberLate(checkMul->lateClobbered()); >+ check->append(checkMul->constrainedChild(0)); >+ check->append(checkMul->constrainedChild(1)); >+ >+ m_value->replaceWithIdentity(mulResult32); >+ m_changed = true; >+ } >+ break; >+ } >+ > case Switch: { > SwitchValue* switchValue = m_value->as<SwitchValue>(); > Vector<SwitchCase> cases; >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index aaf13ec3d085577230fe27679d434b77ec502671..1e15b1820a8068ac1e31f04b380b80a4e2008882 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-06-26 Justin Michaud <justin_michaud@apple.com> >+ >+ Add b3 macro lowering for CheckMul on arm >+ https://bugs.webkit.org/show_bug.cgi?id=199251 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * microbenchmarks/check-mul-power-of-two.js: Added. >+ (doTest): >+ > 2019-06-24 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r246714. >diff --git a/JSTests/microbenchmarks/check-mul-power-of-two.js b/JSTests/microbenchmarks/check-mul-power-of-two.js >new file mode 100644 >index 0000000000000000000000000000000000000000..92658838860275514bbba0ff723e407bc936cb81 >--- /dev/null >+++ b/JSTests/microbenchmarks/check-mul-power-of-two.js >@@ -0,0 +1,13 @@ >+function doTest(max) { >+ let sum = 0 >+ for (let i=0; i<max; ++i) { >+ sum = sum + i * 64; >+ } >+ return sum >+} >+noInline(doTest); >+ >+for (let i=0; i<100000; ++i) doTest(10000) >+ >+if (doTest(10000) != 3199680000) >+ throw "Error: bad result: " + doTest(10000);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199251
:
372977
|
373149
|
373155
|
373926