LLVM 24.0.0git
CSKYSubtarget.cpp
Go to the documentation of this file.
1//===-- CSKYSubtarget.h - Define Subtarget for the CSKY----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the CSKY specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#include "CSKYSubtarget.h"
16
17using namespace llvm;
18
19#define DEBUG_TYPE "csky-subtarget"
20#define GET_SUBTARGETINFO_TARGET_DESC
21#define GET_SUBTARGETINFO_CTOR
22#include "CSKYGenSubtargetInfo.inc"
23
24void CSKYSubtarget::anchor() {}
25
27 const Triple &TT, StringRef CPUName, StringRef TuneCPUName, StringRef FS) {
28
29 if (CPUName.empty())
30 CPUName = "generic";
31 if (TuneCPUName.empty())
32 TuneCPUName = CPUName;
33
34 UseHardFloat = false;
35 UseHardFloatABI = false;
36 HasFPUv2SingleFloat = false;
37 HasFPUv2DoubleFloat = false;
38 HasFPUv3HalfWord = false;
39 HasFPUv3HalfFloat = false;
40 HasFPUv3SingleFloat = false;
41 HasFPUv3DoubleFloat = false;
42 HasFdivdu = false;
43 HasFLOATE1 = false;
44 HasFLOAT1E2 = false;
45 HasFLOAT1E3 = false;
46 HasFLOAT3E4 = false;
47 HasFLOAT7E60 = false;
48 HasExtendLrw = false;
49 HasBTST16 = false;
50 HasTrust = false;
51 HasJAVA = false;
52 HasCache = false;
53 HasNVIC = false;
54 HasDSP = false;
55 HasDSP1E2 = false;
56 HasDSPE60 = false;
57 HasDSPV2 = false;
58 HasDSP_Silan = false;
59 HasDoloop = false;
60 HasHardwareDivide = false;
61 HasHighRegisters = false;
62 HasVDSPV2 = false;
63 HasVDSP2E3 = false;
64 HasVDSP2E60F = false;
65 ReadTPHard = false;
66 HasVDSPV1_128 = false;
67 UseCCRT = false;
68 DumpConstPool = false;
69 EnableInterruptAttribute = false;
70 HasPushPop = false;
71 HasSTM = false;
72 SmartMode = false;
73 EnableStackSize = false;
74
75 HasE1 = false;
76 HasE2 = false;
77 Has2E3 = false;
78 HasMP = false;
79 Has3E3r1 = false;
80 Has3r1E3r2 = false;
81 Has3r2E3r3 = false;
82 Has3E7 = false;
83 HasMP1E2 = false;
84 Has7E10 = false;
85 Has10E60 = false;
86
87 ParseSubtargetFeatures(CPUName, TuneCPUName, FS);
88 return *this;
89}
90
93 const TargetMachine &TM)
94 : CSKYGenSubtargetInfo(TT, CPU, TuneCPU, FS),
95 FrameLowering(initializeSubtargetDependencies(TT, CPU, TuneCPU, FS)),
96 InstrInfo(*this, RegInfo), TLInfo(TM, *this),
97 UseHardFloatABI(FloatABI == FloatABI::Hard) {
98 TSInfo = std::make_unique<CSKYSelectionDAGInfo>();
99}
100
102
104 return TSInfo.get();
105}
CSKYSubtarget & initializeSubtargetDependencies(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS)
Initializes using the passed in CPU and feature strings so that we can use initializer lists for subt...
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, FloatABI::ABIType FloatABI, const TargetMachine &TM)
~CSKYSubtarget() override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr bool empty() const
Check if the string is empty.
Definition StringRef.h:141
Primary interface to the complete machine description for the target machine.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
This is an optimization pass for GlobalISel generic memory operations.