LLVM 20.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"
15
16using namespace llvm;
17
18#define DEBUG_TYPE "csky-subtarget"
19#define GET_SUBTARGETINFO_TARGET_DESC
20#define GET_SUBTARGETINFO_CTOR
21#include "CSKYGenSubtargetInfo.inc"
22
23void CSKYSubtarget::anchor() {}
24
26 const Triple &TT, StringRef CPUName, StringRef TuneCPUName, StringRef FS) {
27
28 if (CPUName.empty())
29 CPUName = "generic";
30 if (TuneCPUName.empty())
31 TuneCPUName = CPUName;
32
33 UseHardFloat = false;
34 UseHardFloatABI = false;
35 HasFPUv2SingleFloat = false;
36 HasFPUv2DoubleFloat = false;
37 HasFPUv3HalfWord = false;
38 HasFPUv3HalfFloat = false;
39 HasFPUv3SingleFloat = false;
40 HasFPUv3DoubleFloat = false;
41 HasFdivdu = false;
42 HasFLOATE1 = false;
43 HasFLOAT1E2 = false;
44 HasFLOAT1E3 = false;
45 HasFLOAT3E4 = false;
46 HasFLOAT7E60 = false;
47 HasExtendLrw = false;
48 HasBTST16 = false;
49 HasTrust = false;
50 HasJAVA = false;
51 HasCache = false;
52 HasNVIC = false;
53 HasDSP = false;
54 HasDSP1E2 = false;
55 HasDSPE60 = false;
56 HasDSPV2 = false;
57 HasDSP_Silan = false;
58 HasDoloop = false;
59 HasHardwareDivide = false;
60 HasHighRegisters = false;
61 HasVDSPV2 = false;
62 HasVDSP2E3 = false;
63 HasVDSP2E60F = false;
64 ReadTPHard = false;
65 HasVDSPV1_128 = false;
66 UseCCRT = false;
67 DumpConstPool = false;
68 EnableInterruptAttribute = false;
69 HasPushPop = false;
70 HasSTM = false;
71 SmartMode = false;
72 EnableStackSize = false;
73
74 HasE1 = false;
75 HasE2 = false;
76 Has2E3 = false;
77 HasMP = false;
78 Has3E3r1 = false;
79 Has3r1E3r2 = false;
80 Has3r2E3r3 = false;
81 Has3E7 = false;
82 HasMP1E2 = false;
83 Has7E10 = false;
84 Has10E60 = false;
85
86 ParseSubtargetFeatures(CPUName, TuneCPUName, FS);
87 return *this;
88}
89
91 StringRef FS, const TargetMachine &TM)
92 : CSKYGenSubtargetInfo(TT, CPU, TuneCPU, FS),
93 FrameLowering(initializeSubtargetDependencies(TT, CPU, TuneCPU, FS)),
94 InstrInfo(*this), RegInfo(), TLInfo(TM, *this) {}
95
98
99 if (FloatABI == FloatABI::Default)
100 return UseHardFloatABI;
101 else
102 return FloatABI == FloatABI::Hard;
103}
const char LLVMTargetMachineRef TM
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)
bool useHardFloatABI() const
CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, const TargetMachine &TM)
const CSKYTargetLowering * getTargetLowering() const override
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
const TargetMachine & getTargetMachine() const
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
TargetOptions Options
FloatABI::ABIType FloatABIType
FloatABIType - This setting is set by -float-abi=xxx option is specfied on the command line.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18