1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
//! Original PTX specification:
//!
//! st{.weak}{.ss}{.cop}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
//! st{.weak}{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
//! st.volatile{.ss}{.vec}.type [a], b;
//! st.relaxed.scope{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
//! st.release.scope{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
//! st.mmio.relaxed.sys{.global}.type [a], b;
//! .ss = { .global, .local, .param, .param::func, .shared, .shared::cta, .shared::cluster};
//! .level1::eviction_priority = { .L1::evict_normal, .L1::evict_unchanged,
//! .L1::evict_first, .L1::evict_last, .L1::no_allocate };
//! .level2::eviction_priority = { .L2::evict_normal, .L2::evict_first, .L2::evict_last };
//! .level::cache_hint = { .L2::cache_hint };
//! .cop = { .wb, .cg, .cs, .wt };
//! .sem = { .relaxed, .release };
//! .scope = { .cta, .cluster, .gpu, .sys };
//! .vec = { .v2, .v4, .v8 };
//! .type = { .b8, .b16, .b32, .b64, .b128,
//! .u8, .u16, .u32, .u64,
//! .s8, .s16, .s32, .s64,
//! .f32, .f64 };
#![allow(unused)]
use crate::r#type::common::*;
pub mod section_0 {
use crate::Spanned;
use crate::parser::Span;
use crate::r#type::common::*;
use serde::Serialize;
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Ss {
SharedCluster, // .shared::cluster
ParamFunc, // .param::func
SharedCta, // .shared::cta
Global, // .global
Shared, // .shared
Local, // .local
Param, // .param
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Cop {
Wb, // .wb
Cg, // .cg
Cs, // .cs
Wt, // .wt
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum LevelCacheHint {
L2CacheHint, // .L2::cache_hint
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Vec {
V2, // .v2
V4, // .v4
V8, // .v8
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Type {
B128, // .b128
B16, // .b16
B32, // .b32
B64, // .b64
U16, // .u16
U32, // .u32
U64, // .u64
S16, // .s16
S32, // .s32
S64, // .s64
F32, // .f32
F64, // .f64
B8, // .b8
U8, // .u8
S8, // .s8
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Level1EvictionPriority {
L1EvictUnchanged, // .L1::evict_unchanged
L1EvictNormal, // .L1::evict_normal
L1EvictFirst, // .L1::evict_first
L1NoAllocate, // .L1::no_allocate
L1EvictLast, // .L1::evict_last
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Level2EvictionPriority {
L2EvictNormal, // .L2::evict_normal
L2EvictFirst, // .L2::evict_first
L2EvictLast, // .L2::evict_last
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Scope {
Cluster, // .cluster
Cta, // .cta
Gpu, // .gpu
Sys, // .sys
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct StWeakSsCopLevelCacheHintVecType {
pub weak: bool, // {.weak}
pub ss: Option<Ss>, // {.ss}
pub cop: Option<Cop>, // {.cop}
pub level_cache_hint: Option<LevelCacheHint>, // {.level::cache_hint}
pub vec: Option<Vec>, // {.vec}
pub type_: Type, // .type
pub a: AddressOperand, // [a]
pub b: GeneralOperand, // b
pub cache_policy: Option<GeneralOperand>, // {, cache-policy}
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct StWeakSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType {
pub weak: bool, // {.weak}
pub ss: Option<Ss>, // {.ss}
pub level1_eviction_priority: Option<Level1EvictionPriority>, // {.level1::eviction_priority}
pub level2_eviction_priority: Option<Level2EvictionPriority>, // {.level2::eviction_priority}
pub level_cache_hint: Option<LevelCacheHint>, // {.level::cache_hint}
pub vec: Option<Vec>, // {.vec}
pub type_: Type, // .type
pub a: AddressOperand, // [a]
pub b: GeneralOperand, // b
pub cache_policy: Option<GeneralOperand>, // {, cache-policy}
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct StVolatileSsVecType {
pub volatile: (), // .volatile
pub ss: Option<Ss>, // {.ss}
pub vec: Option<Vec>, // {.vec}
pub type_: Type, // .type
pub a: AddressOperand, // [a]
pub b: GeneralOperand, // b
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct StRelaxedScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType {
pub relaxed: (), // .relaxed
pub scope: Scope, // .scope
pub ss: Option<Ss>, // {.ss}
pub level1_eviction_priority: Option<Level1EvictionPriority>, // {.level1::eviction_priority}
pub level2_eviction_priority: Option<Level2EvictionPriority>, // {.level2::eviction_priority}
pub level_cache_hint: Option<LevelCacheHint>, // {.level::cache_hint}
pub vec: Option<Vec>, // {.vec}
pub type_: Type, // .type
pub a: AddressOperand, // [a]
pub b: GeneralOperand, // b
pub cache_policy: Option<GeneralOperand>, // {, cache-policy}
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct StReleaseScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType {
pub release: (), // .release
pub scope: Scope, // .scope
pub ss: Option<Ss>, // {.ss}
pub level1_eviction_priority: Option<Level1EvictionPriority>, // {.level1::eviction_priority}
pub level2_eviction_priority: Option<Level2EvictionPriority>, // {.level2::eviction_priority}
pub level_cache_hint: Option<LevelCacheHint>, // {.level::cache_hint}
pub vec: Option<Vec>, // {.vec}
pub type_: Type, // .type
pub a: AddressOperand, // [a]
pub b: GeneralOperand, // b
pub cache_policy: Option<GeneralOperand>, // {, cache-policy}
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct StMmioRelaxedSysGlobalType {
pub mmio: (), // .mmio
pub relaxed: (), // .relaxed
pub sys: (), // .sys
pub global: bool, // {.global}
pub type_: Type, // .type
pub a: AddressOperand, // [a]
pub b: GeneralOperand, // b
pub span: Span,
}
}
// Re-export types with section suffixes to avoid naming conflicts
// e.g., Type0 for section_0::Type, Type1 for section_1::Type
pub use section_0::Cop as Cop0;
pub use section_0::Level1EvictionPriority as Level1EvictionPriority0;
pub use section_0::Level2EvictionPriority as Level2EvictionPriority0;
pub use section_0::LevelCacheHint as LevelCacheHint0;
pub use section_0::Scope as Scope0;
pub use section_0::Ss as Ss0;
pub use section_0::StMmioRelaxedSysGlobalType;
pub use section_0::StRelaxedScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType;
pub use section_0::StReleaseScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType;
pub use section_0::StVolatileSsVecType;
pub use section_0::StWeakSsCopLevelCacheHintVecType;
pub use section_0::StWeakSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType;
pub use section_0::Type as Type0;
pub use section_0::Vec as Vec0;