MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
x86.cpp
Go to the documentation of this file.
1#include "mim/plug/x86/x86.h"
2
3#include <mim/plugin.h>
4
6
7#include "mim/plug/x86/emit.h"
10
11using namespace mim;
12
17
18// clang-format off
19static constexpr PluginArg known_args[] = {
20 {"o=<file>, output=<file>", "Writes the assembly to `<file>` instead of the default `<world>.s`/`a.s`; `<file>` may be `-` for stdout."},
21 {"live=<file>", "Writes the output of `mach.live` to `<file>` instead of stdout."},
22 {"k=<n>", "Lets `mach.spilling` keep at most `<n>` general-purpose values in registers instead of 14."},
23 {"isel-dot=<file>", "Writes the instruction-selection PBQP graph of `x86.isel` in Graphviz DOT format to `<file>`, with the chosen options highlighted; `<file>` may be `-` for stdout."},
24 {"color-dot=<file>", "Writes the register-assignment PBQP graph of each function in Graphviz DOT format to `<file>`, with the chosen options highlighted; `<file>` may be `-` for stdout."},
25};
26// clang-format on
27
29 plugin.register_normalizers = plug::x86::register_normalizers;
30 plugin.register_phases = reg_phases;
31 plugin.args = known_args;
32 plugin.num_args = std::size(known_args);
33 plugin.target = []() -> mim::Target* { return new plug::x86::Target(); };
34}
The machine a native backend compiles for, as far as libmim needs to know it.
Definition target.h:11
The machine facts of the x86-64 backend; the ABI is System V AMD64.
Definition target.h:11
void hook_isel(Flags2Phases &phases, const rules::Table &table)
Registers ISel with the rules table as the Phase of the backend's annex A.
Definition isel.h:60
void hook(Flags2Phases &phases)
Registers the Phase P for the annex A, constructed with the Target of the one loaded backend.
Definition phase.h:17
constexpr Table table
void register_normalizers(Normalizers &normalizers)
Definition ast.h:16
ankerl::unordered_dense::map< flags_t, std::function< std::unique_ptr< Phase >(World &)> > Flags2Phases
Maps an axiom of a Phase to a function that creates one.
Definition plugin.h:31
One -X <plugin>:<arg> a Plugin understands; see Arguments.
Definition plugin.h:35
#define MIM_PLUGIN_ENTRY(p)
Defines a Plugin's entry point; the body fills in the plugin handed to it, as in MIM_PLUGIN_ENTRY(dem...
Definition plugin.h:198
static void reg_phases(Flags2Phases &phases)
Definition x86.cpp:13
static constexpr PluginArg known_args[]
Definition x86.cpp:19