WebKit Bugzilla
Attachment 362031 Details for
Bug 194656
: lowerStackArgs should lower Lea32/64 on ARM64 to Add
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
c-backup.diff (text/plain), 3.77 KB, created by
Saam Barati
on 2019-02-14 09:53:07 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2019-02-14 09:53:07 PST
Size:
3.77 KB
patch
obsolete
>Index: Source/JavaScriptCore/b3/air/AirLowerStackArgs.cpp >=================================================================== >--- Source/JavaScriptCore/b3/air/AirLowerStackArgs.cpp (revision 241548) >+++ Source/JavaScriptCore/b3/air/AirLowerStackArgs.cpp (working copy) >@@ -71,6 +71,41 @@ void lowerStackArgs(Code& code) > for (unsigned instIndex = 0; instIndex < block->size(); ++instIndex) { > Inst& inst = block->at(instIndex); > >+ if (isARM64() && (inst.kind.opcode == Lea32 || inst.kind.opcode == Lea64)) { >+ auto lower = [&] (Value::OffsetType offset, Tmp base) { >+ ASSERT(inst.args[1].isTmp()); >+ >+ if (Arg::isValidImmForm(offset)) >+ inst = Inst(inst.kind.opcode == Lea32 ? Add32 : Add64, inst.origin, Arg::imm(offset), base, inst.args[1]); >+ else { >+ ASSERT(pinnedExtendedOffsetAddrRegister()); >+ Air::Tmp tmp = Air::Tmp(*pinnedExtendedOffsetAddrRegister()); >+ Arg offsetArg = Arg::bigImm(offset); >+ insertionSet.insert(instIndex, Move, inst.origin, offsetArg, tmp); >+ inst = Inst(inst.kind.opcode == Lea32 ? Add32 : Add64, inst.origin, tmp, inst.args[1]); >+ } >+ }; >+ >+ switch (inst.args[0].kind()) { >+ case Arg::Stack: { >+ StackSlot* slot = inst.args[0].stackSlot(); >+ lower(inst.args[0].offset() + slot->offsetFromFP(), Tmp(GPRInfo::callFrameRegister)); >+ break; >+ } >+ case Arg::CallArg: >+ lower(inst.args[0].offset() - code.frameSize(), Tmp(GPRInfo::callFrameRegister)); >+ break; >+ case Arg::Addr: >+ lower(inst.args[0].offset(), inst.args[0].base()); >+ break; >+ default: >+ ASSERT_NOT_REACHED(); >+ break; >+ } >+ >+ continue; >+ } >+ > inst.forEachArg( > [&] (Arg& arg, Arg::Role role, Bank, Width width) { > auto stackAddr = [&] (Value::OffsetType offsetFromFP) -> Arg { >Index: Source/JavaScriptCore/b3/air/testair.cpp >=================================================================== >--- Source/JavaScriptCore/b3/air/testair.cpp (revision 241548) >+++ Source/JavaScriptCore/b3/air/testair.cpp (working copy) >@@ -2028,6 +2028,40 @@ void testArgumentRegPinned3() > CHECK(r == 10 + 42 + 42); > } > >+void testLea64() >+{ >+ B3::Procedure proc; >+ Code& code = proc.code(); >+ >+ BasicBlock* root = code.addBlock(); >+ >+ int64_t a = 0x11223344; >+ int64_t b = 1 << 13; >+ >+ root->append(Lea64, nullptr, Arg::addr(Tmp(GPRInfo::argumentGPR0), b), Tmp(GPRInfo::returnValueGPR)); >+ root->append(Ret64, nullptr, Tmp(GPRInfo::returnValueGPR)); >+ >+ int64_t r = compileAndRun<int64_t>(proc, a); >+ CHECK(r == a + b); >+} >+ >+void testLea32() >+{ >+ B3::Procedure proc; >+ Code& code = proc.code(); >+ >+ BasicBlock* root = code.addBlock(); >+ >+ int32_t a = 0x11223344; >+ int32_t b = 1 << 13; >+ >+ root->append(Lea32, nullptr, Arg::addr(Tmp(GPRInfo::argumentGPR0), b), Tmp(GPRInfo::returnValueGPR)); >+ root->append(Ret32, nullptr, Tmp(GPRInfo::returnValueGPR)); >+ >+ int32_t r = compileAndRun<int32_t>(proc, a); >+ CHECK(r == a + b); >+} >+ > #define RUN(test) do { \ > if (!shouldRun(#test)) \ > break; \ >@@ -2113,6 +2147,9 @@ void run(const char* filter) > RUN(testArgumentRegPinned2()); > RUN(testArgumentRegPinned3()); > >+ RUN(testLea32()); >+ RUN(testLea64()); >+ > if (tasks.isEmpty()) > usage(); >
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 194656
:
362031
|
362070
|
362086