1 //===-- AArch64Subtarget.cpp - AArch64 Subtarget Information --------------===//
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 // This file implements the AArch64 specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #include "AArch64Subtarget.h"
15 #include "AArch64RegisterInfo.h"
16 #include "MCTargetDesc/AArch64MCTargetDesc.h"
17 #include "llvm/ADT/SmallVector.h"
18 #include "llvm/IR/GlobalValue.h"
19 #include "llvm/Support/CommandLine.h"
20 #include "llvm/Target/TargetSubtargetInfo.h"
22 #define GET_SUBTARGETINFO_TARGET_DESC
23 #define GET_SUBTARGETINFO_CTOR
24 #include "AArch64GenSubtargetInfo.inc"
28 // Pin the vtable to this file.
29 void AArch64Subtarget::anchor() {}
31 AArch64Subtarget::AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS,
33 : AArch64GenSubtargetInfo(TT, CPU, FS), HasFPARMv8(false), HasNEON(false),
34 HasCrypto(false), TargetTriple(TT), CPUString(CPU),
35 IsLittleEndian(LittleEndian) {
37 initializeSubtargetFeatures(CPU, FS);
40 void AArch64Subtarget::initializeSubtargetFeatures(StringRef CPU,
43 CPUString = "generic";
45 std::string FullFS = FS;
46 if (CPUString == "generic") {
47 // Enable FP by default.
51 FullFS = "+fp-armv8," + FullFS;
54 ParseSubtargetFeatures(CPU, FullFS);
57 bool AArch64Subtarget::GVIsIndirectSymbol(const GlobalValue *GV,
58 Reloc::Model RelocM) const {
59 if (RelocM == Reloc::Static)
62 return !GV->hasLocalLinkage() && !GV->hasHiddenVisibility();