LLVM  14.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"
14 
15 using namespace llvm;
16 
17 #define DEBUG_TYPE "csky-subtarget"
18 #define GET_SUBTARGETINFO_TARGET_DESC
19 #define GET_SUBTARGETINFO_CTOR
20 #include "CSKYGenSubtargetInfo.inc"
21 
22 void CSKYSubtarget::anchor() {}
23 
25  const Triple &TT, StringRef CPUName, StringRef TuneCPUName, StringRef FS) {
26 
27  if (CPUName.empty())
28  CPUName = "generic";
29  if (TuneCPUName.empty())
30  TuneCPUName = CPUName;
31 
32  UseHardFloat = false;
33  UseHardFloatABI = false;
34  HasFPUv2SingleFloat = false;
35  HasFPUv2DoubleFloat = false;
36  HasFPUv3SingleFloat = false;
37  HasFPUv3DoubleFloat = false;
38 
39  HasBTST16 = false;
40  HasJAVA = false;
41  HasExtendLrw = false;
42  HasDoloop = false;
43  HasHighRegisters = false;
44 
45  HasE1 = false;
46  HasE2 = false;
47  Has2E3 = false;
48  HasMP = false;
49  Has3E3r1 = false;
50  Has3r1E3r2 = false;
51  Has3r2E3r3 = false;
52  Has3E7 = false;
53  HasMP1E2 = false;
54  Has7E10 = false;
55  Has10E60 = false;
56 
57  ParseSubtargetFeatures(CPUName, TuneCPUName, FS);
58  return *this;
59 }
60 
62  StringRef FS, const TargetMachine &TM)
63  : CSKYGenSubtargetInfo(TT, CPU, TuneCPU, FS),
64  FrameLowering(initializeSubtargetDependencies(TT, CPU, TuneCPU, FS)),
65  InstrInfo(*this), RegInfo(), TLInfo(TM, *this) {}
66 
69 
70  if (FloatABI == FloatABI::Default)
71  return UseHardFloatABI;
72  else
73  return FloatABI == FloatABI::Hard;
74 }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::StringRef::empty
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:152
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::FloatABI::Hard
@ Hard
Definition: TargetOptions.h:31
llvm::CSKYSubtarget::CSKYSubtarget
CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, const TargetMachine &TM)
Definition: CSKYSubtarget.cpp:61
llvm::CSKYSubtarget::getTargetLowering
const CSKYTargetLowering * getTargetLowering() const override
Definition: CSKYSubtarget.h:73
CSKYSubtarget.h
llvm::FloatABI::Default
@ Default
Definition: TargetOptions.h:29
llvm::CSKYSubtarget
Definition: CSKYSubtarget.h:30
llvm::TargetOptions::FloatABIType
FloatABI::ABIType FloatABIType
FloatABIType - This setting is set by -float-abi=xxx option is specfied on the command line.
Definition: TargetOptions.h:359
llvm::CSKYSubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
llvm::TargetMachine::Options
TargetOptions Options
Definition: TargetMachine.h:121
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:80
llvm::CSKYSubtarget::initializeSubtargetDependencies
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...
Definition: CSKYSubtarget.cpp:24
llvm::CSKYSubtarget::useHardFloatABI
bool useHardFloatABI() const
Definition: CSKYSubtarget.cpp:67
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
this
Analysis the ScalarEvolution expression for r is this
Definition: README.txt:8
CSKYGenSubtargetInfo
llvm::TargetLoweringBase::getTargetMachine
const TargetMachine & getTargetMachine() const
Definition: TargetLowering.h:339
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47