1 //=====-- SPUSubtarget.h - Define Subtarget for the Cell SPU -----*- C++ -*--=//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by a team from the Computer Systems Research
6 // Department at The Aerospace Corporation.
8 // See README.txt for details.
10 //===----------------------------------------------------------------------===//
12 // This file declares the Cell SPU-specific subclass of TargetSubtarget.
14 //===----------------------------------------------------------------------===//
16 #ifndef POWERPCSUBTARGET_H
17 #define POWERPCSUBTARGET_H
19 #include "llvm/Target/TargetInstrItineraries.h"
20 #include "llvm/Target/TargetSubtarget.h"
35 class SPUSubtarget : public TargetSubtarget {
37 const TargetMachine &TM;
39 /// stackAlignment - The minimum alignment known to hold of the stack frame
40 /// on entry to the function and which must be maintained by every function.
41 unsigned StackAlignment;
43 /// Selected instruction itineraries (one entry per itinerary class.)
44 InstrItineraryData InstrItins;
46 /// Which SPU processor (this isn't really used, but it's there to keep
47 /// the C compiler happy)
48 unsigned ProcDirective;
50 /// Use (assume) large memory -- effectively disables the LQA/STQA
51 /// instructions that assume 259K local store.
55 /// This constructor initializes the data members to match that
56 /// of the specified module.
58 SPUSubtarget(const TargetMachine &TM, const Module &M,
59 const std::string &FS);
61 /// ParseSubtargetFeatures - Parses features string setting specified
62 /// subtarget options. Definition of function is auto generated by tblgen.
63 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
65 /// SetJITMode - This is called to inform the subtarget info that we are
66 /// producing code for the JIT.
69 /// getStackAlignment - Returns the minimum alignment known to hold of the
70 /// stack frame on entry to the function and which must be maintained by
71 /// every function for this subtarget.
72 unsigned getStackAlignment() const { return StackAlignment; }
74 /// getInstrItins - Return the instruction itineraies based on subtarget
76 const InstrItineraryData &getInstrItineraryData() const {
80 /// Use large memory addressing predicate
81 bool usingLargeMem() const {
85 /// getTargetDataString - Return the pointer size and type alignment
86 /// properties of this subtarget.
87 const char *getTargetDataString() const {
88 return "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128"
89 "-i16:16:128-i8:8:128-i1:8:128-a:0:128-v128:128:128"
93 } // End llvm namespace