Lines Matching +full:ls +full:- +full:oe
1 //===-- ARMWinEHPrinter.cpp - Windows on ARM EH Data Printer ----*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
15 // RuntimeFunction's remaining 30-bits and can fully describe the entire frame.
17 // +---------------------------------------+
19 // +---------------------------------------+
21 // +---------------------------------------+
36 // the associated exception handler. Additionally, the entry contains byte-code
39 // +---------------------------------------+
41 // +---------------------------------------+
43 // +---------------------------------------+
53 // The decoder itself is table-driven, using the first byte to determine the
59 // The byte-code maintains a 1-1 instruction mapping, indicating both the width
119 { 0x80, 0x00, 1, &Decoder::opcode_0xxxxxxx }, // UOP_STACK_FREE (16-bit)
120 { 0xc0, 0x80, 2, &Decoder::opcode_10Lxxxxx }, // UOP_POP (32-bit)
121 { 0xf0, 0xc0, 1, &Decoder::opcode_1100xxxx }, // UOP_STACK_SAVE (16-bit)
122 { 0xf8, 0xd0, 1, &Decoder::opcode_11010Lxx }, // UOP_POP (16-bit)
123 { 0xf8, 0xd8, 1, &Decoder::opcode_11011Lxx }, // UOP_POP (32-bit)
124 { 0xf8, 0xe0, 1, &Decoder::opcode_11100xxx }, // UOP_VPOP (32-bit)
125 { 0xfc, 0xe8, 2, &Decoder::opcode_111010xx }, // UOP_STACK_FREE (32-bit)
126 { 0xfe, 0xec, 2, &Decoder::opcode_1110110L }, // UOP_POP (16-bit)
127 { 0xff, 0xee, 2, &Decoder::opcode_11101110 }, // UOP_MICROSOFT_SPECIFIC (16-bit)
132 { 0xff, 0xef, 2, &Decoder::opcode_11101111 }, // UOP_LDRPC_POSTINC (32-bit)
133 { 0xff, 0xf5, 2, &Decoder::opcode_11110101 }, // UOP_VPOP (32-bit)
134 { 0xff, 0xf6, 2, &Decoder::opcode_11110110 }, // UOP_VPOP (32-bit)
135 { 0xff, 0xf7, 3, &Decoder::opcode_11110111 }, // UOP_STACK_RESTORE (16-bit)
136 { 0xff, 0xf8, 4, &Decoder::opcode_11111000 }, // UOP_STACK_RESTORE (16-bit)
137 { 0xff, 0xf9, 3, &Decoder::opcode_11111001 }, // UOP_STACK_RESTORE (32-bit)
138 { 0xff, 0xfa, 4, &Decoder::opcode_11111010 }, // UOP_STACK_RESTORE (32-bit)
139 { 0xff, 0xfb, 1, &Decoder::opcode_11111011 }, // UOP_NOP (16-bit)
140 { 0xff, 0xfc, 1, &Decoder::opcode_11111100 }, // UOP_NOP (32-bit)
141 { 0xff, 0xfd, 1, &Decoder::opcode_11111101 }, // UOP_NOP (16-bit) / END
142 { 0xff, 0xfe, 1, &Decoder::opcode_11111110 }, // UOP_NOP (32-bit) / END
147 // https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling
179 static void printRange(raw_ostream &OS, ListSeparator &LS, unsigned First,
182 OS << LS << Letter << First;
184 OS << LS << Letter << First << "-" << Letter << Last;
187 static void printRange(raw_ostream &OS, uint32_t Mask, ListSeparator &LS,
189 int First = -1;
196 printRange(OS, LS, First, RI - 1, Letter);
197 First = -1;
202 printRange(OS, LS, First, End, Letter);
207 ListSeparator LS;
208 printRange(OS, GPRMask, LS, 0, 12, 'r');
210 OS << LS << "lr";
212 OS << LS << "pc";
218 ListSeparator LS;
219 printRange(OS, VFPMask, LS, 0, 31, 'd');
229 if (VA >= Address && (VA - Address) <= Size)
278 uint32_t Offset = CoffSym.getValue() + SymbolOffset - CS.getValue();
303 Expected<uint64_t> AddressOrErr = SymOrErr->getAddress();
376 | (((1 << (Count + 1)) - 1) << 4);
393 | (((1 << (Count + 1)) - 1) << 4);
407 uint32_t VFPMask = (((1 << (High + 1)) - 1) << 8);
454 << format("0x%02x 0x%02x ; microsoft-specific (type: %u)\n",
468 << format("0x%02x 0x%02x ; str.w lr, [sp, #-%u]!\n",
483 uint32_t VFPMask = ((1 << (End + 1 - Start)) - 1) << Start;
498 uint32_t VFPMask = ((1 << (End + 1 - Start)) - 1) << (16 + Start);
615 "0x%02x ; stp x19, x20, [sp, #-%u]!\n", OC[Offset], Off);
638 "0x%02x ; stp x29, x30, [sp, #-%u]!\n", OC[Offset], Off);
683 "0x%02x%02x ; stp x%u, x%u, [sp, #-%u]!\n",
718 SW.startLine() << format("0x%02x%02x ; str x%u, [sp, #-%u]!\n",
767 "0x%02x%02x ; stp d%u, d%u, [sp, #-%u]!\n", OC[Offset],
798 "0x%02x%02x ; str d%u, [sp, #-%u]!\n", OC[Offset],
882 // - 0 is an x register
883 // - 1 is the low half of a q register
884 // - 2 is a whole q register
886 // Encoded register name (0 -> x0/q0, 1 -> x1/q1, etc.)
905 --MaxReg;
907 --MaxReg;
940 SW.getOStream() << format("[sp, #-%d]!\n", StackOffset);
1003 for (unsigned OI = Offset, OE = Opcodes.size(); !Terminated && OI < OE; ) {
1014 if (OI + DecodeRing[DI].Length > OE) {
1021 (this->*DecodeRing[DI].Routine)(Opcodes.data(), OI, 0, Prologue);
1036 uint64_t Offset = VA - SectionVA;
1043 if (Contents.size() - Offset < 8)
1061 if ((int64_t)(Contents.size() - Offset - 4 * HeaderWords(XData) -
1062 (XData.E() ? 0 : XData.EpilogueCount() * 4) -
1123 Expected<StringRef> Name = Symbol->getName();
1162 Expected<StringRef> FunctionNameOrErr = Function->getName();
1176 Expected<StringRef> Name = XDataRecord->getName();
1187 Expected<section_iterator> SIOrErr = XDataRecord->getSection();
1221 Expected<StringRef> FunctionNameOrErr = Function->getName();
1259 int FpOffset = 4 * llvm::popcount(GPRMask & ((1U << 11) - 1));
1271 SW.startLine() << "push {r0-r3}\n";
1320 Expected<StringRef> FunctionNameOrErr = Function->getName();
1343 // at https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling,
1345 // are printed for the non-packed case.
1353 int LocSZ = (RF.FrameSize() << 4) - SavSZ;
1358 SW.startLine() << format("stp x29, lr, [sp, #-%d]!\n", LocSZ);
1364 SW.startLine() << format("sub sp, sp, #%d\n", LocSZ - 4080);
1370 SW.startLine() << format("stp x6, x7, [sp, #%d]\n", SavSZ - 16);
1371 SW.startLine() << format("stp x4, x5, [sp, #%d]\n", SavSZ - 32);
1372 SW.startLine() << format("stp x2, x3, [sp, #%d]\n", SavSZ - 48);
1374 SW.startLine() << format("stp x0, x1, [sp, #%d]\n", SavSZ - 64);
1379 SW.startLine() << format("stp x0, x1, [sp, #-%d]!\n", SavSZ);
1383 for (int I = (FloatRegs + 1) / 2 - 1; I >= 0; I--) {
1384 if (I == (FloatRegs + 1) / 2 - 1 && FloatRegs % 2 == 1) {
1389 SW.startLine() << format("stp d%d, d%d, [sp, #-%d]!\n", 8 + 2 * I,
1398 SW.startLine() << format("str lr, [sp, #-%d]!\n", SavSZ);
1400 SW.startLine() << format("str lr, [sp, #%d]\n", IntSZ - 8);
1402 for (int I = (RF.RegI() + 1) / 2 - 1; I >= 0; I--) {
1403 if (I == (RF.RegI() + 1) / 2 - 1 && RF.RegI() % 2 == 1) {
1416 SW.startLine() << format("str x%d, [sp, #-%d]!\n", 19 + 2 * I, SavSZ);
1422 SW.startLine() << format("stp x19, x20, [sp, #-%d]!\n", SavSZ);
1429 // https://github.com/MicrosoftDocs/cpp-docs/pull/4202 for upstream
1463 errs() << ".pdata content is not " << PDataEntrySize << "-byte aligned\n";
1479 if (NameOrErr->starts_with(".pdata"))