zpu: managed to compile program that writes constant to global variable
[llvm/zpu.git] / lib / Target / MBlaze / MBlazeSubtarget.h
blobbebb3f773e03042c016d5b72acfdb538e541fbfb
1 //=====-- MBlazeSubtarget.h - Define Subtarget for the MBlaze -*- 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 MBlaze specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef MBLAZESUBTARGET_H
15 #define MBLAZESUBTARGET_H
17 #include "llvm/Target/TargetSubtarget.h"
18 #include "llvm/Target/TargetMachine.h"
20 #include <string>
22 namespace llvm {
24 class MBlazeSubtarget : public TargetSubtarget {
26 protected:
28 enum MBlazeArchEnum {
29 V400, V500, V600, V700, V710
32 // MBlaze architecture version
33 MBlazeArchEnum MBlazeArchVersion;
35 bool HasPipe3;
36 bool HasBarrel;
37 bool HasDiv;
38 bool HasMul;
39 bool HasFSL;
40 bool HasEFSL;
41 bool HasMSRSet;
42 bool HasException;
43 bool HasPatCmp;
44 bool HasFPU;
45 bool HasESR;
46 bool HasPVR;
47 bool HasMul64;
48 bool HasSqrt;
49 bool HasMMU;
51 InstrItineraryData InstrItins;
53 public:
55 /// This constructor initializes the data members to match that
56 /// of the specified triple.
57 MBlazeSubtarget(const std::string &TT, const std::string &FS);
59 /// ParseSubtargetFeatures - Parses features string setting specified
60 /// subtarget options. Definition of function is auto generated by tblgen.
61 std::string ParseSubtargetFeatures(const std::string &FS,
62 const std::string &CPU);
64 bool hasFPU() const { return HasFPU; }
65 bool hasSqrt() const { return HasSqrt; }
66 bool hasMul() const { return HasMul; }
67 bool hasMul64() const { return HasMul64; }
68 bool hasDiv() const { return HasDiv; }
69 bool hasBarrel() const { return HasBarrel; }
71 bool isV400() const { return MBlazeArchVersion == V400; }
72 bool isV500() const { return MBlazeArchVersion == V500; }
73 bool isV600() const { return MBlazeArchVersion == V600; }
74 bool isV700() const { return MBlazeArchVersion == V700; }
75 bool isV710() const { return MBlazeArchVersion == V710; }
77 } // End llvm namespace
79 #endif