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::buffer @ref buffer
7namespace mim {
8namespace plug::buffer {
9
10static constexpr plugin_t Plugin_Id = 0xd61c71930000000;
11
12/// @name `buffer.Buf`
13///@{
14enum class Buf : flags_t {
15};
16
17const Def* normalize_Buf(const Def*, const Def*, const Def*);
18///@}
19
20/// @name `buffer.alloc`
21///@{
22enum class alloc : flags_t {
23};
24
25///@}
26
27/// @name `buffer.read`
28///@{
29enum class read : flags_t {
30};
31
32const Def* normalize_read(const Def*, const Def*, const Def*);
33///@}
34
35/// @name `buffer.write`
36///@{
37enum class write : flags_t {
38};
39
40const Def* normalize_write(const Def*, const Def*, const Def*);
41///@}
42
43/// @name `buffer.init`
44///@{
45enum class init : flags_t {
46};
47
48///@}
49
50/// @name `buffer.lit`
51///@{
52enum class lit : flags_t {
53};
54
55///@}
56
57/// @name `buffer.shape`
58///@{
59enum class shape : flags_t {
60};
61
62const Def* normalize_shape(const Def*, const Def*, const Def*);
63///@}
64
65/// @name `buffer.copy`
66///@{
67enum class copy : flags_t {
68};
69
70///@}
71
72/// @name `buffer.free`
73///@{
74enum class free : flags_t {
75};
76
77///@}
78
79/// @name `buffer.lower_ptr`
80///@{
81enum class lower_ptr : flags_t {
82};
83
84///@}
85
87
88#define MIM_buffer_NORMALIZER_IMPL \
89 void register_normalizers(Normalizers& normalizers) {\
90 normalizers[flags_t(Annex::Base<Buf>)] = &normalize_Buf; \
91 normalizers[flags_t(Annex::Base<read>)] = &normalize_read; \
92 normalizers[flags_t(Annex::Base<write>)] = &normalize_write; \
93 normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
94 }
95} // namespace plug::buffer
96
97#ifndef DOXYGEN // don't include in Doxygen documentation
98
99template<> constexpr flags_t Annex::Base<plug::buffer::Buf> = 0xd61c71930000000;
100template<> constexpr size_t Annex::Num<plug::buffer::Buf> = 0;
101template<> constexpr flags_t Annex::Base<plug::buffer::alloc> = 0xd61c71930000100;
102template<> constexpr size_t Annex::Num<plug::buffer::alloc> = 0;
103template<> constexpr flags_t Annex::Base<plug::buffer::read> = 0xd61c71930000200;
104template<> constexpr size_t Annex::Num<plug::buffer::read> = 0;
105template<> constexpr flags_t Annex::Base<plug::buffer::write> = 0xd61c71930000300;
106template<> constexpr size_t Annex::Num<plug::buffer::write> = 0;
107template<> constexpr flags_t Annex::Base<plug::buffer::init> = 0xd61c71930000400;
108template<> constexpr size_t Annex::Num<plug::buffer::init> = 0;
109template<> constexpr flags_t Annex::Base<plug::buffer::lit> = 0xd61c71930000500;
110template<> constexpr size_t Annex::Num<plug::buffer::lit> = 0;
111template<> constexpr flags_t Annex::Base<plug::buffer::shape> = 0xd61c71930000600;
112template<> constexpr size_t Annex::Num<plug::buffer::shape> = 0;
113template<> constexpr flags_t Annex::Base<plug::buffer::copy> = 0xd61c71930000700;
114template<> constexpr size_t Annex::Num<plug::buffer::copy> = 0;
115template<> constexpr flags_t Annex::Base<plug::buffer::free> = 0xd61c71930000800;
116template<> constexpr size_t Annex::Num<plug::buffer::free> = 0;
117template<> constexpr flags_t Annex::Base<plug::buffer::lower_ptr> = 0xd61c71930000900;
118template<> constexpr size_t Annex::Num<plug::buffer::lower_ptr> = 0;
119
120template<> struct Axm::IsANode<plug::buffer::lower_ptr> { using type = Axm; };
121
122#endif
123} // namespace mim
124
125#ifndef DOXYGEN // don't include in Doxygen documentation
126
127
128#endif
Base class for all Defs.
Definition def.h:289
The buffer Plugin
Definition buffer.h:8
const Def * normalize_write(const Def *, const Def *, const Def *)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_read(const Def *type, const Def *, const Def *arg)
read (constant v) idx ↦ v.
void register_normalizers(Normalizers &normalizers)
const Def * normalize_shape(const Def *type, const Def *callee, const Def *arg)
shape (r, s, T) (buf, i) ↦ s#i; the logical shape, since the type of buf has its size-1 axes folded a...
const Def * normalize_Buf(const Def *, const Def *callee, const Def *arg)
Buf (r, s, T) with literal size-1 axes in s ↦ Buf (r', s', T) with those axes dropped.
Definition ast.h:16
u64 flags_t
Definition types.h:39
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:125
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:273
static constexpr flags_t Base
Definition plugin.h:274