1 //===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file declares the ARC specific subclass of TargetSubtargetInfo. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H 14 #define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H 15 16 #include "ARCFrameLowering.h" 17 #include "ARCISelLowering.h" 18 #include "ARCInstrInfo.h" 19 #include "llvm/CodeGen/TargetSubtargetInfo.h" 20 #include <string> 21 22 #define GET_SUBTARGETINFO_HEADER 23 #include "ARCGenSubtargetInfo.inc" 24 25 namespace llvm { 26 27 class StringRef; 28 class TargetMachine; 29 30 class ARCSubtarget : public ARCGenSubtargetInfo { 31 virtual void anchor(); 32 ARCInstrInfo InstrInfo; 33 ARCFrameLowering FrameLowering; 34 ARCTargetLowering TLInfo; 35 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo; 36 37 // ARC processor extensions 38 bool Xnorm = false; 39 40 public: 41 /// This constructor initializes the data members to match that 42 /// of the specified triple. 43 ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, 44 const TargetMachine &TM); 45 46 ~ARCSubtarget() override; 47 48 /// Parses features string setting specified subtarget options. 49 /// Definition of function is auto generated by tblgen. 50 void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS); 51 getInstrInfo()52 const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; } getFrameLowering()53 const ARCFrameLowering *getFrameLowering() const override { 54 return &FrameLowering; 55 } getTargetLowering()56 const ARCTargetLowering *getTargetLowering() const override { 57 return &TLInfo; 58 } getRegisterInfo()59 const ARCRegisterInfo *getRegisterInfo() const override { 60 return &InstrInfo.getRegisterInfo(); 61 } 62 63 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override; 64 hasNorm()65 bool hasNorm() const { return Xnorm; } 66 }; 67 68 } // end namespace llvm 69 70 #endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H 71