summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2014-03-07 13:15:57 -0800
committerTim Murray <timmurray@google.com>2014-03-14 17:13:27 -0700
commit8aa5ce8cbaa58d14493eb694f06c8a0fde23c509 (patch)
tree343d7ce8767a0a37430083e6b4a567ebb30c19f4
parent130045bafb1899ab3ba3a4eab679a7df08321796 (diff)
downloadexternal_llvm-8aa5ce8cbaa58d14493eb694f06c8a0fde23c509.zip
external_llvm-8aa5ce8cbaa58d14493eb694f06c8a0fde23c509.tar.gz
external_llvm-8aa5ce8cbaa58d14493eb694f06c8a0fde23c509.tar.bz2
Make LLVM build on AArch64.
bug 13343378 Change-Id: I4152d2437a144645fa0b5a425b7bfdcb3a2a5594
-rw-r--r--Android.mk10
-rw-r--r--device/include/llvm/Config/AsmParsers.def2
-rw-r--r--device/include/llvm/Config/AsmPrinters.def2
-rw-r--r--device/include/llvm/Config/Disassemblers.def2
-rw-r--r--device/include/llvm/Config/Targets.def4
-rw-r--r--host/include/llvm/Config/AsmParsers.def1
-rw-r--r--host/include/llvm/Config/AsmPrinters.def1
-rw-r--r--host/include/llvm/Config/Disassemblers.def1
-rw-r--r--host/include/llvm/Config/Targets.def1
-rw-r--r--include/llvm/Config/llvm-platform-config.h25
-rw-r--r--lib/Target/AArch64/AArch64InstrNEON.td13
-rw-r--r--lib/Target/AArch64/Android.mk64
-rw-r--r--lib/Target/AArch64/AsmParser/Android.mk61
-rw-r--r--lib/Target/AArch64/Disassembler/Android.mk53
-rw-r--r--lib/Target/AArch64/InstPrinter/Android.mk55
-rw-r--r--lib/Target/AArch64/MCTargetDesc/Android.mk55
-rw-r--r--lib/Target/AArch64/TargetInfo/Android.mk53
-rw-r--r--lib/Target/AArch64/Utils/Android.mk34
-rw-r--r--llvm.mk2
-rw-r--r--shared_llvm.mk11
-rw-r--r--tools/llc/Android.mk12
21 files changed, 455 insertions, 7 deletions
diff --git a/Android.mk b/Android.mk
index 4e1f6db..9f6e8a5 100644
--- a/Android.mk
+++ b/Android.mk
@@ -48,6 +48,16 @@ subdirs += \
lib/Target/ARM/MCTargetDesc \
lib/Target/ARM/TargetInfo
+# ARM64 Code Generation Libraries
+subdirs += \
+ lib/Target/AArch64 \
+ lib/Target/AArch64/AsmParser \
+ lib/Target/AArch64/InstPrinter \
+ lib/Target/AArch64/Disassembler \
+ lib/Target/AArch64/MCTargetDesc \
+ lib/Target/AArch64/TargetInfo \
+ lib/Target/AArch64/Utils
+
# MIPS Code Generation Libraries
subdirs += \
lib/Target/Mips \
diff --git a/device/include/llvm/Config/AsmParsers.def b/device/include/llvm/Config/AsmParsers.def
index 46d22a1..cf6b221 100644
--- a/device/include/llvm/Config/AsmParsers.def
+++ b/device/include/llvm/Config/AsmParsers.def
@@ -30,6 +30,8 @@
LLVM_ASM_PARSER(Mips)
#elif defined(__i386__)
LLVM_ASM_PARSER(X86)
+#elif defined(__aarch64__)
+ LLVM_ASM_PARSER(AArch64)
#else
# error Unsupported TARGET_ARCH for LLVM_ASM_PARSER
#endif
diff --git a/device/include/llvm/Config/AsmPrinters.def b/device/include/llvm/Config/AsmPrinters.def
index c9c7902..57502f1 100644
--- a/device/include/llvm/Config/AsmPrinters.def
+++ b/device/include/llvm/Config/AsmPrinters.def
@@ -30,6 +30,8 @@
LLVM_ASM_PRINTER(Mips)
#elif defined(__i386__)
LLVM_ASM_PRINTER(X86)
+#elif defined(__aarch64__)
+ LLVM_ASM_PRINTER(AArch64)
#else
# error Unsupported TARGET_ARCH for LLVM_ASM_PRINTER
#endif
diff --git a/device/include/llvm/Config/Disassemblers.def b/device/include/llvm/Config/Disassemblers.def
index 4a834ea..3f135e4 100644
--- a/device/include/llvm/Config/Disassemblers.def
+++ b/device/include/llvm/Config/Disassemblers.def
@@ -30,6 +30,8 @@
LLVM_DISASSEMBLER(Mips)
#elif defined(__i386__)
LLVM_DISASSEMBLER(X86)
+#elif defined(__aarch64__)
+ LLVM_DISASSEMBLER(AArch64)
#else
# error Unsupported TARGET_ARCH for LLVM_DISASSEMBLER
#endif
diff --git a/device/include/llvm/Config/Targets.def b/device/include/llvm/Config/Targets.def
index 4a16bb3..8a08894 100644
--- a/device/include/llvm/Config/Targets.def
+++ b/device/include/llvm/Config/Targets.def
@@ -29,8 +29,10 @@
LLVM_TARGET(Mips)
#elif defined(__i386__)
LLVM_TARGET(X86)
+#elif defined(__aarch64__)
+ LLVM_TARGET(AArch64)
#else
-# error Unsupported TARGET_ARCH for LLVM_ASM_PRINTER
+# error Unsupported TARGET_ARCH for LLVM_TARGET
#endif
#undef LLVM_TARGET
diff --git a/host/include/llvm/Config/AsmParsers.def b/host/include/llvm/Config/AsmParsers.def
index a03b5b6..8fd67da 100644
--- a/host/include/llvm/Config/AsmParsers.def
+++ b/host/include/llvm/Config/AsmParsers.def
@@ -27,5 +27,6 @@
LLVM_ASM_PARSER(ARM)
LLVM_ASM_PARSER(Mips)
LLVM_ASM_PARSER(X86)
+LLVM_ASM_PARSER(AArch64)
#undef LLVM_ASM_PARSER
diff --git a/host/include/llvm/Config/AsmPrinters.def b/host/include/llvm/Config/AsmPrinters.def
index ed417b0..07f6adf 100644
--- a/host/include/llvm/Config/AsmPrinters.def
+++ b/host/include/llvm/Config/AsmPrinters.def
@@ -27,5 +27,6 @@
LLVM_ASM_PRINTER(ARM)
LLVM_ASM_PRINTER(Mips)
LLVM_ASM_PRINTER(X86)
+LLVM_ASM_PRINTER(AArch64)
#undef LLVM_ASM_PRINTER
diff --git a/host/include/llvm/Config/Disassemblers.def b/host/include/llvm/Config/Disassemblers.def
index 408a77e..18557af 100644
--- a/host/include/llvm/Config/Disassemblers.def
+++ b/host/include/llvm/Config/Disassemblers.def
@@ -27,5 +27,6 @@
LLVM_DISASSEMBLER(ARM)
LLVM_DISASSEMBLER(Mips)
LLVM_DISASSEMBLER(X86)
+LLVM_DISASSEMBLER(AArch64)
#undef LLVM_DISASSEMBLER
diff --git a/host/include/llvm/Config/Targets.def b/host/include/llvm/Config/Targets.def
index 176bbbf..2985cf3 100644
--- a/host/include/llvm/Config/Targets.def
+++ b/host/include/llvm/Config/Targets.def
@@ -26,5 +26,6 @@
LLVM_TARGET(ARM)
LLVM_TARGET(Mips)
LLVM_TARGET(X86)
+LLVM_TARGET(AArch64)
#undef LLVM_TARGET
diff --git a/include/llvm/Config/llvm-platform-config.h b/include/llvm/Config/llvm-platform-config.h
index 9d47ffd..cd005be 100644
--- a/include/llvm/Config/llvm-platform-config.h
+++ b/include/llvm/Config/llvm-platform-config.h
@@ -89,6 +89,31 @@
/* LLVM name for the native target MC init function, if available */
#define LLVM_NATIVE_TARGETMC LLVMInitializeMipsTargetMC
+#elif defined(__aarch64__)
+
+/* LLVM architecture name for the native architecture, if available */
+#define LLVM_NATIVE_ARCH AArch64
+
+/* Host triple LLVM will be executed on */
+#define LLVM_HOST_TRIPLE "aarch64-none-linux-gnu"
+
+/* LLVM name for the native AsmParser init function, if available */
+#define LLVM_NATIVE_ASMPARSER LLVMInitializeAArch64AsmParser
+
+/* LLVM name for the native AsmPrinter init function, if available */
+#define LLVM_NATIVE_ASMPRINTER LLVMInitializeAArch64AsmPrinter
+
+/* LLVM name for the native Disassembler init function, if available */
+#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeAArch64Disassembler
+
+/* LLVM name for the native Target init function, if available */
+#define LLVM_NATIVE_TARGET LLVMInitializeAArch64Target
+
+/* LLVM name for the native TargetInfo init function, if available */
+#define LLVM_NATIVE_TARGETINFO LLVMInitializeAArch64TargetInfo
+
+/* LLVM name for the native target MC init function, if available */
+#define LLVM_NATIVE_TARGETMC LLVMInitializeAArch64TargetMC
#else
diff --git a/lib/Target/AArch64/AArch64InstrNEON.td b/lib/Target/AArch64/AArch64InstrNEON.td
index d71749d..fe73a05 100644
--- a/lib/Target/AArch64/AArch64InstrNEON.td
+++ b/lib/Target/AArch64/AArch64InstrNEON.td
@@ -5734,16 +5734,16 @@ defm : Neon_ScalarXIndexedElem_MLAL_Patterns<int_arm_neon_vqsubs,
// Scalar general arithmetic operation
class Neon_Scalar_GeneralMath2D_pattern<SDPatternOperator opnode,
- Instruction INST>
+ Instruction INST>
: Pat<(v1f64 (opnode (v1f64 FPR64:$Rn))), (INST FPR64:$Rn)>;
class Neon_Scalar_GeneralMath3D_pattern<SDPatternOperator opnode,
- Instruction INST>
+ Instruction INST>
: Pat<(v1f64 (opnode (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm))),
(INST FPR64:$Rn, FPR64:$Rm)>;
class Neon_Scalar_GeneralMath4D_pattern<SDPatternOperator opnode,
- Instruction INST>
+ Instruction INST>
: Pat<(v1f64 (opnode (v1f64 FPR64:$Rn), (v1f64 FPR64:$Rm),
(v1f64 FPR64:$Ra))),
(INST FPR64:$Rn, FPR64:$Rm, FPR64:$Ra)>;
@@ -6678,8 +6678,11 @@ def : Pat<(v1f32 (scalar_to_vector (f32 FPR32:$Rn))),
def : Pat<(v1f64 (scalar_to_vector (f64 FPR64:$Rn))),
(v1f64 FPR64:$Rn)>;
-def : Pat<(v1f64 (scalar_to_vector (f64 FPR64:$src))),
- (FMOVdd $src)>;
+// begin ANDROID-CHANGED-3-14-2014
+// duplicate symbol error if this is not commented out
+//def : Pat<(v1f64 (scalar_to_vector (f64 FPR64:$src))),
+// (FMOVdd $src)>;
+// end ANDROID-CHANGED-3-14-2014
def : Pat<(v2f64 (scalar_to_vector (f64 FPR64:$src))),
(INSERT_SUBREG (v2f64 (IMPLICIT_DEF)),
diff --git a/lib/Target/AArch64/Android.mk b/lib/Target/AArch64/Android.mk
new file mode 100644
index 0000000..3e1d50e
--- /dev/null
+++ b/lib/Target/AArch64/Android.mk
@@ -0,0 +1,64 @@
+LOCAL_PATH := $(call my-dir)
+
+arm64_codegen_TBLGEN_TABLES := \
+ AArch64GenRegisterInfo.inc \
+ AArch64GenInstrInfo.inc \
+ AArch64GenCodeEmitter.inc \
+ AArch64GenMCCodeEmitter.inc \
+ AArch64GenMCPseudoLowering.inc \
+ AArch64GenAsmWriter.inc \
+ AArch64GenAsmMatcher.inc \
+ AArch64GenDAGISel.inc \
+ AArch64GenFastISel.inc \
+ AArch64GenCallingConv.inc \
+ AArch64GenSubtargetInfo.inc \
+ AArch64GenDisassemblerTables.inc
+
+arm64_codegen_SRC_FILES := \
+ AArch64AsmPrinter.cpp \
+ AArch64FrameLowering.cpp \
+ AArch64ISelDAGToDAG.cpp \
+ AArch64MachineFunctionInfo.cpp \
+ AArch64RegisterInfo.cpp \
+ AArch64Subtarget.cpp \
+ AArch64TargetObjectFile.cpp \
+ AArch64BranchFixupPass.cpp \
+ AArch64InstrInfo.cpp \
+ AArch64ISelLowering.cpp \
+ AArch64MCInstLower.cpp \
+ AArch64SelectionDAGInfo.cpp \
+ AArch64TargetMachine.cpp
+
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+LOCAL_MODULE:= libLLVMARM64CodeGen
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(arm64_codegen_SRC_FILES)
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
+TBLGEN_TABLES := $(arm64_codegen_TBLGEN_TABLES)
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(LLVM_GEN_INTRINSICS_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device only
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+LOCAL_MODULE:= libLLVMARM64CodeGen
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(arm64_codegen_SRC_FILES)
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
+TBLGEN_TABLES := $(arm64_codegen_TBLGEN_TABLES)
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(LLVM_GEN_INTRINSICS_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/lib/Target/AArch64/AsmParser/Android.mk b/lib/Target/AArch64/AsmParser/Android.mk
new file mode 100644
index 0000000..899c84d
--- /dev/null
+++ b/lib/Target/AArch64/AsmParser/Android.mk
@@ -0,0 +1,61 @@
+LOCAL_PATH := $(call my-dir)
+
+#===---------------------------------------------------------------===
+# libARMAsmParser (common)
+#===---------------------------------------------------------------===
+
+arm64_asm_parser_SRC_FILES := \
+ AArch64AsmParser.cpp
+
+arm64_asm_parser_TBLGEN_TABLES := \
+ AArch64GenInstrInfo.inc \
+ AArch64GenRegisterInfo.inc \
+ AArch64GenAsmMatcher.inc \
+ AArch64GenSubtargetInfo.inc
+
+arm64_asm_parser_TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+arm64_asm_parser_C_INCLUDES := $(LOCAL_PATH)/..
+
+
+#===---------------------------------------------------------------===
+# libARM64AsmParser (host)
+#===---------------------------------------------------------------===
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+LOCAL_MODULE:= libLLVMARM64AsmParser
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(arm64_asm_parser_SRC_FILES)
+LOCAL_C_INCLUDES += $(arm64_asm_parser_C_INCLUDES)
+TBLGEN_TABLES := $(arm64_asm_parser_TBLGEN_TABLES)
+TBLGEN_TD_DIR := $(arm64_asm_parser_TBLGEN_TD_DIR)
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+ifneq (,$(filter windows darwin,$(HOST_OS)))
+# Override the default optimization level to work around taking forever (~50m)
+# to compile ARM64AsmParser.cpp on Mac with gcc 4.2,
+# or on Linux with mingw32msvc-gcc 4.2, which is used to cross-compile
+# the win_sdk.
+LOCAL_CFLAGS += -O0
+endif
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+
+#===---------------------------------------------------------------===
+# libARM64AsmParser (target)
+#===---------------------------------------------------------------===
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+LOCAL_MODULE:= libLLVMARM64AsmParser
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(arm64_asm_parser_SRC_FILES)
+LOCAL_C_INCLUDES += $(arm64_asm_parser_C_INCLUDES)
+TBLGEN_TABLES := $(arm64_asm_parser_TBLGEN_TABLES)
+TBLGEN_TD_DIR := $(arm64_asm_parser_TBLGEN_TD_DIR)
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/lib/Target/AArch64/Disassembler/Android.mk b/lib/Target/AArch64/Disassembler/Android.mk
new file mode 100644
index 0000000..f7d888a
--- /dev/null
+++ b/lib/Target/AArch64/Disassembler/Android.mk
@@ -0,0 +1,53 @@
+LOCAL_PATH := $(call my-dir)
+
+arm64_disassembler_TBLGEN_TABLES := \
+ AArch64GenDisassemblerTables.inc \
+ AArch64GenInstrInfo.inc \
+ AArch64GenSubtargetInfo.inc \
+ AArch64GenRegisterInfo.inc
+
+arm64_disassembler_SRC_FILES := \
+ AArch64Disassembler.cpp
+
+# For the device
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm64_disassembler_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm64_disassembler_SRC_FILES)
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64Disassembler
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm64_disassembler_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm64_disassembler_SRC_FILES)
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64Disassembler
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
diff --git a/lib/Target/AArch64/InstPrinter/Android.mk b/lib/Target/AArch64/InstPrinter/Android.mk
new file mode 100644
index 0000000..ffe94d3
--- /dev/null
+++ b/lib/Target/AArch64/InstPrinter/Android.mk
@@ -0,0 +1,55 @@
+LOCAL_PATH := $(call my-dir)
+
+arm64_asm_printer_TBLGEN_TABLES := \
+ AArch64GenAsmWriter.inc \
+ AArch64GenRegisterInfo.inc \
+ AArch64GenSubtargetInfo.inc \
+ AArch64GenInstrInfo.inc
+
+arm64_asm_printer_SRC_FILES := \
+ AArch64InstPrinter.cpp
+
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm64_asm_printer_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm64_asm_printer_SRC_FILES)
+
+LOCAL_MODULE:= libLLVMARM64AsmPrinter
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/..
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device only
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm64_asm_printer_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm64_asm_printer_SRC_FILES)
+
+LOCAL_C_INCLUDES+= \
+ $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64AsmPrinter
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_STATIC_LIBRARY)
+
diff --git a/lib/Target/AArch64/MCTargetDesc/Android.mk b/lib/Target/AArch64/MCTargetDesc/Android.mk
new file mode 100644
index 0000000..0dcc84f
--- /dev/null
+++ b/lib/Target/AArch64/MCTargetDesc/Android.mk
@@ -0,0 +1,55 @@
+LOCAL_PATH := $(call my-dir)
+
+arm64_mc_desc_TBLGEN_TABLES := \
+ AArch64GenRegisterInfo.inc \
+ AArch64GenInstrInfo.inc \
+ AArch64GenMCCodeEmitter.inc \
+ AArch64GenSubtargetInfo.inc
+
+arm64_mc_desc_SRC_FILES := \
+ AArch64AsmBackend.cpp \
+ AArch64ELFObjectWriter.cpp \
+ AArch64ELFStreamer.cpp \
+ AArch64MCAsmInfo.cpp \
+ AArch64MCCodeEmitter.cpp \
+ AArch64MCExpr.cpp \
+ AArch64MCTargetDesc.cpp
+
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+
+LOCAL_MODULE:= libLLVMARM64Desc
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(arm64_mc_desc_SRC_FILES)
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+TBLGEN_TABLES := $(arm64_mc_desc_TBLGEN_TABLES)
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(LLVM_GEN_INTRINSICS_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device only
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+LOCAL_MODULE:= libLLVMARM64Desc
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(arm64_mc_desc_SRC_FILES)
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+TBLGEN_TABLES := $(arm64_mc_desc_TBLGEN_TABLES)
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(LLVM_GEN_INTRINSICS_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/lib/Target/AArch64/TargetInfo/Android.mk b/lib/Target/AArch64/TargetInfo/Android.mk
new file mode 100644
index 0000000..e163329
--- /dev/null
+++ b/lib/Target/AArch64/TargetInfo/Android.mk
@@ -0,0 +1,53 @@
+LOCAL_PATH := $(call my-dir)
+
+arm64_target_info_TBLGEN_TABLES := \
+ AArch64GenSubtargetInfo.inc \
+ AArch64GenRegisterInfo.inc \
+ AArch64GenInstrInfo.inc
+
+arm64_target_info_SRC_FILES := \
+ AArch64TargetInfo.cpp
+
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm64_target_info_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm64_target_info_SRC_FILES)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64Info
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm64_target_info_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm64_target_info_SRC_FILES)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64Info
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/lib/Target/AArch64/Utils/Android.mk b/lib/Target/AArch64/Utils/Android.mk
new file mode 100644
index 0000000..a94f5c6
--- /dev/null
+++ b/lib/Target/AArch64/Utils/Android.mk
@@ -0,0 +1,34 @@
+LOCAL_PATH := $(call my-dir)
+
+arm64_utils_SRC_FILES := \
+ AArch64BaseInfo.cpp
+
+# For the device
+# =====================================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(arm64_utils_SRC_FILES)
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64Utils
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_DEVICE_BUILD_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(arm64_utils_SRC_FILES)
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARM64Utils
+
+LOCAL_MODULE_TAGS := optional
+
+include $(LLVM_HOST_BUILD_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/llvm.mk b/llvm.mk
index 7a8d258..1047632 100644
--- a/llvm.mk
+++ b/llvm.mk
@@ -8,4 +8,4 @@ LLVM_DEVICE_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-device-build.mk
LLVM_GEN_INTRINSICS_MK := $(LLVM_ROOT_PATH)/llvm-gen-intrinsics.mk
LLVM_TBLGEN_RULES_MK := $(LLVM_ROOT_PATH)/llvm-tblgen-rules.mk
-LLVM_SUPPORTED_ARCH := arm mips x86
+LLVM_SUPPORTED_ARCH := arm mips x86 arm64
diff --git a/shared_llvm.mk b/shared_llvm.mk
index 3f9e104..b0299e8 100644
--- a/shared_llvm.mk
+++ b/shared_llvm.mk
@@ -35,6 +35,15 @@ llvm_mips_static_libraries := \
libLLVMMipsAsmPrinter \
libLLVMMipsDisassembler
+llvm_arm64_static_libraries := \
+ libLLVMARM64CodeGen \
+ libLLVMARM64Info \
+ libLLVMARM64Desc \
+ libLLVMARM64AsmParser \
+ libLLVMARM64AsmPrinter \
+ libLLVMARM64Utils \
+ libLLVMARM64Disassembler
+
llvm_post_static_libraries := \
libLLVMAsmPrinter \
libLLVMSelectionDAG \
@@ -78,6 +87,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
$(llvm_arm_static_libraries) \
$(llvm_x86_static_libraries) \
$(llvm_mips_static_libraries) \
+ $(llvm_arm64_static_libraries) \
$(llvm_host_static_libraries) \
$(llvm_post_static_libraries)
@@ -110,6 +120,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES_arm += $(llvm_arm_static_libraries)
LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_x86_static_libraries)
LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_x86_static_libraries)
LOCAL_WHOLE_STATIC_LIBRARIES_mips += $(llvm_mips_static_libraries)
+LOCAL_WHOLE_STATIC_LIBRARIES_arm64 += $(llvm_arm64_static_libraries)
LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_post_static_libraries)
diff --git a/tools/llc/Android.mk b/tools/llc/Android.mk
index fde9f8c..0d44444 100644
--- a/tools/llc/Android.mk
+++ b/tools/llc/Android.mk
@@ -58,6 +58,16 @@ llvm_llc_STATIC_LIBRARIES := \
libLLVMCore \
libLLVMSupport
+llvm_llc_arm64_STATIC_LIBRARIES := \
+ libLLVMARM64Info \
+ libLLVMARM64AsmParser \
+ libLLVMARM64CodeGen \
+ libLLVMARM64Disassembler \
+ libLLVMARM64Desc \
+ libLLVMARM64AsmPrinter \
+ libLLVMARM64Utils
+
+
#===---------------------------------------------------------------===
# llc command line tool (host)
@@ -76,6 +86,7 @@ LOCAL_STATIC_LIBRARIES := \
$(llvm_llc_arm_STATIC_LIBRARIES) \
$(llvm_llc_mips_STATIC_LIBRARIES) \
$(llvm_llc_x86_STATIC_LIBRARIES) \
+ $(llvm_llc_arm64_STATIC_LIBRARIES) \
$(llvm_llc_STATIC_LIBRARIES)
LOCAL_LDLIBS += -lpthread -lm -ldl
@@ -108,6 +119,7 @@ LOCAL_STATIC_LIBRARIES_arm := $(llvm_llc_arm_STATIC_LIBRARIES)
LOCAL_STATIC_LIBRARIES_mips := $(llvm_llc_mips_STATIC_LIBRARIES)
LOCAL_STATIC_LIBRARIES_x86 := $(llvm_llc_x86_STATIC_LIBRARIES)
LOCAL_STATIC_LIBRARIES_x86_64 := $(llvm_llc_x86_STATIC_LIBRARIES)
+LOCAL_STATIC_LIBRARIES_arm64 := $(llvm_llc_arm64_STATIC_LIBRARIES)
LOCAL_STATIC_LIBRARIES += $(llvm_llc_STATIC_LIBRARIES)