mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 04:24:22 +00:00
ARM64: initial backend import
This adds a second implementation of the AArch64 architecture to LLVM, accessible in parallel via the "arm64" triple. The plan over the coming weeks & months is to merge the two into a single backend, during which time thorough code review should naturally occur. Everything will be easier with the target in-tree though, hence this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/Object/MachO.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/Support/DataExtractor.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
@ -934,6 +935,23 @@ MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
|
||||
res = Table[RType];
|
||||
break;
|
||||
}
|
||||
case Triple::arm64:
|
||||
case Triple::aarch64: {
|
||||
static const char *const Table[] = {
|
||||
"ARM64_RELOC_UNSIGNED", "ARM64_RELOC_SUBTRACTOR",
|
||||
"ARM64_RELOC_BRANCH26", "ARM64_RELOC_PAGE21",
|
||||
"ARM64_RELOC_PAGEOFF12", "ARM64_RELOC_GOT_LOAD_PAGE21",
|
||||
"ARM64_RELOC_GOT_LOAD_PAGEOFF12", "ARM64_RELOC_POINTER_TO_GOT",
|
||||
"ARM64_RELOC_TLVP_LOAD_PAGE21", "ARM64_RELOC_TLVP_LOAD_PAGEOFF12",
|
||||
"ARM64_RELOC_ADDEND"
|
||||
};
|
||||
|
||||
if (RType >= array_lengthof(Table))
|
||||
res = "Unknown";
|
||||
else
|
||||
res = Table[RType];
|
||||
break;
|
||||
}
|
||||
case Triple::ppc: {
|
||||
static const char *const Table[] = {
|
||||
"PPC_RELOC_VANILLA",
|
||||
@ -1256,6 +1274,8 @@ StringRef MachOObjectFile::getFileFormatName() const {
|
||||
switch (CPUType) {
|
||||
case llvm::MachO::CPU_TYPE_X86_64:
|
||||
return "Mach-O 64-bit x86-64";
|
||||
case llvm::MachO::CPU_TYPE_ARM64:
|
||||
return "Mach-O arm64";
|
||||
case llvm::MachO::CPU_TYPE_POWERPC64:
|
||||
return "Mach-O 64-bit ppc64";
|
||||
default:
|
||||
@ -1271,6 +1291,8 @@ Triple::ArchType MachOObjectFile::getArch(uint32_t CPUType) {
|
||||
return Triple::x86_64;
|
||||
case llvm::MachO::CPU_TYPE_ARM:
|
||||
return Triple::arm;
|
||||
case llvm::MachO::CPU_TYPE_ARM64:
|
||||
return Triple::arm64;
|
||||
case llvm::MachO::CPU_TYPE_POWERPC:
|
||||
return Triple::ppc;
|
||||
case llvm::MachO::CPU_TYPE_POWERPC64:
|
||||
|
Reference in New Issue
Block a user