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.fresh
58///@{
59enum class fresh : flags_t {
60};
61
62///@}
63
64/// @name %%mem.alloc
65///@{
66enum class alloc : flags_t {
67};
68
69///@}
70
71/// @name %%mem.slot
72///@{
73enum class slot : flags_t {
74};
75
76///@}
77
78/// @name %%mem.malloc
79///@{
80enum class malloc : flags_t {
81};
82
83///@}
84
85/// @name %%mem.free
86///@{
87enum class free : flags_t {
88};
89
90///@}
91
92/// @name %%mem.mslot
93///@{
94enum class mslot : flags_t {
95};
96
97///@}
98
99/// @name %%mem.lea
100///@{
101enum class lea : flags_t {
102};
103
104const Def* normalize_lea(const Def*, const Def*, const Def*);
105///@}
106
107/// @name %%mem.add_mem
108///@{
109enum class add_mem : flags_t {
110};
111
112///@}
113
114/// @name %%mem.seo
115///@{
116enum class seo : flags_t {
117};
118
119///@}
120
121/// @name %%mem.remem_repl
122///@{
123enum class remem_repl : flags_t {
124};
125
126///@}
127
128/// @name %%mem.alloc2malloc_repl
129///@{
131};
132
133///@}
134
136
137#define MIM_mem_NORMALIZER_IMPL \
138 void register_normalizers(Normalizers& normalizers) {\
139 normalizers[flags_t(Annex::Base<load>)] = &normalize_load; \
140 normalizers[flags_t(Annex::Base<store>)] = &normalize_store; \
141 normalizers[flags_t(Annex::Base<remem>)] = &normalize_remem; \
142 normalizers[flags_t(Annex::Base<lea>)] = &normalize_lea; \
143 }
144} // namespace plug::mem
145
146#ifndef DOXYGEN // don't include in Doxygen documentation
147
148template<> constexpr flags_t Annex::Base<plug::mem::M> = 0x3863800000000000;
149template<> constexpr size_t Annex::Num<plug::mem::M> = 0;
150template<> constexpr flags_t Annex::Base<plug::mem::Ptr> = 0x3863800000000100;
151template<> constexpr size_t Annex::Num<plug::mem::Ptr> = 0;
152template<> constexpr flags_t Annex::Base<plug::mem::Ptr0> = 0x3863800000000200;
153template<> constexpr size_t Annex::Num<plug::mem::Ptr0> = 0;
154template<> constexpr flags_t Annex::Base<plug::mem::load> = 0x3863800000000300;
155template<> constexpr size_t Annex::Num<plug::mem::load> = 0;
156template<> constexpr flags_t Annex::Base<plug::mem::store> = 0x3863800000000400;
157template<> constexpr size_t Annex::Num<plug::mem::store> = 0;
158template<> constexpr flags_t Annex::Base<plug::mem::remem> = 0x3863800000000500;
159template<> constexpr size_t Annex::Num<plug::mem::remem> = 0;
160template<> constexpr flags_t Annex::Base<plug::mem::fresh> = 0x3863800000000600;
161template<> constexpr size_t Annex::Num<plug::mem::fresh> = 0;
162template<> constexpr flags_t Annex::Base<plug::mem::alloc> = 0x3863800000000700;
163template<> constexpr size_t Annex::Num<plug::mem::alloc> = 0;
164template<> constexpr flags_t Annex::Base<plug::mem::slot> = 0x3863800000000800;
165template<> constexpr size_t Annex::Num<plug::mem::slot> = 0;
166template<> constexpr flags_t Annex::Base<plug::mem::malloc> = 0x3863800000000900;
167template<> constexpr size_t Annex::Num<plug::mem::malloc> = 0;
168template<> constexpr flags_t Annex::Base<plug::mem::free> = 0x3863800000000a00;
169template<> constexpr size_t Annex::Num<plug::mem::free> = 0;
170template<> constexpr flags_t Annex::Base<plug::mem::mslot> = 0x3863800000000b00;
171template<> constexpr size_t Annex::Num<plug::mem::mslot> = 0;
172template<> constexpr flags_t Annex::Base<plug::mem::lea> = 0x3863800000000c00;
173template<> constexpr size_t Annex::Num<plug::mem::lea> = 0;
174template<> constexpr flags_t Annex::Base<plug::mem::add_mem> = 0x3863800000000d00;
175template<> constexpr size_t Annex::Num<plug::mem::add_mem> = 0;
176template<> constexpr flags_t Annex::Base<plug::mem::seo> = 0x3863800000000e00;
177template<> constexpr size_t Annex::Num<plug::mem::seo> = 0;
178template<> constexpr flags_t Annex::Base<plug::mem::remem_repl> = 0x3863800000000f00;
179template<> constexpr size_t Annex::Num<plug::mem::remem_repl> = 0;
180template<> constexpr flags_t Annex::Base<plug::mem::alloc2malloc_repl> = 0x3863800000001000;
181template<> constexpr size_t Annex::Num<plug::mem::alloc2malloc_repl> = 0;
182
183template<> struct Axm::IsANode<plug::mem::Ptr0> { using type = Axm; };
184template<> struct Axm::IsANode<plug::mem::add_mem> { using type = Axm; };
185template<> struct Axm::IsANode<plug::mem::seo> { using type = Axm; };
186template<> struct Axm::IsANode<plug::mem::remem_repl> { using type = Axm; };
187template<> struct Axm::IsANode<plug::mem::alloc2malloc_repl> { using type = Axm; };
188
189#endif
190} // namespace mim
191
192#ifndef DOXYGEN // don't include in Doxygen documentation
193
194
195#endif
Base class for all Defs.
Definition def.h:273
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:16
u64 flags_t
Definition types.h:39
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:122
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:247
static constexpr flags_t Base
Definition plugin.h:248