WebKit Bugzilla
Attachment 360617 Details for
Bug 193957
: mul32 should convert powers of 2 to an lshift
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-193957-20190130140010.patch (text/plain), 3.44 KB, created by
Keith Miller
on 2019-01-30 14:00:11 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Keith Miller
Created:
2019-01-30 14:00:11 PST
Size:
3.44 KB
patch
obsolete
>Subversion Revision: 240644 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index ad050a70c2e964c68aaa131679acf92633ffeefd..dd0db596757d106a121bd838a3fa91e27504df2c 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-30 Keith Miller <keith_miller@apple.com> >+ >+ mul32 should convert powers of 2 to an lshift >+ https://bugs.webkit.org/show_bug.cgi?id=193957 >+ >+ Reviewed by Yusuke Suzuki. >+ >+ * assembler/MacroAssembler.h: >+ (JSC::MacroAssembler::mul32): >+ * assembler/testmasm.cpp: >+ (JSC::int32Operands): >+ (JSC::testMul32WithImmediates): >+ (JSC::run): >+ > 2019-01-28 Devin Rousso <drousso@apple.com> > > Web Inspector: provide a way to edit page WebRTC settings on a remote target >diff --git a/Source/JavaScriptCore/assembler/MacroAssembler.h b/Source/JavaScriptCore/assembler/MacroAssembler.h >index 3a72c2792240ab6865644570960510e6e1020d88..6f9dfeae84e583e2ae18bfc8fd6305d0f79fe00d 100644 >--- a/Source/JavaScriptCore/assembler/MacroAssembler.h >+++ b/Source/JavaScriptCore/assembler/MacroAssembler.h >@@ -1904,6 +1904,15 @@ public: > urshift32(src, trustedImm32ForShift(amount), dest); > } > >+ void mul32(TrustedImm32 imm, RegisterID src, RegisterID dest) >+ { >+ if (hasOneBitSet(imm.m_value)) { >+ lshift32(src, TrustedImm32(getLSBSet(imm.m_value)), dest); >+ return; >+ } >+ MacroAssemblerBase::mul32(imm, src, dest); >+ } >+ > // If the result jump is taken that means the assert passed. > void jitAssert(const WTF::ScopedLambda<Jump(void)>&); > >diff --git a/Source/JavaScriptCore/assembler/testmasm.cpp b/Source/JavaScriptCore/assembler/testmasm.cpp >index 8239a943dabaf42d709c7b019111ed4c2c755a08..2df019f1f79258ec2091dab6b96d4ec73f2e7580 100644 >--- a/Source/JavaScriptCore/assembler/testmasm.cpp >+++ b/Source/JavaScriptCore/assembler/testmasm.cpp >@@ -264,6 +264,21 @@ static Vector<float> floatOperands() > }; > } > >+static Vector<int32_t> int32Operands() >+{ >+ return Vector<int32_t> { >+ 0, >+ 1, >+ -1, >+ 2, >+ -2, >+ 42, >+ -42, >+ 64, >+ std::numeric_limits<int32_t>::max(), >+ std::numeric_limits<int32_t>::min(), >+ }; >+} > > void testCompareDouble(MacroAssembler::DoubleCondition condition) > { >@@ -306,6 +321,23 @@ void testCompareDouble(MacroAssembler::DoubleCondition condition) > } > } > >+void testMul32WithImmediates() >+{ >+ for (auto immediate : int32Operands()) { >+ auto mul = compile([=] (CCallHelpers& jit) { >+ jit.emitFunctionPrologue(); >+ >+ jit.mul32(CCallHelpers::TrustedImm32(immediate), GPRInfo::argumentGPR0, GPRInfo::returnValueGPR); >+ >+ jit.emitFunctionEpilogue(); >+ jit.ret(); >+ }); >+ >+ for (auto value : int32Operands()) >+ CHECK_EQ(invoke<int>(mul, value), immediate * value); >+ } >+} >+ > #if CPU(X86) || CPU(X86_64) || CPU(ARM64) > void testCompareFloat(MacroAssembler::DoubleCondition condition) > { >@@ -956,6 +988,7 @@ void run(const char* filter) > RUN(testCompareDouble(MacroAssembler::DoubleGreaterThanOrEqualOrUnordered)); > RUN(testCompareDouble(MacroAssembler::DoubleLessThanOrUnordered)); > RUN(testCompareDouble(MacroAssembler::DoubleLessThanOrEqualOrUnordered)); >+ RUN(testMul32WithImmediates()); > > #if CPU(X86) || CPU(X86_64) || CPU(ARM64) > RUN(testCompareFloat(MacroAssembler::DoubleEqual));
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 193957
:
360441
|
360446
|
360447
|
360448
|
360449
|
360613
|
360614
| 360617