summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeon/AMDILSubtarget.h
blob: 38fcb859ac643af932d5d6e11ca2150c11a57ce2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//=====-- AMDILSubtarget.h - Define Subtarget for the AMDIL ----*- C++ -*-====//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//==-----------------------------------------------------------------------===//
//
// This file declares the AMDIL specific subclass of TargetSubtarget.
//
//===----------------------------------------------------------------------===//

#ifndef _AMDILSUBTARGET_H_
#define _AMDILSUBTARGET_H_

#include "AMDILDevice.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/Target/TargetSubtargetInfo.h"

#include <cstdlib>
#include <string>

#define GET_SUBTARGETINFO_HEADER
#include "AMDILGenSubtargetInfo.inc"

#define MAX_CB_SIZE (1 << 16)
namespace llvm {
  class Module;
  class AMDILKernelManager;
  class AMDILGlobalManager;
  class AMDILDevice;
  class AMDILSubtarget : public AMDILGenSubtargetInfo {
    private:
      bool CapsOverride[AMDILDeviceInfo::MaxNumberCapabilities];
      mutable AMDILGlobalManager *mGM;
      mutable AMDILKernelManager *mKM;
      const AMDILDevice *mDevice;
      size_t mDefaultSize[3];
      size_t mMinimumSize[3];
      std::string mDevName;
      uint32_t mVersion;
      bool mIs64bit;
      bool mIs32on64bit;
      bool mDumpCode;
    public:
      AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS);
      virtual ~AMDILSubtarget();
      bool isOverride(AMDILDeviceInfo::Caps) const;
      bool is64bit() const;

      // Helper functions to simplify if statements
      bool isTargetELF() const;
      AMDILGlobalManager* getGlobalManager() const;
      void setGlobalManager(AMDILGlobalManager *gm) const;
      AMDILKernelManager* getKernelManager() const;
      void setKernelManager(AMDILKernelManager *gm) const;
      const AMDILDevice* device() const;
      std::string getDataLayout() const;
      std::string getDeviceName() const;
      virtual size_t getDefaultSize(uint32_t dim) const;
      // Return the version of CAL that the backend should target.
      uint32_t calVersion() const;
      // ParseSubtargetFeatures - Parses features string setting specified
      // subtarget options.  Definition of function is
      //auto generated by tblgen.
      void
        ParseSubtargetFeatures(
            llvm::StringRef CPU,
            llvm::StringRef FS);
      bool dumpCode() const { return mDumpCode; }

  };

} // end namespace llvm

#endif // AMDILSUBTARGET_H_