1 //==-- AArch64Subtarget.h - Define Subtarget for the AArch64 ---*- C++ -*--===//
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 declares the AArch64 specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TARGET_AARCH64_SUBTARGET_H
15 #define LLVM_TARGET_AARCH64_SUBTARGET_H
17 #include "llvm/ADT/Triple.h"
18 #include "llvm/Target/TargetSubtargetInfo.h"
21 #define GET_SUBTARGETINFO_HEADER
22 #include "AArch64GenSubtargetInfo.inc"
28 class AArch64Subtarget : public AArch64GenSubtargetInfo {
29 virtual void anchor();
31 enum ARMProcFamilyEnum {Others, CortexA53, CortexA57};
33 /// ARMProcFamily - ARM processor family: Cortex-A53, Cortex-A57, and others.
34 ARMProcFamilyEnum ARMProcFamily;
40 /// AllowsUnalignedMem - If true, the subtarget allows unaligned memory
41 /// accesses for some types. For details, see
42 /// AArch64TargetLowering::allowsUnalignedMemoryAccesses().
43 bool AllowsUnalignedMem;
45 /// TargetTriple - What processor and OS we're targeting.
48 /// CPUString - String name of used CPU.
49 std::string CPUString;
51 /// IsLittleEndian - The target is Little Endian
55 void initializeSubtargetFeatures(StringRef CPU, StringRef FS);
58 /// This constructor initializes the data members to match that
59 /// of the specified triple.
61 AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS,
64 bool enableMachineScheduler() const override {
68 /// ParseSubtargetFeatures - Parses features string setting specified
69 /// subtarget options. Definition of function is auto generated by tblgen.
70 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
72 bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const;
74 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
75 bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
77 bool hasFPARMv8() const { return HasFPARMv8; }
78 bool hasNEON() const { return HasNEON; }
79 bool hasCrypto() const { return HasCrypto; }
81 bool allowsUnalignedMem() const { return AllowsUnalignedMem; }
83 bool isLittle() const { return IsLittleEndian; }
85 const std::string & getCPUString() const { return CPUString; }
87 } // End llvm namespace
89 #endif // LLVM_TARGET_AARCH64_SUBTARGET_H