blob: f374d484974c458b7220220ef781fb245aff0d44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// SPDX-License-Identifier: GPL-3.0-or-later
#include "TableGenBackends.h"
#include <sstream>
#include <string>
namespace rcc::targetgen {
std::string emitSubtarget(const NormalizedTargetModel &Model) {
std::ostringstream Output;
Output << "constexpr std::array<SchedulingClassInfo, " << Model.SchedulingClasses.size()
<< "> GeneratedSchedulingClasses = {{\n";
for (const NormalizedSchedulingClass &Class : Model.SchedulingClasses) {
Output << " {SchedulingClassID::fromValue(" << Class.ID << "), ";
appendQuoted(Output, Class.Name);
Output << ", " << Class.MicroOps << ", " << Class.Latency << "},\n";
}
Output << "}};\n\n";
return Output.str();
}
} // namespace rcc::targetgen
|