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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
//! Original PTX specification:
//!
//! mbarrier.arrive{.sem}{.scope}{.state}.b64 state, [addr]{, count};
//! mbarrier.arrive{.sem}{.scope}{.shared::cluster}.b64 _, [addr] {,count};
//! mbarrier.arrive.expect_tx{.sem}{.scope}{.state}.b64 state, [addr], txCount;
//! mbarrier.arrive.expect_tx{.sem}{.scope}{.shared::cluster}.b64 _, [addr], txCount;
//! mbarrier.arrive.noComplete{.release}{.cta}{.state}.b64 state, [addr], count;
//! .sem = { .release, .relaxed };
//! .scope = { .cta, .cluster };
//! .state = { .shared, .shared::cta}
#![allow(unused)]
use crate::lexer::PtxToken;
use crate::unparser::{PtxUnparser, common::*};
pub mod section_0 {
use super::*;
use crate::r#type::instruction::mbarrier_arrive::section_0::*;
impl PtxUnparser for MbarrierArriveSemScopeStateB64 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "mbarrier");
push_directive(tokens, "arrive");
if let Some(sem_0) = self.sem.as_ref() {
match sem_0 {
Sem::Release => {
push_directive(tokens, "release");
}
Sem::Relaxed => {
push_directive(tokens, "relaxed");
}
}
}
if let Some(scope_1) = self.scope.as_ref() {
match scope_1 {
Scope::Cluster => {
push_directive(tokens, "cluster");
}
Scope::Cta => {
push_directive(tokens, "cta");
}
}
}
if let Some(state_2) = self.state.as_ref() {
match state_2 {
State::SharedCta => {
push_directive(tokens, "shared::cta");
}
State::Shared => {
push_directive(tokens, "shared");
}
}
}
push_directive(tokens, "b64");
self.state2.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.addr.unparse_tokens(tokens);
if self.count.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_3) = self.count.as_ref() {
opt_3.unparse_tokens(tokens);
}
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for MbarrierArriveSemScopeSharedClusterB64 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "mbarrier");
push_directive(tokens, "arrive");
if let Some(sem_4) = self.sem.as_ref() {
match sem_4 {
Sem::Release => {
push_directive(tokens, "release");
}
Sem::Relaxed => {
push_directive(tokens, "relaxed");
}
}
}
if let Some(scope_5) = self.scope.as_ref() {
match scope_5 {
Scope::Cluster => {
push_directive(tokens, "cluster");
}
Scope::Cta => {
push_directive(tokens, "cta");
}
}
}
if self.shared_cluster {
push_directive(tokens, "shared::cluster");
}
push_directive(tokens, "b64");
self.operand.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.addr.unparse_tokens(tokens);
if self.count.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_6) = self.count.as_ref() {
opt_6.unparse_tokens(tokens);
}
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for MbarrierArriveExpectTxSemScopeStateB64 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "mbarrier");
push_directive(tokens, "arrive");
push_directive(tokens, "expect_tx");
if let Some(sem_7) = self.sem.as_ref() {
match sem_7 {
Sem::Release => {
push_directive(tokens, "release");
}
Sem::Relaxed => {
push_directive(tokens, "relaxed");
}
}
}
if let Some(scope_8) = self.scope.as_ref() {
match scope_8 {
Scope::Cluster => {
push_directive(tokens, "cluster");
}
Scope::Cta => {
push_directive(tokens, "cta");
}
}
}
if let Some(state_9) = self.state.as_ref() {
match state_9 {
State::SharedCta => {
push_directive(tokens, "shared::cta");
}
State::Shared => {
push_directive(tokens, "shared");
}
}
}
push_directive(tokens, "b64");
self.state2.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.addr.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.txcount.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for MbarrierArriveExpectTxSemScopeSharedClusterB64 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "mbarrier");
push_directive(tokens, "arrive");
push_directive(tokens, "expect_tx");
if let Some(sem_10) = self.sem.as_ref() {
match sem_10 {
Sem::Release => {
push_directive(tokens, "release");
}
Sem::Relaxed => {
push_directive(tokens, "relaxed");
}
}
}
if let Some(scope_11) = self.scope.as_ref() {
match scope_11 {
Scope::Cluster => {
push_directive(tokens, "cluster");
}
Scope::Cta => {
push_directive(tokens, "cta");
}
}
}
if self.shared_cluster {
push_directive(tokens, "shared::cluster");
}
push_directive(tokens, "b64");
self.operand.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.addr.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.txcount.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for MbarrierArriveNocompleteReleaseCtaStateB64 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "mbarrier");
push_directive(tokens, "arrive");
push_directive(tokens, "noComplete");
if self.release {
push_directive(tokens, "release");
}
if self.cta {
push_directive(tokens, "cta");
}
if let Some(state_12) = self.state.as_ref() {
match state_12 {
State::SharedCta => {
push_directive(tokens, "shared::cta");
}
State::Shared => {
push_directive(tokens, "shared");
}
}
}
push_directive(tokens, "b64");
self.state2.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.addr.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.count.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
}