10b57cec5SDimitry Andric //===-- AArch64TargetInfo.cpp - AArch64 Target Implementation -----------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric
90b57cec5SDimitry Andric #include "TargetInfo/AArch64TargetInfo.h"
10*349cc55cSDimitry Andric #include "llvm/MC/TargetRegistry.h"
110b57cec5SDimitry Andric
120b57cec5SDimitry Andric using namespace llvm;
getTheAArch64leTarget()130b57cec5SDimitry Andric Target &llvm::getTheAArch64leTarget() {
140b57cec5SDimitry Andric static Target TheAArch64leTarget;
150b57cec5SDimitry Andric return TheAArch64leTarget;
160b57cec5SDimitry Andric }
getTheAArch64beTarget()170b57cec5SDimitry Andric Target &llvm::getTheAArch64beTarget() {
180b57cec5SDimitry Andric static Target TheAArch64beTarget;
190b57cec5SDimitry Andric return TheAArch64beTarget;
200b57cec5SDimitry Andric }
getTheAArch64_32Target()210b57cec5SDimitry Andric Target &llvm::getTheAArch64_32Target() {
220b57cec5SDimitry Andric static Target TheAArch64leTarget;
230b57cec5SDimitry Andric return TheAArch64leTarget;
240b57cec5SDimitry Andric }
getTheARM64Target()250b57cec5SDimitry Andric Target &llvm::getTheARM64Target() {
260b57cec5SDimitry Andric static Target TheARM64Target;
270b57cec5SDimitry Andric return TheARM64Target;
280b57cec5SDimitry Andric }
getTheARM64_32Target()290b57cec5SDimitry Andric Target &llvm::getTheARM64_32Target() {
300b57cec5SDimitry Andric static Target TheARM64_32Target;
310b57cec5SDimitry Andric return TheARM64_32Target;
320b57cec5SDimitry Andric }
330b57cec5SDimitry Andric
LLVMInitializeAArch64TargetInfo()34480093f4SDimitry Andric extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64TargetInfo() {
350b57cec5SDimitry Andric // Now register the "arm64" name for use with "-march". We don't want it to
360b57cec5SDimitry Andric // take possession of the Triple::aarch64 tags though.
370b57cec5SDimitry Andric TargetRegistry::RegisterTarget(getTheARM64Target(), "arm64",
380b57cec5SDimitry Andric "ARM64 (little endian)", "AArch64",
390b57cec5SDimitry Andric [](Triple::ArchType) { return false; }, true);
400b57cec5SDimitry Andric TargetRegistry::RegisterTarget(getTheARM64_32Target(), "arm64_32",
410b57cec5SDimitry Andric "ARM64 (little endian ILP32)", "AArch64",
420b57cec5SDimitry Andric [](Triple::ArchType) { return false; }, true);
430b57cec5SDimitry Andric
440b57cec5SDimitry Andric RegisterTarget<Triple::aarch64, /*HasJIT=*/true> Z(
450b57cec5SDimitry Andric getTheAArch64leTarget(), "aarch64", "AArch64 (little endian)", "AArch64");
460b57cec5SDimitry Andric RegisterTarget<Triple::aarch64_be, /*HasJIT=*/true> W(
470b57cec5SDimitry Andric getTheAArch64beTarget(), "aarch64_be", "AArch64 (big endian)", "AArch64");
480b57cec5SDimitry Andric RegisterTarget<Triple::aarch64_32, /*HasJIT=*/true> X(
490b57cec5SDimitry Andric getTheAArch64_32Target(), "aarch64_32", "AArch64 (little endian ILP32)", "AArch64");
500b57cec5SDimitry Andric }
51