diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc')
15 files changed, 240 insertions, 240 deletions
diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h index 77b7c09946..2cbe8315bc 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h @@ -763,8 +763,8 @@ static inline bool isSVECpyImm(int64_t Imm) { bool IsImm8 = int8_t(Imm) == Imm; bool IsImm16 = int16_t(Imm & ~0xff) == Imm; - if (std::is_same<int8_t, std::make_signed_t<T>>::value || - std::is_same<int8_t, T>::value) + if (std::is_same<int8_t, std::make_signed_t<T>>::value || + std::is_same<int8_t, T>::value) return IsImm8 || uint8_t(Imm) == Imm; if (std::is_same<int16_t, std::make_signed_t<T>>::value) @@ -776,8 +776,8 @@ static inline bool isSVECpyImm(int64_t Imm) { /// Returns true if Imm is valid for ADD/SUB. template <typename T> static inline bool isSVEAddSubImm(int64_t Imm) { - bool IsInt8t = std::is_same<int8_t, std::make_signed_t<T>>::value || - std::is_same<int8_t, T>::value; + bool IsInt8t = std::is_same<int8_t, std::make_signed_t<T>>::value || + std::is_same<int8_t, T>::value; return uint8_t(Imm) == Imm || (!IsInt8t && uint16_t(Imm & ~0xff) == Imm); } diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp index 33448cef46..75a9f2f5c8 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp @@ -758,7 +758,7 @@ MCAsmBackend *llvm::createAArch64leAsmBackend(const Target &T, assert(TheTriple.isOSBinFormatELF() && "Invalid target"); uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TheTriple.getOS()); - bool IsILP32 = STI.getTargetTriple().getEnvironment() == Triple::GNUILP32; + bool IsILP32 = STI.getTargetTriple().getEnvironment() == Triple::GNUILP32; return new ELFAArch64AsmBackend(T, TheTriple, OSABI, /*IsLittleEndian=*/true, IsILP32); } @@ -771,7 +771,7 @@ MCAsmBackend *llvm::createAArch64beAsmBackend(const Target &T, assert(TheTriple.isOSBinFormatELF() && "Big endian is only supported for ELF targets!"); uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TheTriple.getOS()); - bool IsILP32 = STI.getTargetTriple().getEnvironment() == Triple::GNUILP32; + bool IsILP32 = STI.getTargetTriple().getEnvironment() == Triple::GNUILP32; return new ELFAArch64AsmBackend(T, TheTriple, OSABI, /*IsLittleEndian=*/false, IsILP32); } diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp index 6c98ac4737..fcf67bd2f7 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp @@ -43,7 +43,7 @@ protected: } // end anonymous namespace AArch64ELFObjectWriter::AArch64ELFObjectWriter(uint8_t OSABI, bool IsILP32) - : MCELFObjectTargetWriter(/*Is64Bit*/ !IsILP32, OSABI, ELF::EM_AARCH64, + : MCELFObjectTargetWriter(/*Is64Bit*/ !IsILP32, OSABI, ELF::EM_AARCH64, /*HasRelocationAddend*/ true), IsILP32(IsILP32) {} @@ -322,11 +322,11 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx, if (SymLoc == AArch64MCExpr::VK_ABS && IsNC) return R_CLS(LDST64_ABS_LO12_NC); if (SymLoc == AArch64MCExpr::VK_GOT && IsNC) { - AArch64MCExpr::VariantKind AddressLoc = - AArch64MCExpr::getAddressFrag(RefKind); + AArch64MCExpr::VariantKind AddressLoc = + AArch64MCExpr::getAddressFrag(RefKind); if (!IsILP32) { - if (AddressLoc == AArch64MCExpr::VK_LO15) - return ELF::R_AARCH64_LD64_GOTPAGE_LO15; + if (AddressLoc == AArch64MCExpr::VK_LO15) + return ELF::R_AARCH64_LD64_GOTPAGE_LO15; return ELF::R_AARCH64_LD64_GOT_LO12_NC; } else { Ctx.reportError(Fixup.getLoc(), "ILP32 64-bit load/store " diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp index 2135cf605b..ec97e1c8b7 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp @@ -51,61 +51,61 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer { OS << "\t.variant_pcs " << Symbol->getName() << "\n"; } - void EmitARM64WinCFIAllocStack(unsigned Size) override { - OS << "\t.seh_stackalloc " << Size << "\n"; - } - void EmitARM64WinCFISaveR19R20X(int Offset) override { - OS << "\t.seh_save_r19r20_x " << Offset << "\n"; - } - void EmitARM64WinCFISaveFPLR(int Offset) override { - OS << "\t.seh_save_fplr " << Offset << "\n"; - } - void EmitARM64WinCFISaveFPLRX(int Offset) override { - OS << "\t.seh_save_fplr_x " << Offset << "\n"; - } - void EmitARM64WinCFISaveReg(unsigned Reg, int Offset) override { - OS << "\t.seh_save_reg x" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveRegX(unsigned Reg, int Offset) override { - OS << "\t.seh_save_reg_x x" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveRegP(unsigned Reg, int Offset) override { - OS << "\t.seh_save_regp x" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveRegPX(unsigned Reg, int Offset) override { - OS << "\t.seh_save_regp_x x" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveLRPair(unsigned Reg, int Offset) override { - OS << "\t.seh_save_lrpair x" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveFReg(unsigned Reg, int Offset) override { - OS << "\t.seh_save_freg d" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveFRegX(unsigned Reg, int Offset) override { - OS << "\t.seh_save_freg_x d" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveFRegP(unsigned Reg, int Offset) override { - OS << "\t.seh_save_fregp d" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISaveFRegPX(unsigned Reg, int Offset) override { - OS << "\t.seh_save_fregp_x d" << Reg << ", " << Offset << "\n"; - } - void EmitARM64WinCFISetFP() override { OS << "\t.seh_set_fp\n"; } - void EmitARM64WinCFIAddFP(unsigned Size) override { - OS << "\t.seh_add_fp " << Size << "\n"; - } - void EmitARM64WinCFINop() override { OS << "\t.seh_nop\n"; } - void EmitARM64WinCFISaveNext() override { OS << "\t.seh_save_next\n"; } - void EmitARM64WinCFIPrologEnd() override { OS << "\t.seh_endprologue\n"; } - void EmitARM64WinCFIEpilogStart() override { OS << "\t.seh_startepilogue\n"; } - void EmitARM64WinCFIEpilogEnd() override { OS << "\t.seh_endepilogue\n"; } - void EmitARM64WinCFITrapFrame() override { OS << "\t.seh_trap_frame\n"; } - void EmitARM64WinCFIMachineFrame() override { OS << "\t.seh_pushframe\n"; } - void EmitARM64WinCFIContext() override { OS << "\t.seh_context\n"; } - void EmitARM64WinCFIClearUnwoundToCall() override { - OS << "\t.seh_clear_unwound_to_call\n"; - } - + void EmitARM64WinCFIAllocStack(unsigned Size) override { + OS << "\t.seh_stackalloc " << Size << "\n"; + } + void EmitARM64WinCFISaveR19R20X(int Offset) override { + OS << "\t.seh_save_r19r20_x " << Offset << "\n"; + } + void EmitARM64WinCFISaveFPLR(int Offset) override { + OS << "\t.seh_save_fplr " << Offset << "\n"; + } + void EmitARM64WinCFISaveFPLRX(int Offset) override { + OS << "\t.seh_save_fplr_x " << Offset << "\n"; + } + void EmitARM64WinCFISaveReg(unsigned Reg, int Offset) override { + OS << "\t.seh_save_reg x" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveRegX(unsigned Reg, int Offset) override { + OS << "\t.seh_save_reg_x x" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveRegP(unsigned Reg, int Offset) override { + OS << "\t.seh_save_regp x" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveRegPX(unsigned Reg, int Offset) override { + OS << "\t.seh_save_regp_x x" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveLRPair(unsigned Reg, int Offset) override { + OS << "\t.seh_save_lrpair x" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveFReg(unsigned Reg, int Offset) override { + OS << "\t.seh_save_freg d" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveFRegX(unsigned Reg, int Offset) override { + OS << "\t.seh_save_freg_x d" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveFRegP(unsigned Reg, int Offset) override { + OS << "\t.seh_save_fregp d" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISaveFRegPX(unsigned Reg, int Offset) override { + OS << "\t.seh_save_fregp_x d" << Reg << ", " << Offset << "\n"; + } + void EmitARM64WinCFISetFP() override { OS << "\t.seh_set_fp\n"; } + void EmitARM64WinCFIAddFP(unsigned Size) override { + OS << "\t.seh_add_fp " << Size << "\n"; + } + void EmitARM64WinCFINop() override { OS << "\t.seh_nop\n"; } + void EmitARM64WinCFISaveNext() override { OS << "\t.seh_save_next\n"; } + void EmitARM64WinCFIPrologEnd() override { OS << "\t.seh_endprologue\n"; } + void EmitARM64WinCFIEpilogStart() override { OS << "\t.seh_startepilogue\n"; } + void EmitARM64WinCFIEpilogEnd() override { OS << "\t.seh_endepilogue\n"; } + void EmitARM64WinCFITrapFrame() override { OS << "\t.seh_trap_frame\n"; } + void EmitARM64WinCFIMachineFrame() override { OS << "\t.seh_pushframe\n"; } + void EmitARM64WinCFIContext() override { OS << "\t.seh_context\n"; } + void EmitARM64WinCFIClearUnwoundToCall() override { + OS << "\t.seh_clear_unwound_to_call\n"; + } + public: AArch64TargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS); }; diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp index 4aeb45ac21..340120d2b9 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp @@ -849,7 +849,7 @@ bool AArch64InstPrinter::printSysAlias(const MCInst *MI, } break; } - } else if (CnVal == 8 || CnVal == 9) { + } else if (CnVal == 8 || CnVal == 9) { // TLBI aliases const AArch64TLBI::TLBI *TLBI = AArch64TLBI::lookupTLBIByEncoding(Encoding); if (!TLBI || !TLBI->haveFeatures(STI.getFeatureBits())) @@ -1377,8 +1377,8 @@ void AArch64InstPrinter::printAlignedLabel(const MCInst *MI, uint64_t Address, } } -void AArch64InstPrinter::printAdrpLabel(const MCInst *MI, uint64_t Address, - unsigned OpNum, +void AArch64InstPrinter::printAdrpLabel(const MCInst *MI, uint64_t Address, + unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNum); @@ -1386,11 +1386,11 @@ void AArch64InstPrinter::printAdrpLabel(const MCInst *MI, uint64_t Address, // If the label has already been resolved to an immediate offset (say, when // we're running the disassembler), just print the immediate. if (Op.isImm()) { - const int64_t Offset = Op.getImm() * 4096; - if (PrintBranchImmAsAddress) - O << formatHex((Address & -4096) + Offset); - else - O << "#" << Offset; + const int64_t Offset = Op.getImm() * 4096; + if (PrintBranchImmAsAddress) + O << formatHex((Address & -4096) + Offset); + else + O << "#" << Offset; return; } @@ -1421,22 +1421,22 @@ void AArch64InstPrinter::printBarrierOption(const MCInst *MI, unsigned OpNo, O << "#" << Val; } -void AArch64InstPrinter::printBarriernXSOption(const MCInst *MI, unsigned OpNo, - const MCSubtargetInfo &STI, - raw_ostream &O) { - unsigned Val = MI->getOperand(OpNo).getImm(); - assert(MI->getOpcode() == AArch64::DSBnXS); - - StringRef Name; - auto DB = AArch64DBnXS::lookupDBnXSByEncoding(Val); - Name = DB ? DB->Name : ""; - - if (!Name.empty()) - O << Name; - else - O << "#" << Val; -} - +void AArch64InstPrinter::printBarriernXSOption(const MCInst *MI, unsigned OpNo, + const MCSubtargetInfo &STI, + raw_ostream &O) { + unsigned Val = MI->getOperand(OpNo).getImm(); + assert(MI->getOpcode() == AArch64::DSBnXS); + + StringRef Name; + auto DB = AArch64DBnXS::lookupDBnXSByEncoding(Val); + Name = DB ? DB->Name : ""; + + if (!Name.empty()) + O << Name; + else + O << "#" << Val; +} + void AArch64InstPrinter::printMRSSystemRegister(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O) { @@ -1644,10 +1644,10 @@ void AArch64InstPrinter::printGPR64as32(const MCInst *MI, unsigned OpNum, unsigned Reg = MI->getOperand(OpNum).getReg(); O << getRegisterName(getWRegFromXReg(Reg)); } - -void AArch64InstPrinter::printGPR64x8(const MCInst *MI, unsigned OpNum, - const MCSubtargetInfo &STI, - raw_ostream &O) { - unsigned Reg = MI->getOperand(OpNum).getReg(); - O << getRegisterName(MRI.getSubReg(Reg, AArch64::x8sub_0)); -} + +void AArch64InstPrinter::printGPR64x8(const MCInst *MI, unsigned OpNum, + const MCSubtargetInfo &STI, + raw_ostream &O) { + unsigned Reg = MI->getOperand(OpNum).getReg(); + O << getRegisterName(MRI.getSubReg(Reg, AArch64::x8sub_0)); +} diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h index b1952ebd27..4be885e667 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h @@ -30,7 +30,7 @@ public: void printRegName(raw_ostream &OS, unsigned RegNo) const override; // Autogenerated by tblgen. - std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override; + std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override; virtual void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O); virtual bool printAliasInstr(const MCInst *MI, uint64_t Address, @@ -156,12 +156,12 @@ protected: void printVectorIndex(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O); - void printAdrpLabel(const MCInst *MI, uint64_t Address, unsigned OpNum, + void printAdrpLabel(const MCInst *MI, uint64_t Address, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O); void printBarrierOption(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O); - void printBarriernXSOption(const MCInst *MI, unsigned OpNum, - const MCSubtargetInfo &STI, raw_ostream &O); + void printBarriernXSOption(const MCInst *MI, unsigned OpNum, + const MCSubtargetInfo &STI, raw_ostream &O); void printMSRSystemRegister(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O); void printMRSSystemRegister(const MCInst *MI, unsigned OpNum, @@ -190,8 +190,8 @@ protected: const MCSubtargetInfo &STI, raw_ostream &O); void printGPR64as32(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O); - void printGPR64x8(const MCInst *MI, unsigned OpNum, - const MCSubtargetInfo &STI, raw_ostream &O); + void printGPR64x8(const MCInst *MI, unsigned OpNum, + const MCSubtargetInfo &STI, raw_ostream &O); template <int Width> void printZPRasFPR(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O); @@ -208,7 +208,7 @@ public: void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override; - std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override; + std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override; void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O) override; bool printAliasInstr(const MCInst *MI, uint64_t Address, diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp index 257ecd33d2..68c721cb0d 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp @@ -73,7 +73,7 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(const Triple &T) { // targeting ELF. AssemblerDialect = AsmWriterVariant == Default ? Generic : AsmWriterVariant; - CodePointerSize = T.getEnvironment() == Triple::GNUILP32 ? 4 : 8; + CodePointerSize = T.getEnvironment() == Triple::GNUILP32 ? 4 : 8; // ".comm align is in bytes but .align is pow-2." AlignmentIsInBytes = false; @@ -111,7 +111,7 @@ AArch64MCAsmInfoMicrosoftCOFF::AArch64MCAsmInfoMicrosoftCOFF() { SupportsDebugInformation = true; CodePointerSize = 8; - CommentString = "//"; + CommentString = "//"; ExceptionsType = ExceptionHandling::WinEH; WinEHEncodingType = WinEH::EncodingType::Itanium; } diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp index dd975cd363..844bd6bbad 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp @@ -70,7 +70,7 @@ StringRef AArch64MCExpr::getVariantKindName() const { case VK_ABS_PAGE_NC: return ":pg_hi21_nc:"; case VK_GOT: return ":got:"; case VK_GOT_PAGE: return ":got:"; - case VK_GOT_PAGE_LO15: return ":gotpage_lo15:"; + case VK_GOT_PAGE_LO15: return ":gotpage_lo15:"; case VK_GOT_LO12: return ":got_lo12:"; case VK_GOTTPREL: return ":gottprel:"; case VK_GOTTPREL_PAGE: return ":gottprel:"; diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h index 6e191cd455..d3e834a140 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h @@ -46,7 +46,7 @@ public: VK_G1 = 0x050, VK_G2 = 0x060, VK_G3 = 0x070, - VK_LO15 = 0x080, + VK_LO15 = 0x080, VK_AddressFragBits = 0x0f0, // Whether the final relocation is a checked one (where a linker should @@ -83,7 +83,7 @@ public: VK_PREL_G0_NC = VK_PREL | VK_G0 | VK_NC, VK_GOT_LO12 = VK_GOT | VK_PAGEOFF | VK_NC, VK_GOT_PAGE = VK_GOT | VK_PAGE, - VK_GOT_PAGE_LO15 = VK_GOT | VK_LO15 | VK_NC, + VK_GOT_PAGE_LO15 = VK_GOT | VK_LO15 | VK_NC, VK_DTPREL_G2 = VK_DTPREL | VK_G2, VK_DTPREL_G1 = VK_DTPREL | VK_G1, VK_DTPREL_G1_NC = VK_DTPREL | VK_G1 | VK_NC, diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp index 98dcd9a96a..3c2df1621e 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp @@ -50,14 +50,14 @@ static MCInstrInfo *createAArch64MCInstrInfo() { static MCSubtargetInfo * createAArch64MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { - if (CPU.empty()) { + if (CPU.empty()) { CPU = "generic"; - if (TT.isArm64e()) - CPU = "apple-a12"; - } - - return createAArch64MCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS); + if (TT.isArm64e()) + CPU = "apple-a12"; + } + + return createAArch64MCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS); } void AArch64_MC::initLLVMToCVRegMapping(MCRegisterInfo *MRI) { diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp index f2384aa588..012661edbb 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp @@ -373,11 +373,11 @@ void AArch64MachObjectWriter::recordRelocation( Type == MachO::ARM64_RELOC_PAGE21 || Type == MachO::ARM64_RELOC_PAGEOFF12) && Value) { - if (!isInt<24>(Value)) { - Asm.getContext().reportError(Fixup.getLoc(), - "addend too big for relocation"); - return; - } + if (!isInt<24>(Value)) { + Asm.getContext().reportError(Fixup.getLoc(), + "addend too big for relocation"); + return; + } MachO::any_relocation_info MRE; MRE.r_word0 = FixupOffset; diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp index 8f3e876061..f32a8f15b8 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp @@ -11,23 +11,23 @@ //===----------------------------------------------------------------------===// #include "AArch64TargetStreamer.h" -#include "AArch64MCAsmInfo.h" -#include "AArch64Subtarget.h" -#include "llvm/BinaryFormat/ELF.h" +#include "AArch64MCAsmInfo.h" +#include "AArch64Subtarget.h" +#include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/ConstantPools.h" -#include "llvm/MC/MCContext.h" +#include "llvm/MC/MCContext.h" #include "llvm/MC/MCSection.h" -#include "llvm/MC/MCSectionELF.h" +#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/Support/CommandLine.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; -static cl::opt<bool> MarkBTIProperty( - "aarch64-mark-bti-property", cl::Hidden, - cl::desc("Add .note.gnu.property with BTI to assembly files"), - cl::init(false)); - +static cl::opt<bool> MarkBTIProperty( + "aarch64-mark-bti-property", cl::Hidden, + cl::desc("Add .note.gnu.property with BTI to assembly files"), + cl::init(false)); + // // AArch64TargetStreamer Implemenation // @@ -48,51 +48,51 @@ void AArch64TargetStreamer::emitCurrentConstantPool() { ConstantPools->emitForCurrentSection(Streamer); } -// finish() - write out any non-empty assembler constant pools and -// write out note.gnu.properties if need. -void AArch64TargetStreamer::finish() { - ConstantPools->emitAll(Streamer); - - if (MarkBTIProperty) - emitNoteSection(ELF::GNU_PROPERTY_AARCH64_FEATURE_1_BTI); -} - -void AArch64TargetStreamer::emitNoteSection(unsigned Flags) { - if (Flags == 0) - return; - - MCStreamer &OutStreamer = getStreamer(); - MCContext &Context = OutStreamer.getContext(); - // Emit a .note.gnu.property section with the flags. - MCSectionELF *Nt = Context.getELFSection(".note.gnu.property", ELF::SHT_NOTE, - ELF::SHF_ALLOC); - if (Nt->isRegistered()) { - SMLoc Loc; - Context.reportWarning( - Loc, - "The .note.gnu.property is not emitted because it is already present."); - return; - } - MCSection *Cur = OutStreamer.getCurrentSectionOnly(); - OutStreamer.SwitchSection(Nt); - - // Emit the note header. - OutStreamer.emitValueToAlignment(Align(8).value()); - OutStreamer.emitIntValue(4, 4); // data size for "GNU\0" - OutStreamer.emitIntValue(4 * 4, 4); // Elf_Prop size - OutStreamer.emitIntValue(ELF::NT_GNU_PROPERTY_TYPE_0, 4); - OutStreamer.emitBytes(StringRef("GNU", 4)); // note name - - // Emit the PAC/BTI properties. - OutStreamer.emitIntValue(ELF::GNU_PROPERTY_AARCH64_FEATURE_1_AND, 4); - OutStreamer.emitIntValue(4, 4); // data size - OutStreamer.emitIntValue(Flags, 4); // data - OutStreamer.emitIntValue(0, 4); // pad - - OutStreamer.endSection(Nt); - OutStreamer.SwitchSection(Cur); -} - +// finish() - write out any non-empty assembler constant pools and +// write out note.gnu.properties if need. +void AArch64TargetStreamer::finish() { + ConstantPools->emitAll(Streamer); + + if (MarkBTIProperty) + emitNoteSection(ELF::GNU_PROPERTY_AARCH64_FEATURE_1_BTI); +} + +void AArch64TargetStreamer::emitNoteSection(unsigned Flags) { + if (Flags == 0) + return; + + MCStreamer &OutStreamer = getStreamer(); + MCContext &Context = OutStreamer.getContext(); + // Emit a .note.gnu.property section with the flags. + MCSectionELF *Nt = Context.getELFSection(".note.gnu.property", ELF::SHT_NOTE, + ELF::SHF_ALLOC); + if (Nt->isRegistered()) { + SMLoc Loc; + Context.reportWarning( + Loc, + "The .note.gnu.property is not emitted because it is already present."); + return; + } + MCSection *Cur = OutStreamer.getCurrentSectionOnly(); + OutStreamer.SwitchSection(Nt); + + // Emit the note header. + OutStreamer.emitValueToAlignment(Align(8).value()); + OutStreamer.emitIntValue(4, 4); // data size for "GNU\0" + OutStreamer.emitIntValue(4 * 4, 4); // Elf_Prop size + OutStreamer.emitIntValue(ELF::NT_GNU_PROPERTY_TYPE_0, 4); + OutStreamer.emitBytes(StringRef("GNU", 4)); // note name + + // Emit the PAC/BTI properties. + OutStreamer.emitIntValue(ELF::GNU_PROPERTY_AARCH64_FEATURE_1_AND, 4); + OutStreamer.emitIntValue(4, 4); // data size + OutStreamer.emitIntValue(Flags, 4); // data + OutStreamer.emitIntValue(0, 4); // pad + + OutStreamer.endSection(Nt); + OutStreamer.SwitchSection(Cur); +} + void AArch64TargetStreamer::emitInst(uint32_t Inst) { char Buffer[4]; diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h index 5212d70a57..73dc1e5d4d 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h @@ -33,9 +33,9 @@ public: /// Emit contents of constant pool for the current section. void emitCurrentConstantPool(); - /// Callback used to implement the .note.gnu.property section. - void emitNoteSection(unsigned Flags); - + /// Callback used to implement the .note.gnu.property section. + void emitNoteSection(unsigned Flags); + /// Callback used to implement the .inst directive. virtual void emitInst(uint32_t Inst); @@ -43,14 +43,14 @@ public: virtual void emitDirectiveVariantPCS(MCSymbol *Symbol) {}; virtual void EmitARM64WinCFIAllocStack(unsigned Size) {} - virtual void EmitARM64WinCFISaveR19R20X(int Offset) {} + virtual void EmitARM64WinCFISaveR19R20X(int Offset) {} virtual void EmitARM64WinCFISaveFPLR(int Offset) {} virtual void EmitARM64WinCFISaveFPLRX(int Offset) {} virtual void EmitARM64WinCFISaveReg(unsigned Reg, int Offset) {} virtual void EmitARM64WinCFISaveRegX(unsigned Reg, int Offset) {} virtual void EmitARM64WinCFISaveRegP(unsigned Reg, int Offset) {} virtual void EmitARM64WinCFISaveRegPX(unsigned Reg, int Offset) {} - virtual void EmitARM64WinCFISaveLRPair(unsigned Reg, int Offset) {} + virtual void EmitARM64WinCFISaveLRPair(unsigned Reg, int Offset) {} virtual void EmitARM64WinCFISaveFReg(unsigned Reg, int Offset) {} virtual void EmitARM64WinCFISaveFRegX(unsigned Reg, int Offset) {} virtual void EmitARM64WinCFISaveFRegP(unsigned Reg, int Offset) {} @@ -58,14 +58,14 @@ public: virtual void EmitARM64WinCFISetFP() {} virtual void EmitARM64WinCFIAddFP(unsigned Size) {} virtual void EmitARM64WinCFINop() {} - virtual void EmitARM64WinCFISaveNext() {} + virtual void EmitARM64WinCFISaveNext() {} virtual void EmitARM64WinCFIPrologEnd() {} virtual void EmitARM64WinCFIEpilogStart() {} virtual void EmitARM64WinCFIEpilogEnd() {} - virtual void EmitARM64WinCFITrapFrame() {} - virtual void EmitARM64WinCFIMachineFrame() {} - virtual void EmitARM64WinCFIContext() {} - virtual void EmitARM64WinCFIClearUnwoundToCall() {} + virtual void EmitARM64WinCFITrapFrame() {} + virtual void EmitARM64WinCFIMachineFrame() {} + virtual void EmitARM64WinCFIContext() {} + virtual void EmitARM64WinCFIClearUnwoundToCall() {} private: std::unique_ptr<AssemblerConstantPools> ConstantPools; @@ -96,14 +96,14 @@ public: // The unwind codes on ARM64 Windows are documented at // https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling void EmitARM64WinCFIAllocStack(unsigned Size) override; - void EmitARM64WinCFISaveR19R20X(int Offset) override; + void EmitARM64WinCFISaveR19R20X(int Offset) override; void EmitARM64WinCFISaveFPLR(int Offset) override; void EmitARM64WinCFISaveFPLRX(int Offset) override; void EmitARM64WinCFISaveReg(unsigned Reg, int Offset) override; void EmitARM64WinCFISaveRegX(unsigned Reg, int Offset) override; void EmitARM64WinCFISaveRegP(unsigned Reg, int Offset) override; void EmitARM64WinCFISaveRegPX(unsigned Reg, int Offset) override; - void EmitARM64WinCFISaveLRPair(unsigned Reg, int Offset) override; + void EmitARM64WinCFISaveLRPair(unsigned Reg, int Offset) override; void EmitARM64WinCFISaveFReg(unsigned Reg, int Offset) override; void EmitARM64WinCFISaveFRegX(unsigned Reg, int Offset) override; void EmitARM64WinCFISaveFRegP(unsigned Reg, int Offset) override; @@ -111,15 +111,15 @@ public: void EmitARM64WinCFISetFP() override; void EmitARM64WinCFIAddFP(unsigned Size) override; void EmitARM64WinCFINop() override; - void EmitARM64WinCFISaveNext() override; + void EmitARM64WinCFISaveNext() override; void EmitARM64WinCFIPrologEnd() override; void EmitARM64WinCFIEpilogStart() override; void EmitARM64WinCFIEpilogEnd() override; - void EmitARM64WinCFITrapFrame() override; - void EmitARM64WinCFIMachineFrame() override; - void EmitARM64WinCFIContext() override; - void EmitARM64WinCFIClearUnwoundToCall() override; - + void EmitARM64WinCFITrapFrame() override; + void EmitARM64WinCFIMachineFrame() override; + void EmitARM64WinCFIContext() override; + void EmitARM64WinCFIClearUnwoundToCall() override; + private: void EmitARM64WinUnwindCode(unsigned UnwindCode, int Reg, int Offset); }; diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp index 603446f40d..1c50706a26 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp @@ -28,7 +28,7 @@ public: void EmitWinEHHandlerData(SMLoc Loc) override; void EmitWindowsUnwindTables() override; - void EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) override; + void EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) override; void finishImpl() override; }; @@ -37,14 +37,14 @@ void AArch64WinCOFFStreamer::EmitWinEHHandlerData(SMLoc Loc) { // We have to emit the unwind info now, because this directive // actually switches to the .xdata section! - EHStreamer.EmitUnwindInfo(*this, getCurrentWinFrameInfo(), - /* HandlerData = */ true); + EHStreamer.EmitUnwindInfo(*this, getCurrentWinFrameInfo(), + /* HandlerData = */ true); +} + +void AArch64WinCOFFStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) { + EHStreamer.EmitUnwindInfo(*this, Frame, /* HandlerData = */ false); } -void AArch64WinCOFFStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) { - EHStreamer.EmitUnwindInfo(*this, Frame, /* HandlerData = */ false); -} - void AArch64WinCOFFStreamer::EmitWindowsUnwindTables() { if (!getNumWinFrameInfos()) return; @@ -91,10 +91,10 @@ void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIAllocStack(unsigned Size) { EmitARM64WinUnwindCode(Op, -1, Size); } -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveR19R20X(int Offset) { - EmitARM64WinUnwindCode(Win64EH::UOP_SaveR19R20X, -1, Offset); -} - +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveR19R20X(int Offset) { + EmitARM64WinUnwindCode(Win64EH::UOP_SaveR19R20X, -1, Offset); +} + void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveFPLR(int Offset) { EmitARM64WinUnwindCode(Win64EH::UOP_SaveFPLR, -1, Offset); } @@ -125,11 +125,11 @@ void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveRegPX(unsigned Reg, EmitARM64WinUnwindCode(Win64EH::UOP_SaveRegPX, Reg, Offset); } -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveLRPair(unsigned Reg, - int Offset) { - EmitARM64WinUnwindCode(Win64EH::UOP_SaveLRPair, Reg, Offset); -} - +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveLRPair(unsigned Reg, + int Offset) { + EmitARM64WinUnwindCode(Win64EH::UOP_SaveLRPair, Reg, Offset); +} + void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveFReg(unsigned Reg, int Offset) { assert(Offset >= 0 && Offset <= 504 && @@ -165,10 +165,10 @@ void AArch64TargetWinCOFFStreamer::EmitARM64WinCFINop() { EmitARM64WinUnwindCode(Win64EH::UOP_Nop, -1, 0); } -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveNext() { - EmitARM64WinUnwindCode(Win64EH::UOP_SaveNext, -1, 0); -} - +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFISaveNext() { + EmitARM64WinUnwindCode(Win64EH::UOP_SaveNext, -1, 0); +} + // The functions below handle opcodes that can end up in either a prolog or // an epilog, but not both. void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIPrologEnd() { @@ -207,22 +207,22 @@ void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIEpilogEnd() { CurrentEpilog = nullptr; } -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFITrapFrame() { - EmitARM64WinUnwindCode(Win64EH::UOP_TrapFrame, -1, 0); -} - -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIMachineFrame() { - EmitARM64WinUnwindCode(Win64EH::UOP_PushMachFrame, -1, 0); -} - -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIContext() { - EmitARM64WinUnwindCode(Win64EH::UOP_Context, -1, 0); -} - -void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIClearUnwoundToCall() { - EmitARM64WinUnwindCode(Win64EH::UOP_ClearUnwoundToCall, -1, 0); -} - +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFITrapFrame() { + EmitARM64WinUnwindCode(Win64EH::UOP_TrapFrame, -1, 0); +} + +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIMachineFrame() { + EmitARM64WinUnwindCode(Win64EH::UOP_PushMachFrame, -1, 0); +} + +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIContext() { + EmitARM64WinUnwindCode(Win64EH::UOP_Context, -1, 0); +} + +void AArch64TargetWinCOFFStreamer::EmitARM64WinCFIClearUnwoundToCall() { + EmitARM64WinUnwindCode(Win64EH::UOP_ClearUnwoundToCall, -1, 0); +} + MCWinCOFFStreamer *createAArch64WinCOFFStreamer( MCContext &Context, std::unique_ptr<MCAsmBackend> MAB, std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter> Emitter, diff --git a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/ya.make b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/ya.make index 9a6f23a3c8..18b5c7460f 100644 --- a/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/ya.make +++ b/contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc/ya.make @@ -12,19 +12,19 @@ LICENSE(Apache-2.0 WITH LLVM-exception) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( - contrib/libs/llvm12 - contrib/libs/llvm12/include - contrib/libs/llvm12/lib/BinaryFormat - contrib/libs/llvm12/lib/MC - contrib/libs/llvm12/lib/Support - contrib/libs/llvm12/lib/Target/AArch64/TargetInfo - contrib/libs/llvm12/lib/Target/AArch64/Utils + contrib/libs/llvm12 + contrib/libs/llvm12/include + contrib/libs/llvm12/lib/BinaryFormat + contrib/libs/llvm12/lib/MC + contrib/libs/llvm12/lib/Support + contrib/libs/llvm12/lib/Target/AArch64/TargetInfo + contrib/libs/llvm12/lib/Target/AArch64/Utils ) ADDINCL( - ${ARCADIA_BUILD_ROOT}/contrib/libs/llvm12/lib/Target/AArch64 - contrib/libs/llvm12/lib/Target/AArch64 - contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc + ${ARCADIA_BUILD_ROOT}/contrib/libs/llvm12/lib/Target/AArch64 + contrib/libs/llvm12/lib/Target/AArch64 + contrib/libs/llvm12/lib/Target/AArch64/MCTargetDesc ) NO_COMPILER_WARNINGS() |