1 //===-- MipsABIFlagsSection.cpp - Mips ELF ABI Flags Section ---*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "MipsABIFlagsSection.h"
14 StringRef MipsABIFlagsSection::getFpABIString(Val_GNU_MIPS_ABI Value,
17 case MipsABIFlagsSection::Val_GNU_MIPS_ABI_FP_XX:
19 case MipsABIFlagsSection::Val_GNU_MIPS_ABI_FP_64:
21 case MipsABIFlagsSection::Val_GNU_MIPS_ABI_FP_DOUBLE:
26 llvm_unreachable("unsupported fp abi value");
31 MCStreamer &operator<<(MCStreamer &OS, MipsABIFlagsSection &ABIFlagsSection) {
32 // Write out a Elf_Internal_ABIFlags_v0 struct
33 OS.EmitIntValue(ABIFlagsSection.getVersion(), 2); // version
34 OS.EmitIntValue(ABIFlagsSection.getISALevel(), 1); // isa_level
35 OS.EmitIntValue(ABIFlagsSection.getISARevision(), 1); // isa_rev
36 OS.EmitIntValue(ABIFlagsSection.getGPRSize(), 1); // gpr_size
37 OS.EmitIntValue(ABIFlagsSection.getCPR1Size(), 1); // cpr1_size
38 OS.EmitIntValue(ABIFlagsSection.getCPR2Size(), 1); // cpr2_size
39 OS.EmitIntValue(ABIFlagsSection.getFpABI(), 1); // fp_abi
40 OS.EmitIntValue(ABIFlagsSection.getISAExtensionSet(), 4); // isa_ext
41 OS.EmitIntValue(ABIFlagsSection.getASESet(), 4); // ases
42 OS.EmitIntValue(ABIFlagsSection.getFlags1(), 4); // flags1
43 OS.EmitIntValue(ABIFlagsSection.getFlags2(), 4); // flags2