~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to lib/Target/Sparc/SparcSubtarget.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===-- SparcSubtarget.h - Define Subtarget for the SPARC -------*- 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 SPARC specific subclass of TargetSubtargetInfo.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_LIB_TARGET_SPARC_SPARCSUBTARGET_H
 
15
#define LLVM_LIB_TARGET_SPARC_SPARCSUBTARGET_H
 
16
 
 
17
#include "SparcFrameLowering.h"
 
18
#include "SparcInstrInfo.h"
 
19
#include "SparcISelLowering.h"
 
20
#include "llvm/IR/DataLayout.h"
 
21
#include "llvm/Target/TargetFrameLowering.h"
 
22
#include "llvm/Target/TargetSelectionDAGInfo.h"
 
23
#include "llvm/Target/TargetSubtargetInfo.h"
 
24
#include <string>
 
25
 
 
26
#define GET_SUBTARGETINFO_HEADER
 
27
#include "SparcGenSubtargetInfo.inc"
 
28
 
 
29
namespace llvm {
 
30
class StringRef;
 
31
 
 
32
class SparcSubtarget : public SparcGenSubtargetInfo {
 
33
  virtual void anchor();
 
34
  bool IsV9;
 
35
  bool V8DeprecatedInsts;
 
36
  bool IsVIS, IsVIS2, IsVIS3;
 
37
  bool Is64Bit;
 
38
  bool HasHardQuad;
 
39
  bool UsePopc;
 
40
  SparcInstrInfo InstrInfo;
 
41
  SparcTargetLowering TLInfo;
 
42
  TargetSelectionDAGInfo TSInfo;
 
43
  SparcFrameLowering FrameLowering;
 
44
 
 
45
public:
 
46
  SparcSubtarget(const Triple &TT, const std::string &CPU,
 
47
                 const std::string &FS, TargetMachine &TM, bool is64bit);
 
48
 
 
49
  const SparcInstrInfo *getInstrInfo() const override { return &InstrInfo; }
 
50
  const TargetFrameLowering *getFrameLowering() const override {
 
51
    return &FrameLowering;
 
52
  }
 
53
  const SparcRegisterInfo *getRegisterInfo() const override {
 
54
    return &InstrInfo.getRegisterInfo();
 
55
  }
 
56
  const SparcTargetLowering *getTargetLowering() const override {
 
57
    return &TLInfo;
 
58
  }
 
59
  const TargetSelectionDAGInfo *getSelectionDAGInfo() const override {
 
60
    return &TSInfo;
 
61
  }
 
62
 
 
63
  bool isV9() const { return IsV9; }
 
64
  bool isVIS() const { return IsVIS; }
 
65
  bool isVIS2() const { return IsVIS2; }
 
66
  bool isVIS3() const { return IsVIS3; }
 
67
  bool useDeprecatedV8Instructions() const { return V8DeprecatedInsts; }
 
68
  bool hasHardQuad() const { return HasHardQuad; }
 
69
  bool usePopc() const { return UsePopc; }
 
70
 
 
71
  /// ParseSubtargetFeatures - Parses features string setting specified
 
72
  /// subtarget options.  Definition of function is auto generated by tblgen.
 
73
  void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
 
74
  SparcSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
 
75
 
 
76
  bool is64Bit() const { return Is64Bit; }
 
77
 
 
78
  /// The 64-bit ABI uses biased stack and frame pointers, so the stack frame
 
79
  /// of the current function is the area from [%sp+BIAS] to [%fp+BIAS].
 
80
  int64_t getStackPointerBias() const {
 
81
    return is64Bit() ? 2047 : 0;
 
82
  }
 
83
 
 
84
  /// Given a actual stack size as determined by FrameInfo, this function
 
85
  /// returns adjusted framesize which includes space for register window
 
86
  /// spills and arguments.
 
87
  int getAdjustedFrameSize(int stackSize) const;
 
88
 
 
89
};
 
90
 
 
91
} // end namespace llvm
 
92
 
 
93
#endif