41 if (Features[CSKY::ProcCK801])
43 else if (Features[CSKY::ProcCK802])
45 else if (Features[CSKY::ProcCK803])
47 else if (Features[CSKY::ProcCK804])
49 else if (Features[CSKY::ProcCK805])
51 else if (Features[CSKY::ProcCK807])
53 else if (Features[CSKY::ProcCK810])
55 else if (Features[CSKY::ProcCK860])
60 if (Features[CSKY::FeatureFPUV2_SF] || Features[CSKY::FeatureFPUV3_SF])
72void CSKYTargetELFStreamer::emitAttribute(
unsigned Attribute,
unsigned Value) {
76void CSKYTargetELFStreamer::emitTextAttribute(
unsigned Attribute,
81void CSKYTargetELFStreamer::finishAttributeSection() {
85 if (AttributeSection) {
96 const size_t VendorHeaderSize = 4 + CurrentVendor.
size() + 1;
99 const size_t TagHeaderSize = 1 + 4;
101 const size_t ContentsSize = calculateContentSize();
112 for (AttributeItem item : Contents) {
117 case AttributeType::Numeric:
120 case AttributeType::Text:
124 case AttributeType::NumericAndText:
135size_t CSKYTargetELFStreamer::calculateContentSize()
const {
137 for (AttributeItem item : Contents) {
139 case AttributeType::Hidden:
141 case AttributeType::Numeric:
145 case AttributeType::Text:
147 Result += item.StringValue.size() + 1;
149 case AttributeType::NumericAndText:
152 Result += item.StringValue.size() + 1;
172 Name +
"." +
Twine(MappingSymbolCounter++)));
179void CSKYTargetELFStreamer::emitTargetAttributes(
const MCSubtargetInfo &STI) {
183 if (ArchID == CSKY::ArchKind::CK804)
184 ArchID = CSKY::ArchKind::CK803;
188 if (ArchID == CSKY::ArchKind::INVALID) {
195 unsigned ISAFlag = 0;
270 unsigned ISAExtFlag = 0;
300 else if (STI.
hasFeature(CSKY::FeatureFPUV3_HF) ||
305 bool hasAnyFloatExt = STI.
hasFeature(CSKY::FeatureFPUV2_SF) ||
311 if (hasAnyFloatExt && STI.
hasFeature(CSKY::ModeHardFloat) &&
314 else if (hasAnyFloatExt && STI.
hasFeature(CSKY::ModeHardFloat))
319 unsigned HardFPFlag = 0;
329 if (HardFPFlag != 0) {
MCELFStreamer & getStreamer()
CSKYTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Container class for subtarget features.
MCContext & getContext() const
unsigned getELFHeaderEFlags() const
ELF e_header flags.
void setELFHeaderEFlags(unsigned Flags)
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
MCAssembler & getAssembler()
Streaming machine code generation interface.
MCContext & getContext() const
unsigned emitULEB128IntValue(uint64_t Value, unsigned PadTo=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
virtual void switchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
void emitInt32(uint64_t Value)
void emitInt8(uint64_t Value)
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
const FeatureBitset & getFeatureBits() const
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ArchKind parseCPUArch(StringRef CPU)
StringRef getArchName(ArchKind AK)
This is an optimization pass for GlobalISel generic memory operations.
unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.