blob: a901af2df75d13e53a3e8627e3ff40988829e731 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
//===-- MipsABIFlagsSection.cpp - Mips ELF ABI Flags Section ---*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "MipsABIFlagsSection.h"
using namespace llvm;
StringRef MipsABIFlagsSection::getFpABIString(Val_GNU_MIPS_ABI Value,
bool Is32BitAbi) {
switch (Value) {
case MipsABIFlagsSection::Val_GNU_MIPS_ABI_FP_XX:
return "xx";
case MipsABIFlagsSection::Val_GNU_MIPS_ABI_FP_64:
return "64";
case MipsABIFlagsSection::Val_GNU_MIPS_ABI_FP_DOUBLE:
if (Is32BitAbi)
return "32";
return "64";
default:
llvm_unreachable("unsupported fp abi value");
}
}
namespace llvm {
MCStreamer &operator<<(MCStreamer &OS, MipsABIFlagsSection &ABIFlagsSection) {
// Write out a Elf_Internal_ABIFlags_v0 struct
OS.EmitIntValue(ABIFlagsSection.getVersion(), 2); // version
OS.EmitIntValue(ABIFlagsSection.getISALevel(), 1); // isa_level
OS.EmitIntValue(ABIFlagsSection.getISARevision(), 1); // isa_rev
OS.EmitIntValue(ABIFlagsSection.getGPRSize(), 1); // gpr_size
OS.EmitIntValue(ABIFlagsSection.getCPR1Size(), 1); // cpr1_size
OS.EmitIntValue(ABIFlagsSection.getCPR2Size(), 1); // cpr2_size
OS.EmitIntValue(ABIFlagsSection.getFpABI(), 1); // fp_abi
OS.EmitIntValue(ABIFlagsSection.getISAExtensionSet(), 4); // isa_ext
OS.EmitIntValue(ABIFlagsSection.getASESet(), 4); // ases
OS.EmitIntValue(ABIFlagsSection.getFlags1(), 4); // flags1
OS.EmitIntValue(ABIFlagsSection.getFlags2(), 4); // flags2
return OS;
}
}
|