Skip to main content

ptx_parser/unparser/instruction/
st.rs

1//! Original PTX specification:
2//!
3//! st{.weak}{.ss}{.cop}{.level::cache_hint}{.vec}.type   [a], b{, cache-policy};
4//! st{.weak}{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
5//! st.volatile{.ss}{.vec}.type                           [a], b;
6//! st.relaxed.scope{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
7//! st.release.scope{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
8//! st.mmio.relaxed.sys{.global}.type         [a], b;
9//! .ss =                       { .global, .local, .param, .param::func, .shared, .shared::cta, .shared::cluster};
10//! .level1::eviction_priority = { .L1::evict_normal, .L1::evict_unchanged,
11//! .L1::evict_first, .L1::evict_last, .L1::no_allocate };
12//! .level2::eviction_priority = { .L2::evict_normal, .L2::evict_first, .L2::evict_last };
13//! .level::cache_hint =        { .L2::cache_hint };
14//! .cop =                      { .wb, .cg, .cs, .wt };
15//! .sem =                      { .relaxed, .release };
16//! .scope =                    { .cta, .cluster, .gpu, .sys };
17//! .vec =                      { .v2, .v4, .v8 };
18//! .type =                     { .b8, .b16, .b32, .b64, .b128,
19//! .u8, .u16, .u32, .u64,
20//! .s8, .s16, .s32, .s64,
21//! .f32, .f64 };
22//! -------------------------------------------------------------
23//! // Compiler-emitted state-space-first spellings accepted by ptxas:
24//! st.ss.relaxed.scope{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
25//! st.ss.release.scope{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.vec}.type [a], b{, cache-policy};
26//! .ss =                       { .global, .local, .param, .param::func, .shared, .shared::cta, .shared::cluster };
27//! .scope =                    { .cta, .cluster, .gpu, .sys };
28//! .level1::eviction_priority = { .L1::evict_normal, .L1::evict_unchanged, .L1::evict_first, .L1::evict_last, .L1::no_allocate };
29//! .level2::eviction_priority = { .L2::evict_normal, .L2::evict_first, .L2::evict_last };
30//! .level::cache_hint =        { .L2::cache_hint };
31//! .vec =                      { .v2, .v4, .v8 };
32//! .type =                     { .b8, .b16, .b32, .b64, .b128,
33//! .u8, .u16, .u32, .u64,
34//! .s8, .s16, .s32, .s64,
35//! .f32, .f64 };
36
37#![allow(unused)]
38
39use crate::lexer::PtxToken;
40use crate::unparser::{PtxUnparser, common::*};
41
42pub mod section_0 {
43    use super::*;
44    use crate::r#type::instruction::st::section_0::*;
45
46    impl PtxUnparser for StWeakSsCopLevelCacheHintVecType {
47        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
48            self.unparse_tokens_mode(tokens, false);
49        }
50        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
51            push_opcode(tokens, "st");
52            if self.weak {
53                push_directive(tokens, "weak");
54            }
55            if let Some(ss_0) = self.ss.as_ref() {
56                match ss_0 {
57                    Ss::SharedCluster => {
58                        push_directive(tokens, "shared::cluster");
59                    }
60                    Ss::ParamFunc => {
61                        push_directive(tokens, "param::func");
62                    }
63                    Ss::SharedCta => {
64                        push_directive(tokens, "shared::cta");
65                    }
66                    Ss::Global => {
67                        push_directive(tokens, "global");
68                    }
69                    Ss::Shared => {
70                        push_directive(tokens, "shared");
71                    }
72                    Ss::Local => {
73                        push_directive(tokens, "local");
74                    }
75                    Ss::Param => {
76                        push_directive(tokens, "param");
77                    }
78                }
79            }
80            if let Some(cop_1) = self.cop.as_ref() {
81                match cop_1 {
82                    Cop::Wb => {
83                        push_directive(tokens, "wb");
84                    }
85                    Cop::Cg => {
86                        push_directive(tokens, "cg");
87                    }
88                    Cop::Cs => {
89                        push_directive(tokens, "cs");
90                    }
91                    Cop::Wt => {
92                        push_directive(tokens, "wt");
93                    }
94                }
95            }
96            if let Some(level_cache_hint_2) = self.level_cache_hint.as_ref() {
97                match level_cache_hint_2 {
98                    LevelCacheHint::L2CacheHint => {
99                        push_directive(tokens, "L2::cache_hint");
100                    }
101                }
102            }
103            if let Some(vec_3) = self.vec.as_ref() {
104                match vec_3 {
105                    Vec::V2 => {
106                        push_directive(tokens, "v2");
107                    }
108                    Vec::V4 => {
109                        push_directive(tokens, "v4");
110                    }
111                    Vec::V8 => {
112                        push_directive(tokens, "v8");
113                    }
114                }
115            }
116            match &self.type_ {
117                Type::B128 => {
118                    push_directive(tokens, "b128");
119                }
120                Type::B16 => {
121                    push_directive(tokens, "b16");
122                }
123                Type::B32 => {
124                    push_directive(tokens, "b32");
125                }
126                Type::B64 => {
127                    push_directive(tokens, "b64");
128                }
129                Type::U16 => {
130                    push_directive(tokens, "u16");
131                }
132                Type::U32 => {
133                    push_directive(tokens, "u32");
134                }
135                Type::U64 => {
136                    push_directive(tokens, "u64");
137                }
138                Type::S16 => {
139                    push_directive(tokens, "s16");
140                }
141                Type::S32 => {
142                    push_directive(tokens, "s32");
143                }
144                Type::S64 => {
145                    push_directive(tokens, "s64");
146                }
147                Type::F32 => {
148                    push_directive(tokens, "f32");
149                }
150                Type::F64 => {
151                    push_directive(tokens, "f64");
152                }
153                Type::B8 => {
154                    push_directive(tokens, "b8");
155                }
156                Type::U8 => {
157                    push_directive(tokens, "u8");
158                }
159                Type::S8 => {
160                    push_directive(tokens, "s8");
161                }
162            }
163            if spaced {
164                tokens.push(PtxToken::Space);
165            }
166            self.a.unparse_tokens_mode(tokens, spaced);
167            tokens.push(PtxToken::Comma);
168            if spaced {
169                tokens.push(PtxToken::Space);
170            }
171            self.b.unparse_tokens_mode(tokens, spaced);
172            if self.cache_policy.is_some() {
173                tokens.push(PtxToken::Comma);
174            }
175            if let Some(opt_4) = self.cache_policy.as_ref() {
176                if spaced {
177                    tokens.push(PtxToken::Space);
178                }
179                opt_4.unparse_tokens_mode(tokens, spaced);
180            }
181            tokens.push(PtxToken::Semicolon);
182            if spaced {
183                tokens.push(PtxToken::Newline);
184            }
185        }
186    }
187
188    impl PtxUnparser for StWeakSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType {
189        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
190            self.unparse_tokens_mode(tokens, false);
191        }
192        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
193            push_opcode(tokens, "st");
194            if self.weak {
195                push_directive(tokens, "weak");
196            }
197            if let Some(ss_5) = self.ss.as_ref() {
198                match ss_5 {
199                    Ss::SharedCluster => {
200                        push_directive(tokens, "shared::cluster");
201                    }
202                    Ss::ParamFunc => {
203                        push_directive(tokens, "param::func");
204                    }
205                    Ss::SharedCta => {
206                        push_directive(tokens, "shared::cta");
207                    }
208                    Ss::Global => {
209                        push_directive(tokens, "global");
210                    }
211                    Ss::Shared => {
212                        push_directive(tokens, "shared");
213                    }
214                    Ss::Local => {
215                        push_directive(tokens, "local");
216                    }
217                    Ss::Param => {
218                        push_directive(tokens, "param");
219                    }
220                }
221            }
222            if let Some(level1_eviction_priority_6) = self.level1_eviction_priority.as_ref() {
223                match level1_eviction_priority_6 {
224                    Level1EvictionPriority::L1EvictUnchanged => {
225                        push_directive(tokens, "L1::evict_unchanged");
226                    }
227                    Level1EvictionPriority::L1EvictNormal => {
228                        push_directive(tokens, "L1::evict_normal");
229                    }
230                    Level1EvictionPriority::L1EvictFirst => {
231                        push_directive(tokens, "L1::evict_first");
232                    }
233                    Level1EvictionPriority::L1NoAllocate => {
234                        push_directive(tokens, "L1::no_allocate");
235                    }
236                    Level1EvictionPriority::L1EvictLast => {
237                        push_directive(tokens, "L1::evict_last");
238                    }
239                }
240            }
241            if let Some(level2_eviction_priority_7) = self.level2_eviction_priority.as_ref() {
242                match level2_eviction_priority_7 {
243                    Level2EvictionPriority::L2EvictNormal => {
244                        push_directive(tokens, "L2::evict_normal");
245                    }
246                    Level2EvictionPriority::L2EvictFirst => {
247                        push_directive(tokens, "L2::evict_first");
248                    }
249                    Level2EvictionPriority::L2EvictLast => {
250                        push_directive(tokens, "L2::evict_last");
251                    }
252                }
253            }
254            if let Some(level_cache_hint_8) = self.level_cache_hint.as_ref() {
255                match level_cache_hint_8 {
256                    LevelCacheHint::L2CacheHint => {
257                        push_directive(tokens, "L2::cache_hint");
258                    }
259                }
260            }
261            if let Some(vec_9) = self.vec.as_ref() {
262                match vec_9 {
263                    Vec::V2 => {
264                        push_directive(tokens, "v2");
265                    }
266                    Vec::V4 => {
267                        push_directive(tokens, "v4");
268                    }
269                    Vec::V8 => {
270                        push_directive(tokens, "v8");
271                    }
272                }
273            }
274            match &self.type_ {
275                Type::B128 => {
276                    push_directive(tokens, "b128");
277                }
278                Type::B16 => {
279                    push_directive(tokens, "b16");
280                }
281                Type::B32 => {
282                    push_directive(tokens, "b32");
283                }
284                Type::B64 => {
285                    push_directive(tokens, "b64");
286                }
287                Type::U16 => {
288                    push_directive(tokens, "u16");
289                }
290                Type::U32 => {
291                    push_directive(tokens, "u32");
292                }
293                Type::U64 => {
294                    push_directive(tokens, "u64");
295                }
296                Type::S16 => {
297                    push_directive(tokens, "s16");
298                }
299                Type::S32 => {
300                    push_directive(tokens, "s32");
301                }
302                Type::S64 => {
303                    push_directive(tokens, "s64");
304                }
305                Type::F32 => {
306                    push_directive(tokens, "f32");
307                }
308                Type::F64 => {
309                    push_directive(tokens, "f64");
310                }
311                Type::B8 => {
312                    push_directive(tokens, "b8");
313                }
314                Type::U8 => {
315                    push_directive(tokens, "u8");
316                }
317                Type::S8 => {
318                    push_directive(tokens, "s8");
319                }
320            }
321            if spaced {
322                tokens.push(PtxToken::Space);
323            }
324            self.a.unparse_tokens_mode(tokens, spaced);
325            tokens.push(PtxToken::Comma);
326            if spaced {
327                tokens.push(PtxToken::Space);
328            }
329            self.b.unparse_tokens_mode(tokens, spaced);
330            if self.cache_policy.is_some() {
331                tokens.push(PtxToken::Comma);
332            }
333            if let Some(opt_10) = self.cache_policy.as_ref() {
334                if spaced {
335                    tokens.push(PtxToken::Space);
336                }
337                opt_10.unparse_tokens_mode(tokens, spaced);
338            }
339            tokens.push(PtxToken::Semicolon);
340            if spaced {
341                tokens.push(PtxToken::Newline);
342            }
343        }
344    }
345
346    impl PtxUnparser for StVolatileSsVecType {
347        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
348            self.unparse_tokens_mode(tokens, false);
349        }
350        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
351            push_opcode(tokens, "st");
352            push_directive(tokens, "volatile");
353            if let Some(ss_11) = self.ss.as_ref() {
354                match ss_11 {
355                    Ss::SharedCluster => {
356                        push_directive(tokens, "shared::cluster");
357                    }
358                    Ss::ParamFunc => {
359                        push_directive(tokens, "param::func");
360                    }
361                    Ss::SharedCta => {
362                        push_directive(tokens, "shared::cta");
363                    }
364                    Ss::Global => {
365                        push_directive(tokens, "global");
366                    }
367                    Ss::Shared => {
368                        push_directive(tokens, "shared");
369                    }
370                    Ss::Local => {
371                        push_directive(tokens, "local");
372                    }
373                    Ss::Param => {
374                        push_directive(tokens, "param");
375                    }
376                }
377            }
378            if let Some(vec_12) = self.vec.as_ref() {
379                match vec_12 {
380                    Vec::V2 => {
381                        push_directive(tokens, "v2");
382                    }
383                    Vec::V4 => {
384                        push_directive(tokens, "v4");
385                    }
386                    Vec::V8 => {
387                        push_directive(tokens, "v8");
388                    }
389                }
390            }
391            match &self.type_ {
392                Type::B128 => {
393                    push_directive(tokens, "b128");
394                }
395                Type::B16 => {
396                    push_directive(tokens, "b16");
397                }
398                Type::B32 => {
399                    push_directive(tokens, "b32");
400                }
401                Type::B64 => {
402                    push_directive(tokens, "b64");
403                }
404                Type::U16 => {
405                    push_directive(tokens, "u16");
406                }
407                Type::U32 => {
408                    push_directive(tokens, "u32");
409                }
410                Type::U64 => {
411                    push_directive(tokens, "u64");
412                }
413                Type::S16 => {
414                    push_directive(tokens, "s16");
415                }
416                Type::S32 => {
417                    push_directive(tokens, "s32");
418                }
419                Type::S64 => {
420                    push_directive(tokens, "s64");
421                }
422                Type::F32 => {
423                    push_directive(tokens, "f32");
424                }
425                Type::F64 => {
426                    push_directive(tokens, "f64");
427                }
428                Type::B8 => {
429                    push_directive(tokens, "b8");
430                }
431                Type::U8 => {
432                    push_directive(tokens, "u8");
433                }
434                Type::S8 => {
435                    push_directive(tokens, "s8");
436                }
437            }
438            if spaced {
439                tokens.push(PtxToken::Space);
440            }
441            self.a.unparse_tokens_mode(tokens, spaced);
442            tokens.push(PtxToken::Comma);
443            if spaced {
444                tokens.push(PtxToken::Space);
445            }
446            self.b.unparse_tokens_mode(tokens, spaced);
447            tokens.push(PtxToken::Semicolon);
448            if spaced {
449                tokens.push(PtxToken::Newline);
450            }
451        }
452    }
453
454    impl PtxUnparser
455        for StRelaxedScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType
456    {
457        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
458            self.unparse_tokens_mode(tokens, false);
459        }
460        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
461            push_opcode(tokens, "st");
462            push_directive(tokens, "relaxed");
463            match &self.scope {
464                Scope::Cluster => {
465                    push_directive(tokens, "cluster");
466                }
467                Scope::Cta => {
468                    push_directive(tokens, "cta");
469                }
470                Scope::Gpu => {
471                    push_directive(tokens, "gpu");
472                }
473                Scope::Sys => {
474                    push_directive(tokens, "sys");
475                }
476            }
477            if let Some(ss_13) = self.ss.as_ref() {
478                match ss_13 {
479                    Ss::SharedCluster => {
480                        push_directive(tokens, "shared::cluster");
481                    }
482                    Ss::ParamFunc => {
483                        push_directive(tokens, "param::func");
484                    }
485                    Ss::SharedCta => {
486                        push_directive(tokens, "shared::cta");
487                    }
488                    Ss::Global => {
489                        push_directive(tokens, "global");
490                    }
491                    Ss::Shared => {
492                        push_directive(tokens, "shared");
493                    }
494                    Ss::Local => {
495                        push_directive(tokens, "local");
496                    }
497                    Ss::Param => {
498                        push_directive(tokens, "param");
499                    }
500                }
501            }
502            if let Some(level1_eviction_priority_14) = self.level1_eviction_priority.as_ref() {
503                match level1_eviction_priority_14 {
504                    Level1EvictionPriority::L1EvictUnchanged => {
505                        push_directive(tokens, "L1::evict_unchanged");
506                    }
507                    Level1EvictionPriority::L1EvictNormal => {
508                        push_directive(tokens, "L1::evict_normal");
509                    }
510                    Level1EvictionPriority::L1EvictFirst => {
511                        push_directive(tokens, "L1::evict_first");
512                    }
513                    Level1EvictionPriority::L1NoAllocate => {
514                        push_directive(tokens, "L1::no_allocate");
515                    }
516                    Level1EvictionPriority::L1EvictLast => {
517                        push_directive(tokens, "L1::evict_last");
518                    }
519                }
520            }
521            if let Some(level2_eviction_priority_15) = self.level2_eviction_priority.as_ref() {
522                match level2_eviction_priority_15 {
523                    Level2EvictionPriority::L2EvictNormal => {
524                        push_directive(tokens, "L2::evict_normal");
525                    }
526                    Level2EvictionPriority::L2EvictFirst => {
527                        push_directive(tokens, "L2::evict_first");
528                    }
529                    Level2EvictionPriority::L2EvictLast => {
530                        push_directive(tokens, "L2::evict_last");
531                    }
532                }
533            }
534            if let Some(level_cache_hint_16) = self.level_cache_hint.as_ref() {
535                match level_cache_hint_16 {
536                    LevelCacheHint::L2CacheHint => {
537                        push_directive(tokens, "L2::cache_hint");
538                    }
539                }
540            }
541            if let Some(vec_17) = self.vec.as_ref() {
542                match vec_17 {
543                    Vec::V2 => {
544                        push_directive(tokens, "v2");
545                    }
546                    Vec::V4 => {
547                        push_directive(tokens, "v4");
548                    }
549                    Vec::V8 => {
550                        push_directive(tokens, "v8");
551                    }
552                }
553            }
554            match &self.type_ {
555                Type::B128 => {
556                    push_directive(tokens, "b128");
557                }
558                Type::B16 => {
559                    push_directive(tokens, "b16");
560                }
561                Type::B32 => {
562                    push_directive(tokens, "b32");
563                }
564                Type::B64 => {
565                    push_directive(tokens, "b64");
566                }
567                Type::U16 => {
568                    push_directive(tokens, "u16");
569                }
570                Type::U32 => {
571                    push_directive(tokens, "u32");
572                }
573                Type::U64 => {
574                    push_directive(tokens, "u64");
575                }
576                Type::S16 => {
577                    push_directive(tokens, "s16");
578                }
579                Type::S32 => {
580                    push_directive(tokens, "s32");
581                }
582                Type::S64 => {
583                    push_directive(tokens, "s64");
584                }
585                Type::F32 => {
586                    push_directive(tokens, "f32");
587                }
588                Type::F64 => {
589                    push_directive(tokens, "f64");
590                }
591                Type::B8 => {
592                    push_directive(tokens, "b8");
593                }
594                Type::U8 => {
595                    push_directive(tokens, "u8");
596                }
597                Type::S8 => {
598                    push_directive(tokens, "s8");
599                }
600            }
601            if spaced {
602                tokens.push(PtxToken::Space);
603            }
604            self.a.unparse_tokens_mode(tokens, spaced);
605            tokens.push(PtxToken::Comma);
606            if spaced {
607                tokens.push(PtxToken::Space);
608            }
609            self.b.unparse_tokens_mode(tokens, spaced);
610            if self.cache_policy.is_some() {
611                tokens.push(PtxToken::Comma);
612            }
613            if let Some(opt_18) = self.cache_policy.as_ref() {
614                if spaced {
615                    tokens.push(PtxToken::Space);
616                }
617                opt_18.unparse_tokens_mode(tokens, spaced);
618            }
619            tokens.push(PtxToken::Semicolon);
620            if spaced {
621                tokens.push(PtxToken::Newline);
622            }
623        }
624    }
625
626    impl PtxUnparser
627        for StReleaseScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType
628    {
629        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
630            self.unparse_tokens_mode(tokens, false);
631        }
632        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
633            push_opcode(tokens, "st");
634            push_directive(tokens, "release");
635            match &self.scope {
636                Scope::Cluster => {
637                    push_directive(tokens, "cluster");
638                }
639                Scope::Cta => {
640                    push_directive(tokens, "cta");
641                }
642                Scope::Gpu => {
643                    push_directive(tokens, "gpu");
644                }
645                Scope::Sys => {
646                    push_directive(tokens, "sys");
647                }
648            }
649            if let Some(ss_19) = self.ss.as_ref() {
650                match ss_19 {
651                    Ss::SharedCluster => {
652                        push_directive(tokens, "shared::cluster");
653                    }
654                    Ss::ParamFunc => {
655                        push_directive(tokens, "param::func");
656                    }
657                    Ss::SharedCta => {
658                        push_directive(tokens, "shared::cta");
659                    }
660                    Ss::Global => {
661                        push_directive(tokens, "global");
662                    }
663                    Ss::Shared => {
664                        push_directive(tokens, "shared");
665                    }
666                    Ss::Local => {
667                        push_directive(tokens, "local");
668                    }
669                    Ss::Param => {
670                        push_directive(tokens, "param");
671                    }
672                }
673            }
674            if let Some(level1_eviction_priority_20) = self.level1_eviction_priority.as_ref() {
675                match level1_eviction_priority_20 {
676                    Level1EvictionPriority::L1EvictUnchanged => {
677                        push_directive(tokens, "L1::evict_unchanged");
678                    }
679                    Level1EvictionPriority::L1EvictNormal => {
680                        push_directive(tokens, "L1::evict_normal");
681                    }
682                    Level1EvictionPriority::L1EvictFirst => {
683                        push_directive(tokens, "L1::evict_first");
684                    }
685                    Level1EvictionPriority::L1NoAllocate => {
686                        push_directive(tokens, "L1::no_allocate");
687                    }
688                    Level1EvictionPriority::L1EvictLast => {
689                        push_directive(tokens, "L1::evict_last");
690                    }
691                }
692            }
693            if let Some(level2_eviction_priority_21) = self.level2_eviction_priority.as_ref() {
694                match level2_eviction_priority_21 {
695                    Level2EvictionPriority::L2EvictNormal => {
696                        push_directive(tokens, "L2::evict_normal");
697                    }
698                    Level2EvictionPriority::L2EvictFirst => {
699                        push_directive(tokens, "L2::evict_first");
700                    }
701                    Level2EvictionPriority::L2EvictLast => {
702                        push_directive(tokens, "L2::evict_last");
703                    }
704                }
705            }
706            if let Some(level_cache_hint_22) = self.level_cache_hint.as_ref() {
707                match level_cache_hint_22 {
708                    LevelCacheHint::L2CacheHint => {
709                        push_directive(tokens, "L2::cache_hint");
710                    }
711                }
712            }
713            if let Some(vec_23) = self.vec.as_ref() {
714                match vec_23 {
715                    Vec::V2 => {
716                        push_directive(tokens, "v2");
717                    }
718                    Vec::V4 => {
719                        push_directive(tokens, "v4");
720                    }
721                    Vec::V8 => {
722                        push_directive(tokens, "v8");
723                    }
724                }
725            }
726            match &self.type_ {
727                Type::B128 => {
728                    push_directive(tokens, "b128");
729                }
730                Type::B16 => {
731                    push_directive(tokens, "b16");
732                }
733                Type::B32 => {
734                    push_directive(tokens, "b32");
735                }
736                Type::B64 => {
737                    push_directive(tokens, "b64");
738                }
739                Type::U16 => {
740                    push_directive(tokens, "u16");
741                }
742                Type::U32 => {
743                    push_directive(tokens, "u32");
744                }
745                Type::U64 => {
746                    push_directive(tokens, "u64");
747                }
748                Type::S16 => {
749                    push_directive(tokens, "s16");
750                }
751                Type::S32 => {
752                    push_directive(tokens, "s32");
753                }
754                Type::S64 => {
755                    push_directive(tokens, "s64");
756                }
757                Type::F32 => {
758                    push_directive(tokens, "f32");
759                }
760                Type::F64 => {
761                    push_directive(tokens, "f64");
762                }
763                Type::B8 => {
764                    push_directive(tokens, "b8");
765                }
766                Type::U8 => {
767                    push_directive(tokens, "u8");
768                }
769                Type::S8 => {
770                    push_directive(tokens, "s8");
771                }
772            }
773            if spaced {
774                tokens.push(PtxToken::Space);
775            }
776            self.a.unparse_tokens_mode(tokens, spaced);
777            tokens.push(PtxToken::Comma);
778            if spaced {
779                tokens.push(PtxToken::Space);
780            }
781            self.b.unparse_tokens_mode(tokens, spaced);
782            if self.cache_policy.is_some() {
783                tokens.push(PtxToken::Comma);
784            }
785            if let Some(opt_24) = self.cache_policy.as_ref() {
786                if spaced {
787                    tokens.push(PtxToken::Space);
788                }
789                opt_24.unparse_tokens_mode(tokens, spaced);
790            }
791            tokens.push(PtxToken::Semicolon);
792            if spaced {
793                tokens.push(PtxToken::Newline);
794            }
795        }
796    }
797
798    impl PtxUnparser for StMmioRelaxedSysGlobalType {
799        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
800            self.unparse_tokens_mode(tokens, false);
801        }
802        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
803            push_opcode(tokens, "st");
804            push_directive(tokens, "mmio");
805            push_directive(tokens, "relaxed");
806            push_directive(tokens, "sys");
807            if self.global {
808                push_directive(tokens, "global");
809            }
810            match &self.type_ {
811                Type::B128 => {
812                    push_directive(tokens, "b128");
813                }
814                Type::B16 => {
815                    push_directive(tokens, "b16");
816                }
817                Type::B32 => {
818                    push_directive(tokens, "b32");
819                }
820                Type::B64 => {
821                    push_directive(tokens, "b64");
822                }
823                Type::U16 => {
824                    push_directive(tokens, "u16");
825                }
826                Type::U32 => {
827                    push_directive(tokens, "u32");
828                }
829                Type::U64 => {
830                    push_directive(tokens, "u64");
831                }
832                Type::S16 => {
833                    push_directive(tokens, "s16");
834                }
835                Type::S32 => {
836                    push_directive(tokens, "s32");
837                }
838                Type::S64 => {
839                    push_directive(tokens, "s64");
840                }
841                Type::F32 => {
842                    push_directive(tokens, "f32");
843                }
844                Type::F64 => {
845                    push_directive(tokens, "f64");
846                }
847                Type::B8 => {
848                    push_directive(tokens, "b8");
849                }
850                Type::U8 => {
851                    push_directive(tokens, "u8");
852                }
853                Type::S8 => {
854                    push_directive(tokens, "s8");
855                }
856            }
857            if spaced {
858                tokens.push(PtxToken::Space);
859            }
860            self.a.unparse_tokens_mode(tokens, spaced);
861            tokens.push(PtxToken::Comma);
862            if spaced {
863                tokens.push(PtxToken::Space);
864            }
865            self.b.unparse_tokens_mode(tokens, spaced);
866            tokens.push(PtxToken::Semicolon);
867            if spaced {
868                tokens.push(PtxToken::Newline);
869            }
870        }
871    }
872}
873
874pub mod section_1 {
875    use super::*;
876    use crate::r#type::instruction::st::section_1::*;
877
878    impl PtxUnparser
879        for StSsRelaxedScopeLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType
880    {
881        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
882            self.unparse_tokens_mode(tokens, false);
883        }
884        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
885            push_opcode(tokens, "st");
886            match &self.ss {
887                Ss::SharedCluster => {
888                    push_directive(tokens, "shared::cluster");
889                }
890                Ss::ParamFunc => {
891                    push_directive(tokens, "param::func");
892                }
893                Ss::SharedCta => {
894                    push_directive(tokens, "shared::cta");
895                }
896                Ss::Global => {
897                    push_directive(tokens, "global");
898                }
899                Ss::Shared => {
900                    push_directive(tokens, "shared");
901                }
902                Ss::Local => {
903                    push_directive(tokens, "local");
904                }
905                Ss::Param => {
906                    push_directive(tokens, "param");
907                }
908            }
909            push_directive(tokens, "relaxed");
910            match &self.scope {
911                Scope::Cluster => {
912                    push_directive(tokens, "cluster");
913                }
914                Scope::Cta => {
915                    push_directive(tokens, "cta");
916                }
917                Scope::Gpu => {
918                    push_directive(tokens, "gpu");
919                }
920                Scope::Sys => {
921                    push_directive(tokens, "sys");
922                }
923            }
924            if let Some(level1_eviction_priority_25) = self.level1_eviction_priority.as_ref() {
925                match level1_eviction_priority_25 {
926                    Level1EvictionPriority::L1EvictUnchanged => {
927                        push_directive(tokens, "L1::evict_unchanged");
928                    }
929                    Level1EvictionPriority::L1EvictNormal => {
930                        push_directive(tokens, "L1::evict_normal");
931                    }
932                    Level1EvictionPriority::L1EvictFirst => {
933                        push_directive(tokens, "L1::evict_first");
934                    }
935                    Level1EvictionPriority::L1NoAllocate => {
936                        push_directive(tokens, "L1::no_allocate");
937                    }
938                    Level1EvictionPriority::L1EvictLast => {
939                        push_directive(tokens, "L1::evict_last");
940                    }
941                }
942            }
943            if let Some(level2_eviction_priority_26) = self.level2_eviction_priority.as_ref() {
944                match level2_eviction_priority_26 {
945                    Level2EvictionPriority::L2EvictNormal => {
946                        push_directive(tokens, "L2::evict_normal");
947                    }
948                    Level2EvictionPriority::L2EvictFirst => {
949                        push_directive(tokens, "L2::evict_first");
950                    }
951                    Level2EvictionPriority::L2EvictLast => {
952                        push_directive(tokens, "L2::evict_last");
953                    }
954                }
955            }
956            if let Some(level_cache_hint_27) = self.level_cache_hint.as_ref() {
957                match level_cache_hint_27 {
958                    LevelCacheHint::L2CacheHint => {
959                        push_directive(tokens, "L2::cache_hint");
960                    }
961                }
962            }
963            if let Some(vec_28) = self.vec.as_ref() {
964                match vec_28 {
965                    Vec::V2 => {
966                        push_directive(tokens, "v2");
967                    }
968                    Vec::V4 => {
969                        push_directive(tokens, "v4");
970                    }
971                    Vec::V8 => {
972                        push_directive(tokens, "v8");
973                    }
974                }
975            }
976            match &self.type_ {
977                Type::B128 => {
978                    push_directive(tokens, "b128");
979                }
980                Type::B16 => {
981                    push_directive(tokens, "b16");
982                }
983                Type::B32 => {
984                    push_directive(tokens, "b32");
985                }
986                Type::B64 => {
987                    push_directive(tokens, "b64");
988                }
989                Type::U16 => {
990                    push_directive(tokens, "u16");
991                }
992                Type::U32 => {
993                    push_directive(tokens, "u32");
994                }
995                Type::U64 => {
996                    push_directive(tokens, "u64");
997                }
998                Type::S16 => {
999                    push_directive(tokens, "s16");
1000                }
1001                Type::S32 => {
1002                    push_directive(tokens, "s32");
1003                }
1004                Type::S64 => {
1005                    push_directive(tokens, "s64");
1006                }
1007                Type::F32 => {
1008                    push_directive(tokens, "f32");
1009                }
1010                Type::F64 => {
1011                    push_directive(tokens, "f64");
1012                }
1013                Type::B8 => {
1014                    push_directive(tokens, "b8");
1015                }
1016                Type::U8 => {
1017                    push_directive(tokens, "u8");
1018                }
1019                Type::S8 => {
1020                    push_directive(tokens, "s8");
1021                }
1022            }
1023            if spaced {
1024                tokens.push(PtxToken::Space);
1025            }
1026            self.a.unparse_tokens_mode(tokens, spaced);
1027            tokens.push(PtxToken::Comma);
1028            if spaced {
1029                tokens.push(PtxToken::Space);
1030            }
1031            self.b.unparse_tokens_mode(tokens, spaced);
1032            if self.cache_policy.is_some() {
1033                tokens.push(PtxToken::Comma);
1034            }
1035            if let Some(opt_29) = self.cache_policy.as_ref() {
1036                if spaced {
1037                    tokens.push(PtxToken::Space);
1038                }
1039                opt_29.unparse_tokens_mode(tokens, spaced);
1040            }
1041            tokens.push(PtxToken::Semicolon);
1042            if spaced {
1043                tokens.push(PtxToken::Newline);
1044            }
1045        }
1046    }
1047
1048    impl PtxUnparser
1049        for StSsReleaseScopeLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintVecType
1050    {
1051        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1052            self.unparse_tokens_mode(tokens, false);
1053        }
1054        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
1055            push_opcode(tokens, "st");
1056            match &self.ss {
1057                Ss::SharedCluster => {
1058                    push_directive(tokens, "shared::cluster");
1059                }
1060                Ss::ParamFunc => {
1061                    push_directive(tokens, "param::func");
1062                }
1063                Ss::SharedCta => {
1064                    push_directive(tokens, "shared::cta");
1065                }
1066                Ss::Global => {
1067                    push_directive(tokens, "global");
1068                }
1069                Ss::Shared => {
1070                    push_directive(tokens, "shared");
1071                }
1072                Ss::Local => {
1073                    push_directive(tokens, "local");
1074                }
1075                Ss::Param => {
1076                    push_directive(tokens, "param");
1077                }
1078            }
1079            push_directive(tokens, "release");
1080            match &self.scope {
1081                Scope::Cluster => {
1082                    push_directive(tokens, "cluster");
1083                }
1084                Scope::Cta => {
1085                    push_directive(tokens, "cta");
1086                }
1087                Scope::Gpu => {
1088                    push_directive(tokens, "gpu");
1089                }
1090                Scope::Sys => {
1091                    push_directive(tokens, "sys");
1092                }
1093            }
1094            if let Some(level1_eviction_priority_30) = self.level1_eviction_priority.as_ref() {
1095                match level1_eviction_priority_30 {
1096                    Level1EvictionPriority::L1EvictUnchanged => {
1097                        push_directive(tokens, "L1::evict_unchanged");
1098                    }
1099                    Level1EvictionPriority::L1EvictNormal => {
1100                        push_directive(tokens, "L1::evict_normal");
1101                    }
1102                    Level1EvictionPriority::L1EvictFirst => {
1103                        push_directive(tokens, "L1::evict_first");
1104                    }
1105                    Level1EvictionPriority::L1NoAllocate => {
1106                        push_directive(tokens, "L1::no_allocate");
1107                    }
1108                    Level1EvictionPriority::L1EvictLast => {
1109                        push_directive(tokens, "L1::evict_last");
1110                    }
1111                }
1112            }
1113            if let Some(level2_eviction_priority_31) = self.level2_eviction_priority.as_ref() {
1114                match level2_eviction_priority_31 {
1115                    Level2EvictionPriority::L2EvictNormal => {
1116                        push_directive(tokens, "L2::evict_normal");
1117                    }
1118                    Level2EvictionPriority::L2EvictFirst => {
1119                        push_directive(tokens, "L2::evict_first");
1120                    }
1121                    Level2EvictionPriority::L2EvictLast => {
1122                        push_directive(tokens, "L2::evict_last");
1123                    }
1124                }
1125            }
1126            if let Some(level_cache_hint_32) = self.level_cache_hint.as_ref() {
1127                match level_cache_hint_32 {
1128                    LevelCacheHint::L2CacheHint => {
1129                        push_directive(tokens, "L2::cache_hint");
1130                    }
1131                }
1132            }
1133            if let Some(vec_33) = self.vec.as_ref() {
1134                match vec_33 {
1135                    Vec::V2 => {
1136                        push_directive(tokens, "v2");
1137                    }
1138                    Vec::V4 => {
1139                        push_directive(tokens, "v4");
1140                    }
1141                    Vec::V8 => {
1142                        push_directive(tokens, "v8");
1143                    }
1144                }
1145            }
1146            match &self.type_ {
1147                Type::B128 => {
1148                    push_directive(tokens, "b128");
1149                }
1150                Type::B16 => {
1151                    push_directive(tokens, "b16");
1152                }
1153                Type::B32 => {
1154                    push_directive(tokens, "b32");
1155                }
1156                Type::B64 => {
1157                    push_directive(tokens, "b64");
1158                }
1159                Type::U16 => {
1160                    push_directive(tokens, "u16");
1161                }
1162                Type::U32 => {
1163                    push_directive(tokens, "u32");
1164                }
1165                Type::U64 => {
1166                    push_directive(tokens, "u64");
1167                }
1168                Type::S16 => {
1169                    push_directive(tokens, "s16");
1170                }
1171                Type::S32 => {
1172                    push_directive(tokens, "s32");
1173                }
1174                Type::S64 => {
1175                    push_directive(tokens, "s64");
1176                }
1177                Type::F32 => {
1178                    push_directive(tokens, "f32");
1179                }
1180                Type::F64 => {
1181                    push_directive(tokens, "f64");
1182                }
1183                Type::B8 => {
1184                    push_directive(tokens, "b8");
1185                }
1186                Type::U8 => {
1187                    push_directive(tokens, "u8");
1188                }
1189                Type::S8 => {
1190                    push_directive(tokens, "s8");
1191                }
1192            }
1193            if spaced {
1194                tokens.push(PtxToken::Space);
1195            }
1196            self.a.unparse_tokens_mode(tokens, spaced);
1197            tokens.push(PtxToken::Comma);
1198            if spaced {
1199                tokens.push(PtxToken::Space);
1200            }
1201            self.b.unparse_tokens_mode(tokens, spaced);
1202            if self.cache_policy.is_some() {
1203                tokens.push(PtxToken::Comma);
1204            }
1205            if let Some(opt_34) = self.cache_policy.as_ref() {
1206                if spaced {
1207                    tokens.push(PtxToken::Space);
1208                }
1209                opt_34.unparse_tokens_mode(tokens, spaced);
1210            }
1211            tokens.push(PtxToken::Semicolon);
1212            if spaced {
1213                tokens.push(PtxToken::Newline);
1214            }
1215        }
1216    }
1217}