the various ConstantExpr::get*Ty methods existed to work with issues around
[llvm/stm8.git] / lib / Target / CellSPU / SPUSubtarget.h
blob7c4aa143021751d263bb24e4f9eea13fd79467e9
1 //===-- SPUSubtarget.h - Define Subtarget for the Cell SPU ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the Cell SPU-specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef CELLSUBTARGET_H
15 #define CELLSUBTARGET_H
17 #include "llvm/Target/TargetSubtargetInfo.h"
18 #include "llvm/MC/MCInstrItineraries.h"
19 #include <string>
21 #define GET_SUBTARGETINFO_HEADER
22 #include "SPUGenSubtargetInfo.inc"
24 namespace llvm {
25 class GlobalValue;
26 class StringRef;
28 namespace SPU {
29 enum {
30 PROC_NONE,
31 DEFAULT_PROC
35 class SPUSubtarget : public SPUGenSubtargetInfo {
36 protected:
37 /// stackAlignment - The minimum alignment known to hold of the stack frame
38 /// on entry to the function and which must be maintained by every function.
39 unsigned StackAlignment;
41 /// Selected instruction itineraries (one entry per itinerary class.)
42 InstrItineraryData InstrItins;
44 /// Which SPU processor (this isn't really used, but it's there to keep
45 /// the C compiler happy)
46 unsigned ProcDirective;
48 /// Use (assume) large memory -- effectively disables the LQA/STQA
49 /// instructions that assume 259K local store.
50 bool UseLargeMem;
52 public:
53 /// This constructor initializes the data members to match that
54 /// of the specified triple.
55 ///
56 SPUSubtarget(const std::string &TT, const std::string &CPU,
57 const std::string &FS);
59 /// ParseSubtargetFeatures - Parses features string setting specified
60 /// subtarget options. Definition of function is auto generated by tblgen.
61 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
63 /// SetJITMode - This is called to inform the subtarget info that we are
64 /// producing code for the JIT.
65 void SetJITMode();
67 /// getStackAlignment - Returns the minimum alignment known to hold of the
68 /// stack frame on entry to the function and which must be maintained by
69 /// every function for this subtarget.
70 unsigned getStackAlignment() const { return StackAlignment; }
72 /// getInstrItins - Return the instruction itineraies based on subtarget
73 /// selection.
74 const InstrItineraryData &getInstrItineraryData() const {
75 return InstrItins;
78 /// Use large memory addressing predicate
79 bool usingLargeMem() const {
80 return UseLargeMem;
83 /// getTargetDataString - Return the pointer size and type alignment
84 /// properties of this subtarget.
85 const char *getTargetDataString() const {
86 return "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128"
87 "-i16:16:128-i8:8:128-i1:8:128-a:0:128-v64:64:128-v128:128:128"
88 "-s:128:128-n32:64";
91 bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
92 TargetSubtargetInfo::AntiDepBreakMode& Mode,
93 RegClassVector& CriticalPathRCs) const;
95 } // End llvm namespace
97 #endif