#include <array>#include <span>#include <string_view>#include <utility>#include <mim/util/types.h>Go to the source code of this file.
Classes | |
| struct | mim::plug::mach::rules::RefInfo |
| A ref of a matcher: its cover and how the lhs refers to it. More... | |
| struct | mim::plug::mach::rules::Use |
An operand position of a matcher in preorder: meta variable or Value ref index of the node owner. More... | |
| struct | mim::plug::mach::rules::Matcher |
| A matcher and the shape of its lhs; a cover's operands follow it in preorder. More... | |
| struct | mim::plug::mach::rules::Rewrite |
| A closed rule lhs ↦ rhs, whose metas want num_metas consecutive entries of wants. More... | |
| struct | mim::plug::mach::rules::Root |
The rewrites rewrites[first, first + num) with the root axiom flags; roots is sorted by it. More... | |
| struct | mim::plug::mach::rules::Conversion |
| A conversion rule x ↦ rhs, whose lhs is all of its meta variables: a value of non-terminal from as one of to. More... | |
| struct | mim::plug::mach::rules::Chains |
| The cheapest chains of conversions between two non-terminals: their costs and each one's first conversion. More... | |
| struct | mim::plug::mach::rules::Table |
| The generated tables of one backend, as its isel_rules.h defines them. More... | |
Namespaces | |
| namespace | mim |
| namespace | mim::plug |
| namespace | mim::plug::mach |
| The mach Plugin | |
| namespace | mim::plug::mach::rules |
| The closed rewrite rules of a backend's isel plugin as C++; its gen writes them to the backend's isel_rules.h. | |
Macros | |
| #define | MIM_MACH_RULE_WANTS(X) |
| #define | MIM_MACH_RULE_TYS(X) |
Typedefs | |
| using | mim::plug::mach::rules::MatchFn = bool (*)(const Def* def, u32 swap, const Def** metas, const Def** refs) |
Matches the root def with the commuting nodes in swap swapped and binds metas and refs. | |
| using | mim::plug::mach::rules::BuildFn = const Def* (*)(World&, const Def* const* holes) |
Builds the rhs from holes, one per meta variable, already in the new world. | |
Enumerations | |
| enum class | mim::plug::mach::rules::Want : u8 |
| What a rule wants of the term a meta variable matches; a Param is bound but no operand. More... | |
| enum class | mim::plug::mach::rules::Ty : u8 |
| The non-terminal a rule yields by the type of its rhs: a register of either class, an address without/with an index, [I64, I2], or a register that holds its value zero-extended. More... | |
| enum class | mim::plug::mach::rules::Ref : u8 { mim::plug::mach::rules::Value , mim::plug::mach::rules::Mem } |
| How the lhs refers to one of its inner nodes. More... | |
Costs | |
Shared by an isel plugin's gen, which checks the rule set with them, and isel. | |
| #define | X(w) |
| #define | X(t) |
| #define | X(_) |
| constexpr u32 | mim::plug::mach::rules::Inf = u32(-1) |
| constexpr size_t | mim::plug::mach::rules::Num_Tys = 0 MIM_MACH_RULE_TYS(X) |
| constexpr u32 | mim::plug::mach::rules::Copy = 1 |
| A register-to-register copy, which move elimination makes free of latency. | |
| constexpr u32 | mim::plug::mach::rules::add (u32 a, u32 b) |
| constexpr bool | mim::plug::mach::rules::is_param (Want w) |
Is a meta variable that w wants bound to its rewrite rather than an operand? | |
| constexpr bool | mim::plug::mach::rules::is_literal (Want want) |
Does a hole of type want take a literal rather than a replacement? | |
| constexpr Want | mim::plug::mach::rules::literal_of (Want want) |
The literal form of a hole of type want, or want itself. | |
| constexpr bool | mim::plug::mach::rules::fills (Ty ty, Want want) |
Does a value of non-terminal ty fill a hole of type want as it is? | |
| constexpr Want | mim::plug::mach::rules::reg_want (Ty ty) |
The register hole that a value of non-terminal ty fills. | |
| constexpr bool | mim::plug::mach::rules::same_class (Ty ty, Want want) |
Is a value of non-terminal ty in the same register class as a hole of type want? | |
| struct mim::plug::mach::rules::RefInfo |
A ref of a matcher: its cover and how the lhs refers to it.
Definition at line 56 of file rule_table.h.
| Class Members | ||
|---|---|---|
| u8 | cover | |
| Ref | kind | |
| struct mim::plug::mach::rules::Use |
An operand position of a matcher in preorder: meta variable or Value ref index of the node owner.
Definition at line 62 of file rule_table.h.
| Class Members | ||
|---|---|---|
| u8 | index | |
| u8 | owner | |
| bool | ref | |
| struct mim::plug::mach::rules::Matcher |
| struct mim::plug::mach::rules::Rewrite |
A closed rule lhs ↦ rhs, whose metas want num_metas consecutive entries of wants.
Definition at line 79 of file rule_table.h.
| Class Members | ||
|---|---|---|
| BuildFn | build | |
| u32 | copy_swaps | Those of swaps whose operands differ only as a RegImm or RegSh, which a literal never fills. |
| u32 | cost | The summed instruction costs of its rhs. |
| u8 | maps | k + 1 if the rhs replaces cover k as a whole, or 0. |
| const Matcher * | match | |
| string_view | name | |
| u8 | num_metas | |
| flags_t | root | The axiom at the head of its lhs, or 0 for an Extract. |
| u32 | swaps | The swaps of match that may yield another match. |
| u32 | tied | The meta variables that a two-address instruction of the rhs overwrites. |
| Ty | type | The non-terminal its rhs yields. |
| u32 | wants | |
| struct mim::plug::mach::rules::Root |
| struct mim::plug::mach::rules::Conversion |
| struct mim::plug::mach::rules::Table |
The generated tables of one backend, as its isel_rules.h defines them.
Definition at line 220 of file rule_table.h.
| Class Members | ||
|---|---|---|
| const Chains & | chains | |
| span< const Conversion > | conversions | |
| span< const Matcher > | matchers | |
| size_t | max_covers | |
| size_t | max_metas | |
| size_t | max_refs | |
| span< const RefInfo > | refs | |
| span< const Rewrite > | rewrites | |
| span< const Root > | roots | |
| span< const Use > | uses | |
| span< const Want > | wants | |
| #define MIM_MACH_RULE_TYS | ( | X | ) |
| #define MIM_MACH_RULE_WANTS | ( | X | ) |
| #define X | ( | _ | ) |
Definition at line 29 of file rule_table.h.
| #define X | ( | t | ) |
Definition at line 29 of file rule_table.h.
| #define X | ( | w | ) |