xref: /freebsd/contrib/llvm-project/llvm/lib/Target/ARC/ARCSubtarget.h (revision 349cc55c9796c4596a5b9904cd3281af295f878f)
10b57cec5SDimitry Andric //===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file declares the ARC specific subclass of TargetSubtargetInfo.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
140b57cec5SDimitry Andric #define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric #include "ARCFrameLowering.h"
170b57cec5SDimitry Andric #include "ARCISelLowering.h"
180b57cec5SDimitry Andric #include "ARCInstrInfo.h"
190b57cec5SDimitry Andric #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
200b57cec5SDimitry Andric #include "llvm/CodeGen/TargetSubtargetInfo.h"
210b57cec5SDimitry Andric #include <string>
220b57cec5SDimitry Andric 
230b57cec5SDimitry Andric #define GET_SUBTARGETINFO_HEADER
240b57cec5SDimitry Andric #include "ARCGenSubtargetInfo.inc"
250b57cec5SDimitry Andric 
260b57cec5SDimitry Andric namespace llvm {
270b57cec5SDimitry Andric 
280b57cec5SDimitry Andric class StringRef;
290b57cec5SDimitry Andric class TargetMachine;
300b57cec5SDimitry Andric 
310b57cec5SDimitry Andric class ARCSubtarget : public ARCGenSubtargetInfo {
320b57cec5SDimitry Andric   virtual void anchor();
330b57cec5SDimitry Andric   ARCInstrInfo InstrInfo;
340b57cec5SDimitry Andric   ARCFrameLowering FrameLowering;
350b57cec5SDimitry Andric   ARCTargetLowering TLInfo;
360b57cec5SDimitry Andric   SelectionDAGTargetInfo TSInfo;
370b57cec5SDimitry Andric 
38*349cc55cSDimitry Andric   // ARC processor extensions
39*349cc55cSDimitry Andric   bool Xnorm = false;
40*349cc55cSDimitry Andric 
410b57cec5SDimitry Andric public:
420b57cec5SDimitry Andric   /// This constructor initializes the data members to match that
430b57cec5SDimitry Andric   /// of the specified triple.
440b57cec5SDimitry Andric   ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
450b57cec5SDimitry Andric                const TargetMachine &TM);
460b57cec5SDimitry Andric 
470b57cec5SDimitry Andric   /// Parses features string setting specified subtarget options.
480b57cec5SDimitry Andric   /// Definition of function is auto generated by tblgen.
49e8d8bef9SDimitry Andric   void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
500b57cec5SDimitry Andric 
getInstrInfo()510b57cec5SDimitry Andric   const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
getFrameLowering()520b57cec5SDimitry Andric   const ARCFrameLowering *getFrameLowering() const override {
530b57cec5SDimitry Andric     return &FrameLowering;
540b57cec5SDimitry Andric   }
getTargetLowering()550b57cec5SDimitry Andric   const ARCTargetLowering *getTargetLowering() const override {
560b57cec5SDimitry Andric     return &TLInfo;
570b57cec5SDimitry Andric   }
getRegisterInfo()580b57cec5SDimitry Andric   const ARCRegisterInfo *getRegisterInfo() const override {
590b57cec5SDimitry Andric     return &InstrInfo.getRegisterInfo();
600b57cec5SDimitry Andric   }
getSelectionDAGInfo()610b57cec5SDimitry Andric   const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
620b57cec5SDimitry Andric     return &TSInfo;
630b57cec5SDimitry Andric   }
64fe6060f1SDimitry Andric 
hasNorm()65fe6060f1SDimitry Andric   bool hasNorm() const { return Xnorm; }
660b57cec5SDimitry Andric };
670b57cec5SDimitry Andric 
680b57cec5SDimitry Andric } // end namespace llvm
690b57cec5SDimitry Andric 
700b57cec5SDimitry Andric #endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
71