1249259Sdim//==-- AArch64Subtarget.h - Define Subtarget for the AArch64 ---*- C++ -*--===// 2249259Sdim// 3249259Sdim// The LLVM Compiler Infrastructure 4249259Sdim// 5249259Sdim// This file is distributed under the University of Illinois Open Source 6249259Sdim// License. See LICENSE.TXT for details. 7249259Sdim// 8249259Sdim//===----------------------------------------------------------------------===// 9249259Sdim// 10249259Sdim// This file declares the AArch64 specific subclass of TargetSubtargetInfo. 11249259Sdim// 12249259Sdim//===----------------------------------------------------------------------===// 13249259Sdim 14249259Sdim#ifndef LLVM_TARGET_AARCH64_SUBTARGET_H 15249259Sdim#define LLVM_TARGET_AARCH64_SUBTARGET_H 16249259Sdim 17249259Sdim#include "llvm/ADT/Triple.h" 18249259Sdim#include "llvm/Target/TargetSubtargetInfo.h" 19249259Sdim 20249259Sdim#define GET_SUBTARGETINFO_HEADER 21249259Sdim#include "AArch64GenSubtargetInfo.inc" 22249259Sdim 23249259Sdim#include <string> 24249259Sdim 25249259Sdimnamespace llvm { 26249259Sdimclass StringRef; 27249259Sdimclass GlobalValue; 28249259Sdim 29249259Sdimclass AArch64Subtarget : public AArch64GenSubtargetInfo { 30263509Sdim virtual void anchor(); 31249259Sdimprotected: 32263509Sdim bool HasFPARMv8; 33249259Sdim bool HasNEON; 34249259Sdim bool HasCrypto; 35249259Sdim 36249259Sdim /// TargetTriple - What processor and OS we're targeting. 37249259Sdim Triple TargetTriple; 38263509Sdim 39263509Sdim /// CPUString - String name of used CPU. 40263509Sdim std::string CPUString; 41263509Sdim 42263509Sdimprivate: 43263509Sdim void initializeSubtargetFeatures(StringRef CPU, StringRef FS); 44263509Sdim 45249259Sdimpublic: 46249259Sdim /// This constructor initializes the data members to match that 47249259Sdim /// of the specified triple. 48249259Sdim /// 49249259Sdim AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS); 50249259Sdim 51263509Sdim virtual bool enableMachineScheduler() const { 52263509Sdim return true; 53263509Sdim } 54263509Sdim 55249259Sdim /// ParseSubtargetFeatures - Parses features string setting specified 56249259Sdim /// subtarget options. Definition of function is auto generated by tblgen. 57249259Sdim void ParseSubtargetFeatures(StringRef CPU, StringRef FS); 58249259Sdim 59249259Sdim bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const; 60249259Sdim 61249259Sdim bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } 62263509Sdim bool isTargetLinux() const { return TargetTriple.isOSLinux(); } 63249259Sdim 64263509Sdim bool hasFPARMv8() const { return HasFPARMv8; } 65263509Sdim bool hasNEON() const { return HasNEON; } 66263509Sdim bool hasCrypto() const { return HasCrypto; } 67263509Sdim 68263509Sdim const std::string & getCPUString() const { return CPUString; } 69249259Sdim}; 70249259Sdim} // End llvm namespace 71249259Sdim 72249259Sdim#endif // LLVM_TARGET_AARCH64_SUBTARGET_H 73