MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/axm.h>
4#include <mim/plugin.h>
5
6/// @namespace mim::plug::mem @ref mem
7namespace mim {
8namespace plug::mem {
9
10static constexpr plugin_t Plugin_Id = 0x3863800000000000;
11
12/// @name %%mem.M
13///@{
14enum class M : flags_t {
15};
16
17///@}
18
19/// @name %%mem.Ptr
20///@{
21enum class Ptr : flags_t {
22};
23
24///@}
25
26/// @name %%mem.Ptr0
27///@{
28enum class Ptr0 : flags_t {
29};
30
31///@}
32
33/// @name %%mem.load
34///@{
35enum class load : flags_t {
36};
37
38const Def* normalize_load(const Def*, const Def*, const Def*);
39///@}
40
41/// @name %%mem.store
42///@{
43enum class store : flags_t {
44};
45
46const Def* normalize_store(const Def*, const Def*, const Def*);
47///@}
48
49/// @name %%mem.remem
50///@{
51enum class remem : flags_t {
52};
53
54const Def* normalize_remem(const Def*, const Def*, const Def*);
55///@}
56
57/// @name %%mem.alloc
58///@{
59enum class alloc : flags_t {
60};
61
62///@}
63
64/// @name %%mem.slot
65///@{
66enum class slot : flags_t {
67};
68
69///@}
70
71/// @name %%mem.malloc
72///@{
73enum class malloc : flags_t {
74};
75
76///@}
77
78/// @name %%mem.free
79///@{
80enum class free : flags_t {
81};
82
83///@}
84
85/// @name %%mem.mslot
86///@{
87enum class mslot : flags_t {
88};
89
90///@}
91
92/// @name %%mem.lea
93///@{
94enum class lea : flags_t {
95};
96
97const Def* normalize_lea(const Def*, const Def*, const Def*);
98///@}
99
100/// @name %%mem.add_mem
101///@{
102enum class add_mem : flags_t {
103};
104
105///@}
106
107/// @name %%mem.seo
108///@{
109enum class seo : flags_t {
110};
111
112///@}
113
114/// @name %%mem.remem_repl
115///@{
116enum class remem_repl : flags_t {
117};
118
119///@}
120
121/// @name %%mem.alloc2malloc_repl
122///@{
124};
125
126///@}
127
129
130#define MIM_mem_NORMALIZER_IMPL \
131 void register_normalizers(Normalizers& normalizers) {\
132 normalizers[flags_t(Annex::Base<load>)] = &normalize_load; \
133 normalizers[flags_t(Annex::Base<store>)] = &normalize_store; \
134 normalizers[flags_t(Annex::Base<remem>)] = &normalize_remem; \
135 normalizers[flags_t(Annex::Base<lea>)] = &normalize_lea; \
136 }
137} // namespace plug::mem
138
139#ifndef DOXYGEN // don't include in Doxygen documentation
140
141template<> constexpr flags_t Annex::Base<plug::mem::M> = 0x3863800000000000;
142template<> constexpr size_t Annex::Num<plug::mem::M> = 0;
143template<> constexpr flags_t Annex::Base<plug::mem::Ptr> = 0x3863800000000100;
144template<> constexpr size_t Annex::Num<plug::mem::Ptr> = 0;
145template<> constexpr flags_t Annex::Base<plug::mem::Ptr0> = 0x3863800000000200;
146template<> constexpr size_t Annex::Num<plug::mem::Ptr0> = 0;
147template<> constexpr flags_t Annex::Base<plug::mem::load> = 0x3863800000000300;
148template<> constexpr size_t Annex::Num<plug::mem::load> = 0;
149template<> constexpr flags_t Annex::Base<plug::mem::store> = 0x3863800000000400;
150template<> constexpr size_t Annex::Num<plug::mem::store> = 0;
151template<> constexpr flags_t Annex::Base<plug::mem::remem> = 0x3863800000000500;
152template<> constexpr size_t Annex::Num<plug::mem::remem> = 0;
153template<> constexpr flags_t Annex::Base<plug::mem::alloc> = 0x3863800000000600;
154template<> constexpr size_t Annex::Num<plug::mem::alloc> = 0;
155template<> constexpr flags_t Annex::Base<plug::mem::slot> = 0x3863800000000700;
156template<> constexpr size_t Annex::Num<plug::mem::slot> = 0;
157template<> constexpr flags_t Annex::Base<plug::mem::malloc> = 0x3863800000000800;
158template<> constexpr size_t Annex::Num<plug::mem::malloc> = 0;
159template<> constexpr flags_t Annex::Base<plug::mem::free> = 0x3863800000000900;
160template<> constexpr size_t Annex::Num<plug::mem::free> = 0;
161template<> constexpr flags_t Annex::Base<plug::mem::mslot> = 0x3863800000000a00;
162template<> constexpr size_t Annex::Num<plug::mem::mslot> = 0;
163template<> constexpr flags_t Annex::Base<plug::mem::lea> = 0x3863800000000b00;
164template<> constexpr size_t Annex::Num<plug::mem::lea> = 0;
165template<> constexpr flags_t Annex::Base<plug::mem::add_mem> = 0x3863800000000c00;
166template<> constexpr size_t Annex::Num<plug::mem::add_mem> = 0;
167template<> constexpr flags_t Annex::Base<plug::mem::seo> = 0x3863800000000d00;
168template<> constexpr size_t Annex::Num<plug::mem::seo> = 0;
169template<> constexpr flags_t Annex::Base<plug::mem::remem_repl> = 0x3863800000000e00;
170template<> constexpr size_t Annex::Num<plug::mem::remem_repl> = 0;
171template<> constexpr flags_t Annex::Base<plug::mem::alloc2malloc_repl> = 0x3863800000000f00;
172template<> constexpr size_t Annex::Num<plug::mem::alloc2malloc_repl> = 0;
173
174template<> struct Axm::IsANode<plug::mem::Ptr0> { using type = Axm; };
175template<> struct Axm::IsANode<plug::mem::add_mem> { using type = Axm; };
176template<> struct Axm::IsANode<plug::mem::seo> { using type = Axm; };
177template<> struct Axm::IsANode<plug::mem::remem_repl> { using type = Axm; };
178template<> struct Axm::IsANode<plug::mem::alloc2malloc_repl> { using type = Axm; };
179
180#endif
181} // namespace mim
182
183#ifndef DOXYGEN // don't include in Doxygen documentation
184
185
186#endif
Base class for all Defs.
Definition def.h:261
The mem Plugin
Definition mem.h:11
void register_normalizers(Normalizers &normalizers)
const Def * normalize_lea(const Def *, const Def *, const Def *arg)
const Def * normalize_remem(const Def *, const Def *, const Def *)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_store(const Def *, const Def *, const Def *arg)
const Def * normalize_load(const Def *type, const Def *, const Def *arg)
Definition ast.h:14
u64 flags_t
Definition types.h:39
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:22
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:109
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:147
static constexpr flags_t Base
Definition plugin.h:148