Procházet zdrojové kódy

ARM64: Reworked prolog/epilog generation to be simpler.

Aaron Giles před 8 roky
rodič
revize
3b06f19b16

+ 1 - 1
lib/Backend/arm64/ARM64UnwindEncoder.cpp

@@ -27,7 +27,7 @@ const OpcodeList Arm64UnwindCodeGenerator::PrologOpcodes =
 const OpcodeList Arm64UnwindCodeGenerator::EpilogOpcodes =
 {
     { 0xff8003ff, 0x910003ff },         // add sp, sp, #imm
-    { 0xff8003ff, 0xd10003fd },         // sub fp, sp, #imm
+    { 0xff8003ff, 0xd10003bf },         // sub sp, fp, #imm
     { 0xffc003e0, 0xa94003e0 },         // ldp rt, rt2, [sp, #offs]
     { 0xffc003e0, 0xa8c003e0 },         // ldp rt, rt2, [sp], #offs
     { 0xffc003e0, 0xf94003e0 },         // ldr rt, [sp, #offs]

+ 1 - 1
lib/Backend/arm64/EncoderMD.h

@@ -51,7 +51,7 @@ enum InstructionType {
 #define LAST_CALLEE_SAVED_DBL_REG_NUM   15
 
 
-// See comment in LowerEntryInstr: even in a global function, we'll home r0 and r1
+// See comment in LowerEntryInstr: even in a global function, we'll home x0 and x1
 #define MIN_HOMED_PARAM_REGS 2
 
 #define FRAME_REG           RegFP

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 326 - 613
lib/Backend/arm64/LowerMD.cpp


+ 1 - 5
lib/Backend/arm64/UnwindInfoManager.cpp

@@ -5,11 +5,7 @@
 #include "Backend.h"
 #include "ARM64UnwindEncoder.h"
 
-UnwindInfoManager::UnwindInfoManager() :
-    m_hasCalls(false),
-    m_homedParamCount(0),
-    m_savedRegMask(0),
-    m_savedDoubleRegMask(0)
+UnwindInfoManager::UnwindInfoManager()
 {
     for (int which = UnwindInvalid; which < UnwindFunctionOffsetCount; which++)
     {

+ 0 - 16
lib/Backend/arm64/UnwindInfoManager.h

@@ -27,18 +27,6 @@ public:
     BYTE *GetUnwindInfo() { return reinterpret_cast<BYTE *>(const_cast<void *>(m_xdata.GetXdata())); }
     void FinalizeUnwindInfo(BYTE *functionStart, DWORD codeSize);
 
-    // simple setters; none of this is used to generate unwind data, but the prolog/epilog generation relies on it
-    void SetHasCalls(bool has) { this->m_hasCalls = has; }
-    void SetHomedParamCount(BYTE count) { Assert(this->m_homedParamCount == 0); this->m_homedParamCount = count; }
-    void SetSavedReg(BYTE reg) { this->m_savedRegMask |= 1 << reg; }
-    void SetDoubleSavedRegList(DWORD doubleRegMask) { this->m_savedDoubleRegMask = doubleRegMask; }
-
-    // simple getters
-    bool GetHasCalls() const { return this->m_hasCalls; }
-    DWORD GetHomedParamCount() const { return this->m_homedParamCount; }
-    bool TestSavedReg(BYTE reg) const { return ((this->m_savedRegMask >> reg) & 1) != 0; }
-    DWORD GetDoubleSavedRegList() const { return this->m_savedDoubleRegMask; }
-
     // label management
     void SetFunctionOffsetLabel(UnwindFunctionOffsets which, IR::LabelInstr *label);
     void SetLabelOffset(DWORD id, DWORD offset);
@@ -46,10 +34,6 @@ public:
 private:
     DWORD GetFunctionOffset(UnwindFunctionOffsets which);
 
-    bool m_hasCalls;
-    BYTE m_homedParamCount;
-    DWORD m_savedRegMask;
-    DWORD m_savedDoubleRegMask;
     DWORD m_functionOffsetLabelId[UnwindFunctionOffsetCount];
     DWORD m_functionOffset[UnwindFunctionOffsetCount];
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů