AArch64Subtarget.h revision 263508
1139749Simp//==-- AArch64Subtarget.h - Define Subtarget for the AArch64 ---*- C++ -*--===//
256293Sjkh//
356293Sjkh//                     The LLVM Compiler Infrastructure
456293Sjkh//
556293Sjkh// This file is distributed under the University of Illinois Open Source
656293Sjkh// License. See LICENSE.TXT for details.
756293Sjkh//
856293Sjkh//===----------------------------------------------------------------------===//
956293Sjkh//
1056293Sjkh// This file declares the AArch64 specific subclass of TargetSubtargetInfo.
1156293Sjkh//
12185003Sjhb//===----------------------------------------------------------------------===//
1356293Sjkh
1456293Sjkh#ifndef LLVM_TARGET_AARCH64_SUBTARGET_H
1556293Sjkh#define LLVM_TARGET_AARCH64_SUBTARGET_H
1677837Sphk
1756293Sjkh#include "llvm/ADT/Triple.h"
1856293Sjkh#include "llvm/Target/TargetSubtargetInfo.h"
1956293Sjkh
2056293Sjkh#define GET_SUBTARGETINFO_HEADER
2156293Sjkh#include "AArch64GenSubtargetInfo.inc"
2256293Sjkh
2356293Sjkh#include <string>
2456293Sjkh
2556293Sjkhnamespace llvm {
2656293Sjkhclass StringRef;
27119418Sobrienclass GlobalValue;
28119418Sobrien
29119418Sobrienclass AArch64Subtarget : public AArch64GenSubtargetInfo {
3056293Sjkh  virtual void anchor();
3156293Sjkhprotected:
3256293Sjkh  bool HasFPARMv8;
3356293Sjkh  bool HasNEON;
3456293Sjkh  bool HasCrypto;
3556293Sjkh
3656293Sjkh  /// TargetTriple - What processor and OS we're targeting.
3756293Sjkh  Triple TargetTriple;
38129879Sphk
3956293Sjkh  /// CPUString - String name of used CPU.
4056293Sjkh  std::string CPUString;
4156293Sjkh
4256293Sjkhprivate:
4356293Sjkh  void initializeSubtargetFeatures(StringRef CPU, StringRef FS);
4456293Sjkh
4556293Sjkhpublic:
4656293Sjkh  /// This constructor initializes the data members to match that
4756293Sjkh  /// of the specified triple.
4856293Sjkh  ///
4956293Sjkh  AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS);
5056293Sjkh
5156293Sjkh  virtual bool enableMachineScheduler() const {
5256293Sjkh    return true;
5356293Sjkh  }
5456293Sjkh
55184130Sjhb  /// ParseSubtargetFeatures - Parses features string setting specified
56184130Sjhb  /// subtarget options.  Definition of function is auto generated by tblgen.
5756293Sjkh  void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
5856293Sjkh
5956293Sjkh  bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const;
6056293Sjkh
6156293Sjkh  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
6256293Sjkh  bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
6356293Sjkh
6456293Sjkh  bool hasFPARMv8() const { return HasFPARMv8; }
6556293Sjkh  bool hasNEON() const { return HasNEON; }
66126080Sphk  bool hasCrypto() const { return HasCrypto; }
67111815Sphk
68111815Sphk  const std::string & getCPUString() const { return CPUString; }
69111815Sphk};
70111815Sphk} // End llvm namespace
7156293Sjkh
7256293Sjkh#endif  // LLVM_TARGET_AARCH64_SUBTARGET_H
7356293Sjkh