LLVM: lib/TargetParser/PPCTargetParser.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
17
18#define GET_SUBTARGETFEATURES_ENUM
19#define GET_SUBTARGETFEATURES_KV
20#include "llvm/TargetParser/PPCGenTargetFeatures.inc"
21
22namespace llvm {
23namespace PPC {
24
29
31#define PPC_CPU(Name, Linux_SUPPORT_METHOD, LinuxID, AIX_SUPPORT_METHOD, \
32 AIXID) \
33 {Name},
34#include "llvm/TargetParser/PPCTargetParser.def"
35};
36
39 if (C.Name == CPU)
40 return &C;
41 return nullptr;
42}
43
45
46
47
48
49
51 .Cases({"common", "405"}, "generic")
52 .Cases({"ppc440", "440fp"}, "440")
53 .Cases({"630", "power3"}, "pwr3")
54 .Case("G3", "g3")
55 .Case("G4", "g4")
56 .Case("G4+", "g4+")
57 .Case("8548", "e500")
58 .Case("ppc970", "970")
59 .Case("G5", "g5")
60 .Case("ppca2", "a2")
61 .Case("power4", "pwr4")
62 .Case("power5", "pwr5")
63 .Case("power5x", "pwr5x")
64 .Case("power5+", "pwr5+")
65 .Case("power6", "pwr6")
66 .Case("power6x", "pwr6x")
67 .Case("power7", "pwr7")
68 .Case("power8", "pwr8")
69 .Case("power9", "pwr9")
70 .Case("power10", "pwr10")
71 .Case("power11", "pwr11")
72 .Cases({"powerpc", "powerpc32"}, "ppc")
73 .Case("powerpc64", "ppc64")
74 .Case("powerpc64le", "ppc64le")
76}
77
82
87
91 return false;
92 return true;
93}
94
96 if (!CPUName.empty()) {
97 if (CPUName == "native") {
99 if (!CPU.empty() && CPU != "generic")
100 return CPU;
101 }
102
104 if (CPU != "generic" && CPU != "native")
105 return CPU;
106 }
107
108
109
110 if (T.isOSAIX())
111 return "pwr7";
113 return "ppc64le";
115 return "ppc64";
116
117 return "ppc";
118}
119
123
126 std::optional<StringMap> FeaturesOpt =
128
129 if (!FeaturesOpt.has_value())
130 return std::nullopt;
131
133
134
135
136 if (CPU == "8548")
137 Features["spe"] = true;
138
139
140
141 if (.isArch64Bit()) {
142 auto It = Features.find("quadword-atomics");
143 if (It != Features.end())
144 It->second = false;
145 }
146 return Features;
147}
148}
149}
Analysis containing CSE Info
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
iterator find(StringRef Key)
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
Triple - Helper class for working with autoconf configuration names.
@ C
The default llvm calling convention, compatible with C.
LLVM_ABI StringRef getNormalizedPPCTargetCPU(const Triple &T, StringRef CPUName="")
Definition PPCTargetParser.cpp:95
LLVM_ABI std::optional< llvm::StringMap< bool > > getPPCDefaultTargetFeatures(const Triple &T, StringRef CPUName)
Definition PPCTargetParser.cpp:124
constexpr CPUInfo PPCCPUInfo[]
Definition PPCTargetParser.cpp:30
LLVM_ABI bool isValidCPU(StringRef CPU)
Definition PPCTargetParser.cpp:88
LLVM_ABI StringRef normalizeCPUName(StringRef CPUName)
Definition PPCTargetParser.cpp:44
static const CPUInfo * getCPUInfoByName(StringRef CPU)
Definition PPCTargetParser.cpp:37
LLVM_ABI void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values)
Definition PPCTargetParser.cpp:83
LLVM_ABI StringRef getNormalizedPPCTuneCPU(const Triple &T, StringRef CPUName="")
Definition PPCTargetParser.cpp:120
LLVM_ABI void fillValidCPUList(SmallVectorImpl< StringRef > &Values)
Definition PPCTargetParser.cpp:78
LLVM_ABI StringRef getHostCPUName()
getHostCPUName - Get the LLVM name for the host CPU.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::optional< llvm::StringMap< bool > > getCPUDefaultTargetFeatures(StringRef CPU, ArrayRef< BasicSubtargetSubTypeKV > ProcDesc, ArrayRef< BasicSubtargetFeatureKV > ProcFeatures)
Definition PPCTargetParser.cpp:25
StringLiteral Name
Definition PPCTargetParser.cpp:26