1 //===-- SPUSubtarget.h - Define Subtarget for the Cell SPU ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the Cell SPU-specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef CELLSUBTARGET_H
15 #define CELLSUBTARGET_H
17 #include "llvm/Target/TargetSubtarget.h"
18 #include "llvm/MC/MCInstrItineraries.h"
31 class SPUSubtarget : public TargetSubtarget {
33 /// stackAlignment - The minimum alignment known to hold of the stack frame
34 /// on entry to the function and which must be maintained by every function.
35 unsigned StackAlignment;
37 /// Selected instruction itineraries (one entry per itinerary class.)
38 InstrItineraryData InstrItins;
40 /// Which SPU processor (this isn't really used, but it's there to keep
41 /// the C compiler happy)
42 unsigned ProcDirective;
44 /// Use (assume) large memory -- effectively disables the LQA/STQA
45 /// instructions that assume 259K local store.
49 /// This constructor initializes the data members to match that
50 /// of the specified triple.
52 SPUSubtarget(const std::string &TT, const std::string &FS);
54 /// ParseSubtargetFeatures - Parses features string setting specified
55 /// subtarget options. Definition of function is auto generated by tblgen.
56 std::string ParseSubtargetFeatures(const std::string &FS,
57 const std::string &CPU);
59 /// SetJITMode - This is called to inform the subtarget info that we are
60 /// producing code for the JIT.
63 /// getStackAlignment - Returns the minimum alignment known to hold of the
64 /// stack frame on entry to the function and which must be maintained by
65 /// every function for this subtarget.
66 unsigned getStackAlignment() const { return StackAlignment; }
68 /// getInstrItins - Return the instruction itineraies based on subtarget
70 const InstrItineraryData &getInstrItineraryData() const {
74 /// Use large memory addressing predicate
75 bool usingLargeMem() const {
79 /// getTargetDataString - Return the pointer size and type alignment
80 /// properties of this subtarget.
81 const char *getTargetDataString() const {
82 return "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128"
83 "-i16:16:128-i8:8:128-i1:8:128-a:0:128-v64:64:128-v128:128:128"
87 bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
88 TargetSubtarget::AntiDepBreakMode& Mode,
89 RegClassVector& CriticalPathRCs) const;
91 } // End llvm namespace