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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
//===-- M88kSubtarget.h - Define Subtarget for M88k -------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file declares the M88k specific subclass of TargetSubtargetInfo.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_M88K_M88KSUBTARGET_H
#define LLVM_LIB_TARGET_M88K_M88KSUBTARGET_H
#include "M88kFrameLowering.h"
#include "M88kISelLowering.h"
#include "M88kInstrInfo.h"
#include "M88kRegisterInfo.h"
#include "llvm/ADT/Optional.h"
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
#include "llvm/CodeGen/RegisterBankInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DataLayout.h"
#include <string>
#define GET_SUBTARGETINFO_HEADER
#include "M88kGenSubtargetInfo.inc"
namespace llvm {
class StringRef;
class M88kSubtarget : public M88kGenSubtargetInfo {
enum M88kProcEnum {
None,
MC88100,
MC88110,
};
// Bool members corresponding to the SubtargetFeatures defined in tablegen
#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
bool ATTRIBUTE = DEFAULT;
#include "M88kGenSubtargetInfo.inc"
M88kProcEnum M88kProc;
Triple TargetTriple;
M88kInstrInfo InstrInfo;
M88kTargetLowering TLInfo;
// SelectionDAGTargetInfo TSInfo;
M88kFrameLowering FrameLowering;
// GlobalISel related APIs.
std::unique_ptr<CallLowering> CallLoweringInfo;
std::unique_ptr<LegalizerInfo> Legalizer;
std::unique_ptr<RegisterBankInfo> RegBankInfo;
std::unique_ptr<InstructionSelector> InstSelector;
M88kSubtarget &initializeSubtargetDependencies(StringRef CPUString,
StringRef TuneCPUString,
StringRef FS);
public:
M88kSubtarget(const Triple &TT, const std::string &CPU,
const std::string &TuneCPU, const std::string &FS,
const TargetMachine &TM);
// Getters for SubtargetFeatures defined in tablegen
#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
bool GETTER() const { return ATTRIBUTE; }
#include "M88kGenSubtargetInfo.inc"
bool isMC88100() const { return M88kProc == MC88100; }
bool isMC88110() const { return M88kProc == MC88110; }
// Automatically generated by tblgen.
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
// Return information about cache structure.
Optional<unsigned> getCacheSize(unsigned Level) const override;
Optional<unsigned> getCacheAssociativity(unsigned Level) const override;
Optional<unsigned> getCacheLineSize(unsigned Level) const override;
const TargetFrameLowering *getFrameLowering() const override {
return &FrameLowering;
}
const M88kInstrInfo *getInstrInfo() const override { return &InstrInfo; }
const M88kRegisterInfo *getRegisterInfo() const override {
return &InstrInfo.getRegisterInfo();
}
const M88kTargetLowering *getTargetLowering() const override {
return &TLInfo;
}
#if 0
const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
return &TSInfo;
}
#endif
// GlobalISEL
const CallLowering *getCallLowering() const override {
return CallLoweringInfo.get();
}
const RegisterBankInfo *getRegBankInfo() const override {
return RegBankInfo.get();
}
const LegalizerInfo *getLegalizerInfo() const override {
return Legalizer.get();
}
InstructionSelector *getInstructionSelector() const override {
return InstSelector.get();
}
};
} // end namespace llvm
#endif
|