LLVM 22.0.0git
MipsABIFlagsSection.cpp
Go to the documentation of this file.
1//===- MipsABIFlagsSection.cpp - Mips ELF ABI Flags Section ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10#include "llvm/ADT/StringRef.h"
11#include "llvm/MC/MCStreamer.h"
14
15using namespace llvm;
16
36
38 switch (Value) {
39 case FpABIKind::XX:
40 return "xx";
41 case FpABIKind::S32:
42 return "32";
43 case FpABIKind::S64:
44 return "64";
45 default:
46 llvm_unreachable("unsupported fp abi value");
47 }
48}
49
55
56namespace llvm {
57
59 // Write out a Elf_Internal_ABIFlags_v0 struct
60 OS.emitIntValue(ABIFlagsSection.getVersionValue(), 2); // version
61 OS.emitIntValue(ABIFlagsSection.getISALevelValue(), 1); // isa_level
62 OS.emitIntValue(ABIFlagsSection.getISARevisionValue(), 1); // isa_rev
63 OS.emitIntValue(ABIFlagsSection.getGPRSizeValue(), 1); // gpr_size
64 OS.emitIntValue(ABIFlagsSection.getCPR1SizeValue(), 1); // cpr1_size
65 OS.emitIntValue(ABIFlagsSection.getCPR2SizeValue(), 1); // cpr2_size
66 OS.emitIntValue(ABIFlagsSection.getFpABIValue(), 1); // fp_abi
67 OS.emitIntValue(ABIFlagsSection.getISAExtensionValue(), 4); // isa_ext
68 OS.emitIntValue(ABIFlagsSection.getASESetValue(), 4); // ases
69 OS.emitIntValue(ABIFlagsSection.getFlags1Value(), 4); // flags1
70 OS.emitIntValue(ABIFlagsSection.getFlags2Value(), 4); // flags2
71 return OS;
72}
73
74} // end namespace llvm
Streaming machine code generation interface.
Definition MCStreamer.h:220
virtual void emitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
LLVM Value Representation.
Definition Value.h:75
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Val_GNU_MIPS_ABI_FP_SOFT
@ Val_GNU_MIPS_ABI_FP_DOUBLE
@ Val_GNU_MIPS_ABI_FP_XX
@ Val_GNU_MIPS_ABI_FP_ANY
@ Val_GNU_MIPS_ABI_FP_64A
@ Val_GNU_MIPS_ABI_FP_64
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
StringRef getFpABIString(FpABIKind Value)