OpenASIP  2.0
TCESubtarget.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file TCESubtarget.h
26  *
27  * Declaration of TCESubtarget class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2007 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_TCE_SUBTARGET_H
33 #define TTA_TCE_SUBTARGET_H
34 
35 #include <string>
36 
37 #include "tce_config.h"
38 
39 #include "llvm/CodeGen/TargetSubtargetInfo.h"
40 
41 #define GET_SUBTARGETINFO_HEADER
42 #include "TCEGenSubTargetInfo.inc"
43 #undef GET_SUBTARGETINFO_HEADER
44 
45 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
46 
47 namespace llvm {
48 
49  class TCETargetMachinePlugin;
50  class Module;
51 
52  /**
53  * Currently there is only one generic universal machine target,
54  * so this class doesn't contain any relevant information.
55  */
56  class TCESubtarget : public TCEGenSubtargetInfo {
57  public:
58  TCESubtarget(TCETargetMachinePlugin* plugin); //const std::string &TT, const std::string &FS);
59  std::string pluginFileName();
60  virtual bool isLittleEndian() const { return false; };
61 
62  virtual bool is64bit() const { return false; }
63 
64  const InstrItineraryData*
65  getInstrItineraryData() const override {
66  return &InstrItins;
67  }
68 
69  virtual const TargetInstrInfo* getInstrInfo() const override;
70  virtual const TargetFrameLowering* getFrameLowering() const override;
71  virtual const TargetLowering* getTargetLowering() const override;
72  virtual const SelectionDAGTargetInfo* getSelectionDAGInfo()
73  const override;
74 
75  virtual const TargetRegisterInfo* getRegisterInfo() const override;
76  virtual bool enableMachinePipeliner() const override;
77 
78  protected:
79  /// ParseSubtargetFeatures - Parses features string setting specified
80  /// subtarget options. Definition of function is auto generated by
81  /// tblgen.
83  StringRef CPU, StringRef TuneCPU, StringRef FS);
84  private:
85  std::string pluginFile_;
87  InstrItineraryData InstrItins;
88  };
89 
90  class TCELESubtarget: public TCESubtarget {
91  public:
93  TCESubtarget(plugin) {}
94 
95  virtual bool isLittleEndian() const override { return true; }
96  };
97 
99  public:
101  TCELESubtarget(plugin) {}
102 
103  virtual bool is64bit() const override { return true; }
104  };
105 }
106 
107 #endif
llvm::TCESubtarget::InstrItins
InstrItineraryData InstrItins
Definition: TCESubtarget.hh:87
llvm
Definition: InlineAsmParser.hh:49
llvm::TCESubtarget::enableMachinePipeliner
virtual bool enableMachinePipeliner() const override
Definition: TCESubtarget.cc:112
llvm::TCELESubtarget::isLittleEndian
virtual bool isLittleEndian() const override
Definition: TCESubtarget.hh:95
llvm::TCESubtarget
Definition: TCESubtarget.hh:56
llvm::TCESubtarget::TCESubtarget
TCESubtarget(TCETargetMachinePlugin *plugin)
Definition: TCESubtarget.cc:69
llvm::TCELESubtarget
Definition: TCESubtarget.hh:90
llvm::TCESubtarget::getInstrItineraryData
const InstrItineraryData * getInstrItineraryData() const override
Definition: TCESubtarget.hh:65
llvm::TCESubtarget::pluginFileName
std::string pluginFileName()
Definition: TCESubtarget.cc:87
llvm::TCESubtarget::isLittleEndian
virtual bool isLittleEndian() const
Definition: TCESubtarget.hh:60
llvm::TCESubtarget::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const override
Definition: TCESubtarget.cc:95
llvm::TCESubtarget::plugin_
TCETargetMachinePlugin * plugin_
Definition: TCESubtarget.hh:86
llvm::TCESubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options....
llvm::TCESubtarget::getTargetLowering
virtual const TargetLowering * getTargetLowering() const override
Definition: TCESubtarget.cc:103
llvm::TCETargetMachinePlugin
Definition: TCETargetMachinePlugin.hh:109
llvm::TCESubtarget::getInstrInfo
virtual const TargetInstrInfo * getInstrInfo() const override
Definition: TCESubtarget.cc:91
llvm::TCESubtarget::getSelectionDAGInfo
virtual const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: TCESubtarget.cc:107
llvm::TCESubtarget::pluginFile_
std::string pluginFile_
Definition: TCESubtarget.hh:85
llvm::TCELE64Subtarget::TCELE64Subtarget
TCELE64Subtarget(TCETargetMachinePlugin *plugin)
Definition: TCESubtarget.hh:100
llvm::TCESubtarget::getFrameLowering
virtual const TargetFrameLowering * getFrameLowering() const override
Definition: TCESubtarget.cc:99
llvm::TCELESubtarget::TCELESubtarget
TCELESubtarget(TCETargetMachinePlugin *plugin)
Definition: TCESubtarget.hh:92
llvm::TCELE64Subtarget
Definition: TCESubtarget.hh:98
llvm::TCELE64Subtarget::is64bit
virtual bool is64bit() const override
Definition: TCESubtarget.hh:103
llvm::TCESubtarget::is64bit
virtual bool is64bit() const
Definition: TCESubtarget.hh:62