File: CSKYSubtarget.h

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (120 lines) | stat: -rw-r--r-- 4,097 bytes parent folder | download | duplicates (3)
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
//===-- CSKYSubtarget.h - Define Subtarget for the CSKY----------*- 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 CSKY specific subclass of TargetSubtargetInfo.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_CSKY_CSKYSUBTARGET_H
#define LLVM_LIB_TARGET_CSKY_CSKYSUBTARGET_H

#include "CSKYFrameLowering.h"
#include "CSKYISelLowering.h"
#include "CSKYInstrInfo.h"
#include "CSKYRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Target/TargetMachine.h"

#define GET_SUBTARGETINFO_HEADER
#include "CSKYGenSubtargetInfo.inc"

namespace llvm {
class StringRef;

class CSKYSubtarget : public CSKYGenSubtargetInfo {
  virtual void anchor();

  CSKYFrameLowering FrameLowering;
  CSKYInstrInfo InstrInfo;
  CSKYRegisterInfo RegInfo;
  CSKYTargetLowering TLInfo;
  SelectionDAGTargetInfo TSInfo;

  bool UseHardFloat;
  bool UseHardFloatABI;
  bool HasFPUv2SingleFloat;
  bool HasFPUv2DoubleFloat;
  bool HasFPUv3SingleFloat;
  bool HasFPUv3DoubleFloat;

  bool HasBTST16;
  bool HasJAVA;
  bool HasExtendLrw;
  bool HasDoloop;
  bool HasHighRegisters;

  bool HasE1;
  bool HasE2;
  bool Has2E3;
  bool HasMP;
  bool Has3E3r1;
  bool Has3r1E3r2;
  bool Has3r2E3r3;
  bool Has3E7;
  bool HasMP1E2;
  bool Has7E10;
  bool Has10E60;

public:
  CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU,
                StringRef FS, const TargetMachine &TM);

  const CSKYFrameLowering *getFrameLowering() const override {
    return &FrameLowering;
  }
  const CSKYInstrInfo *getInstrInfo() const override { return &InstrInfo; }
  const CSKYRegisterInfo *getRegisterInfo() const override { return &RegInfo; }
  const CSKYTargetLowering *getTargetLowering() const override {
    return &TLInfo;
  }
  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
    return &TSInfo;
  }

  /// Initializes using the passed in CPU and feature strings so that we can
  /// use initializer lists for subtarget initialization.
  CSKYSubtarget &initializeSubtargetDependencies(const Triple &TT,
                                                 StringRef CPU,
                                                 StringRef TuneCPU,
                                                 StringRef FS);

  // Generated by inc file
  void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);

  bool useHardFloatABI() const;
  bool useHardFloat() const { return UseHardFloat; }
  bool hasFPUv2SingleFloat() const { return HasFPUv2SingleFloat; }
  bool hasFPUv2DoubleFloat() const { return HasFPUv2DoubleFloat; }
  bool hasFPUv2() const { return HasFPUv2SingleFloat || HasFPUv2DoubleFloat; }
  bool hasFPUv3SingleFloat() const { return HasFPUv3SingleFloat; }
  bool hasFPUv3DoubleFloat() const { return HasFPUv3DoubleFloat; }
  bool hasFPUv3() const { return HasFPUv3SingleFloat || HasFPUv3DoubleFloat; }
  bool hasAnyFloatExt() const { return hasFPUv2() || hasFPUv3(); };

  bool hasBTST16() const { return HasBTST16; }
  bool hasJAVA() const { return HasJAVA; }
  bool hasExtendLrw() const { return HasExtendLrw; }
  bool hasDoloop() const { return HasDoloop; }
  bool hasHighRegisters() const { return HasHighRegisters; }

  bool hasE1() const { return HasE1; }
  bool hasE2() const { return HasE2; }
  bool has2E3() const { return Has2E3; }
  bool has3r1E3r2() const { return Has3r1E3r2; }
  bool has3r2E3r3() const { return Has3r2E3r3; }
  bool has3E3r1() const { return Has3E3r1; }
  bool has3E7() const { return Has3E7; }
  bool hasMP() const { return HasMP; }
  bool hasMP1E2() const { return HasMP1E2; }
  bool has7E10() const { return Has7E10; }
  bool has10E60() const { return Has10E60; }
};
} // namespace llvm

#endif // LLVM_LIB_TARGET_CSKY_CSKYSUBTARGET_H