ptx_parser/unparser/instruction/
atom.rs

1//! Original PTX specification:
2//!
3//! // Atomic operation with scalar type:
4//! atom{.sem}{.scope}{.space}.op{.level::cache_hint}.type d, [a], b{, cache-policy};
5//! atom{.sem}{.scope}{.space}.op.type d, [a], b, c;
6//! atom{.sem}{.scope}{.space}.cas.b16 d, [a], b, c;
7//! atom{.sem}{.scope}{.space}.cas.b128 d, [a], b, c;
8//! atom{.sem}{.scope}{.space}.exch{.level::cache_hint}.b128 d, [a], b {, cache-policy};
9//! atom{.sem}{.scope}{.space}.add.noftz{.level::cache_hint}.f16     d, [a], b{, cache-policy};
10//! atom{.sem}{.scope}{.space}.add.noftz{.level::cache_hint}.f16x2   d, [a], b{, cache-policy};
11//! atom{.sem}{.scope}{.space}.add.noftz{.level::cache_hint}.bf16    d, [a], b{, cache-policy};
12//! atom{.sem}{.scope}{.space}.add.noftz{.level::cache_hint}.bf16x2  d, [a], b{, cache-policy};
13//! .space =              { .global, .shared, .shared::cta, .shared::cluster};
14//! .sem =                { .relaxed, .acquire, .release, .acq_rel };
15//! .scope =              { .cta, .cluster, .gpu, .sys };
16//! .op =                 { .and, .or, .xor, .cas, .exch, .add, .inc, .dec, .min, .max };
17//! .level::cache_hint =  { .L2::cache_hint };
18//! .type =               { .b32, .b64, .u32, .u64, .s32, .s64, .f32, .f64 };
19//! -------------------------------------------------------------
20//! // Atomic operation with vector type:
21//! atom{.sem}{.scope}{.global}.add{.level::cache_hint}.vec_32_bit.f32                  d, [a], b{, cache-policy};
22//! atom{.sem}{.scope}{.global}.op.noftz{.level::cache_hint}.vec_16_bit.half_word_type  d, [a], b{, cache-policy};
23//! atom{.sem}{.scope}{.global}.op.noftz{.level::cache_hint}.vec_32_bit.packed_type     d, [a], b{, cache-policy};
24//! .sem =               { .relaxed, .acquire, .release, .acq_rel };
25//! .scope =             { .cta, .cluster, .gpu, .sys };
26//! .op =                { .add, .min, .max };
27//! .half_word_type =    { .f16, .bf16 };
28//! .packed_type =       { .f16x2, .bf16x2 };
29//! .vec_16_bit =        { .v2, .v4, .v8 };
30//! .vec_32_bit =        { .v2, .v4 };
31//! .level::cache_hint = { .L2::cache_hint };
32
33#![allow(unused)]
34
35use crate::lexer::PtxToken;
36use crate::unparser::{PtxUnparser, common::*};
37
38pub mod section_0 {
39    use super::*;
40    use crate::r#type::instruction::atom::section_0::*;
41
42    impl PtxUnparser for AtomSemScopeSpaceOpLevelCacheHintType {
43        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
44            push_opcode(tokens, "atom");
45                    if let Some(sem_0) = self.sem.as_ref() {
46                            match sem_0 {
47                                    Sem::Relaxed => {
48                                            push_directive(tokens, "relaxed");
49                                    }
50                                    Sem::Acquire => {
51                                            push_directive(tokens, "acquire");
52                                    }
53                                    Sem::Release => {
54                                            push_directive(tokens, "release");
55                                    }
56                                    Sem::AcqRel => {
57                                            push_directive(tokens, "acq_rel");
58                                    }
59                            }
60                    }
61                    if let Some(scope_1) = self.scope.as_ref() {
62                            match scope_1 {
63                                    Scope::Cluster => {
64                                            push_directive(tokens, "cluster");
65                                    }
66                                    Scope::Cta => {
67                                            push_directive(tokens, "cta");
68                                    }
69                                    Scope::Gpu => {
70                                            push_directive(tokens, "gpu");
71                                    }
72                                    Scope::Sys => {
73                                            push_directive(tokens, "sys");
74                                    }
75                            }
76                    }
77                    if let Some(space_2) = self.space.as_ref() {
78                            match space_2 {
79                                    Space::SharedCluster => {
80                                            push_directive(tokens, "shared::cluster");
81                                    }
82                                    Space::SharedCta => {
83                                            push_directive(tokens, "shared::cta");
84                                    }
85                                    Space::Global => {
86                                            push_directive(tokens, "global");
87                                    }
88                                    Space::Shared => {
89                                            push_directive(tokens, "shared");
90                                    }
91                            }
92                    }
93                    match &self.op {
94                            Op::Exch => {
95                                    push_directive(tokens, "exch");
96                            }
97                            Op::And => {
98                                    push_directive(tokens, "and");
99                            }
100                            Op::Xor => {
101                                    push_directive(tokens, "xor");
102                            }
103                            Op::Cas => {
104                                    push_directive(tokens, "cas");
105                            }
106                            Op::Add => {
107                                    push_directive(tokens, "add");
108                            }
109                            Op::Inc => {
110                                    push_directive(tokens, "inc");
111                            }
112                            Op::Dec => {
113                                    push_directive(tokens, "dec");
114                            }
115                            Op::Min => {
116                                    push_directive(tokens, "min");
117                            }
118                            Op::Max => {
119                                    push_directive(tokens, "max");
120                            }
121                            Op::Or => {
122                                    push_directive(tokens, "or");
123                            }
124                    }
125                    if let Some(level_cache_hint_3) = self.level_cache_hint.as_ref() {
126                            match level_cache_hint_3 {
127                                    LevelCacheHint::L2CacheHint => {
128                                            push_directive(tokens, "L2::cache_hint");
129                                    }
130                            }
131                    }
132                    match &self.type_ {
133                            Type::B32 => {
134                                    push_directive(tokens, "b32");
135                            }
136                            Type::B64 => {
137                                    push_directive(tokens, "b64");
138                            }
139                            Type::U32 => {
140                                    push_directive(tokens, "u32");
141                            }
142                            Type::U64 => {
143                                    push_directive(tokens, "u64");
144                            }
145                            Type::S32 => {
146                                    push_directive(tokens, "s32");
147                            }
148                            Type::S64 => {
149                                    push_directive(tokens, "s64");
150                            }
151                            Type::F32 => {
152                                    push_directive(tokens, "f32");
153                            }
154                            Type::F64 => {
155                                    push_directive(tokens, "f64");
156                            }
157                    }
158                    self.d.unparse_tokens(tokens);
159            tokens.push(PtxToken::Comma);
160                    self.a.unparse_tokens(tokens);
161            tokens.push(PtxToken::Comma);
162                    self.b.unparse_tokens(tokens);
163            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
164                    if let Some(opt_4) = self.cache_policy.as_ref() {
165                        opt_4.unparse_tokens(tokens);
166                    }
167            tokens.push(PtxToken::Semicolon);
168        }
169    }
170
171    impl PtxUnparser for AtomSemScopeSpaceOpType {
172        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
173            push_opcode(tokens, "atom");
174                    if let Some(sem_5) = self.sem.as_ref() {
175                            match sem_5 {
176                                    Sem::Relaxed => {
177                                            push_directive(tokens, "relaxed");
178                                    }
179                                    Sem::Acquire => {
180                                            push_directive(tokens, "acquire");
181                                    }
182                                    Sem::Release => {
183                                            push_directive(tokens, "release");
184                                    }
185                                    Sem::AcqRel => {
186                                            push_directive(tokens, "acq_rel");
187                                    }
188                            }
189                    }
190                    if let Some(scope_6) = self.scope.as_ref() {
191                            match scope_6 {
192                                    Scope::Cluster => {
193                                            push_directive(tokens, "cluster");
194                                    }
195                                    Scope::Cta => {
196                                            push_directive(tokens, "cta");
197                                    }
198                                    Scope::Gpu => {
199                                            push_directive(tokens, "gpu");
200                                    }
201                                    Scope::Sys => {
202                                            push_directive(tokens, "sys");
203                                    }
204                            }
205                    }
206                    if let Some(space_7) = self.space.as_ref() {
207                            match space_7 {
208                                    Space::SharedCluster => {
209                                            push_directive(tokens, "shared::cluster");
210                                    }
211                                    Space::SharedCta => {
212                                            push_directive(tokens, "shared::cta");
213                                    }
214                                    Space::Global => {
215                                            push_directive(tokens, "global");
216                                    }
217                                    Space::Shared => {
218                                            push_directive(tokens, "shared");
219                                    }
220                            }
221                    }
222                    match &self.op {
223                            Op::Exch => {
224                                    push_directive(tokens, "exch");
225                            }
226                            Op::And => {
227                                    push_directive(tokens, "and");
228                            }
229                            Op::Xor => {
230                                    push_directive(tokens, "xor");
231                            }
232                            Op::Cas => {
233                                    push_directive(tokens, "cas");
234                            }
235                            Op::Add => {
236                                    push_directive(tokens, "add");
237                            }
238                            Op::Inc => {
239                                    push_directive(tokens, "inc");
240                            }
241                            Op::Dec => {
242                                    push_directive(tokens, "dec");
243                            }
244                            Op::Min => {
245                                    push_directive(tokens, "min");
246                            }
247                            Op::Max => {
248                                    push_directive(tokens, "max");
249                            }
250                            Op::Or => {
251                                    push_directive(tokens, "or");
252                            }
253                    }
254                    match &self.type_ {
255                            Type::B32 => {
256                                    push_directive(tokens, "b32");
257                            }
258                            Type::B64 => {
259                                    push_directive(tokens, "b64");
260                            }
261                            Type::U32 => {
262                                    push_directive(tokens, "u32");
263                            }
264                            Type::U64 => {
265                                    push_directive(tokens, "u64");
266                            }
267                            Type::S32 => {
268                                    push_directive(tokens, "s32");
269                            }
270                            Type::S64 => {
271                                    push_directive(tokens, "s64");
272                            }
273                            Type::F32 => {
274                                    push_directive(tokens, "f32");
275                            }
276                            Type::F64 => {
277                                    push_directive(tokens, "f64");
278                            }
279                    }
280                    self.d.unparse_tokens(tokens);
281            tokens.push(PtxToken::Comma);
282                    self.a.unparse_tokens(tokens);
283            tokens.push(PtxToken::Comma);
284                    self.b.unparse_tokens(tokens);
285            tokens.push(PtxToken::Comma);
286                    self.c.unparse_tokens(tokens);
287            tokens.push(PtxToken::Semicolon);
288        }
289    }
290
291    impl PtxUnparser for AtomSemScopeSpaceCasB16 {
292        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
293            push_opcode(tokens, "atom");
294                    if let Some(sem_8) = self.sem.as_ref() {
295                            match sem_8 {
296                                    Sem::Relaxed => {
297                                            push_directive(tokens, "relaxed");
298                                    }
299                                    Sem::Acquire => {
300                                            push_directive(tokens, "acquire");
301                                    }
302                                    Sem::Release => {
303                                            push_directive(tokens, "release");
304                                    }
305                                    Sem::AcqRel => {
306                                            push_directive(tokens, "acq_rel");
307                                    }
308                            }
309                    }
310                    if let Some(scope_9) = self.scope.as_ref() {
311                            match scope_9 {
312                                    Scope::Cluster => {
313                                            push_directive(tokens, "cluster");
314                                    }
315                                    Scope::Cta => {
316                                            push_directive(tokens, "cta");
317                                    }
318                                    Scope::Gpu => {
319                                            push_directive(tokens, "gpu");
320                                    }
321                                    Scope::Sys => {
322                                            push_directive(tokens, "sys");
323                                    }
324                            }
325                    }
326                    if let Some(space_10) = self.space.as_ref() {
327                            match space_10 {
328                                    Space::SharedCluster => {
329                                            push_directive(tokens, "shared::cluster");
330                                    }
331                                    Space::SharedCta => {
332                                            push_directive(tokens, "shared::cta");
333                                    }
334                                    Space::Global => {
335                                            push_directive(tokens, "global");
336                                    }
337                                    Space::Shared => {
338                                            push_directive(tokens, "shared");
339                                    }
340                            }
341                    }
342                    push_directive(tokens, "cas");
343                    push_directive(tokens, "b16");
344                    self.d.unparse_tokens(tokens);
345            tokens.push(PtxToken::Comma);
346                    self.a.unparse_tokens(tokens);
347            tokens.push(PtxToken::Comma);
348                    self.b.unparse_tokens(tokens);
349            tokens.push(PtxToken::Comma);
350                    self.c.unparse_tokens(tokens);
351            tokens.push(PtxToken::Semicolon);
352        }
353    }
354
355    impl PtxUnparser for AtomSemScopeSpaceCasB128 {
356        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
357            push_opcode(tokens, "atom");
358                    if let Some(sem_11) = self.sem.as_ref() {
359                            match sem_11 {
360                                    Sem::Relaxed => {
361                                            push_directive(tokens, "relaxed");
362                                    }
363                                    Sem::Acquire => {
364                                            push_directive(tokens, "acquire");
365                                    }
366                                    Sem::Release => {
367                                            push_directive(tokens, "release");
368                                    }
369                                    Sem::AcqRel => {
370                                            push_directive(tokens, "acq_rel");
371                                    }
372                            }
373                    }
374                    if let Some(scope_12) = self.scope.as_ref() {
375                            match scope_12 {
376                                    Scope::Cluster => {
377                                            push_directive(tokens, "cluster");
378                                    }
379                                    Scope::Cta => {
380                                            push_directive(tokens, "cta");
381                                    }
382                                    Scope::Gpu => {
383                                            push_directive(tokens, "gpu");
384                                    }
385                                    Scope::Sys => {
386                                            push_directive(tokens, "sys");
387                                    }
388                            }
389                    }
390                    if let Some(space_13) = self.space.as_ref() {
391                            match space_13 {
392                                    Space::SharedCluster => {
393                                            push_directive(tokens, "shared::cluster");
394                                    }
395                                    Space::SharedCta => {
396                                            push_directive(tokens, "shared::cta");
397                                    }
398                                    Space::Global => {
399                                            push_directive(tokens, "global");
400                                    }
401                                    Space::Shared => {
402                                            push_directive(tokens, "shared");
403                                    }
404                            }
405                    }
406                    push_directive(tokens, "cas");
407                    push_directive(tokens, "b128");
408                    self.d.unparse_tokens(tokens);
409            tokens.push(PtxToken::Comma);
410                    self.a.unparse_tokens(tokens);
411            tokens.push(PtxToken::Comma);
412                    self.b.unparse_tokens(tokens);
413            tokens.push(PtxToken::Comma);
414                    self.c.unparse_tokens(tokens);
415            tokens.push(PtxToken::Semicolon);
416        }
417    }
418
419    impl PtxUnparser for AtomSemScopeSpaceExchLevelCacheHintB128 {
420        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
421            push_opcode(tokens, "atom");
422                    if let Some(sem_14) = self.sem.as_ref() {
423                            match sem_14 {
424                                    Sem::Relaxed => {
425                                            push_directive(tokens, "relaxed");
426                                    }
427                                    Sem::Acquire => {
428                                            push_directive(tokens, "acquire");
429                                    }
430                                    Sem::Release => {
431                                            push_directive(tokens, "release");
432                                    }
433                                    Sem::AcqRel => {
434                                            push_directive(tokens, "acq_rel");
435                                    }
436                            }
437                    }
438                    if let Some(scope_15) = self.scope.as_ref() {
439                            match scope_15 {
440                                    Scope::Cluster => {
441                                            push_directive(tokens, "cluster");
442                                    }
443                                    Scope::Cta => {
444                                            push_directive(tokens, "cta");
445                                    }
446                                    Scope::Gpu => {
447                                            push_directive(tokens, "gpu");
448                                    }
449                                    Scope::Sys => {
450                                            push_directive(tokens, "sys");
451                                    }
452                            }
453                    }
454                    if let Some(space_16) = self.space.as_ref() {
455                            match space_16 {
456                                    Space::SharedCluster => {
457                                            push_directive(tokens, "shared::cluster");
458                                    }
459                                    Space::SharedCta => {
460                                            push_directive(tokens, "shared::cta");
461                                    }
462                                    Space::Global => {
463                                            push_directive(tokens, "global");
464                                    }
465                                    Space::Shared => {
466                                            push_directive(tokens, "shared");
467                                    }
468                            }
469                    }
470                    push_directive(tokens, "exch");
471                    if let Some(level_cache_hint_17) = self.level_cache_hint.as_ref() {
472                            match level_cache_hint_17 {
473                                    LevelCacheHint::L2CacheHint => {
474                                            push_directive(tokens, "L2::cache_hint");
475                                    }
476                            }
477                    }
478                    push_directive(tokens, "b128");
479                    self.d.unparse_tokens(tokens);
480            tokens.push(PtxToken::Comma);
481                    self.a.unparse_tokens(tokens);
482            tokens.push(PtxToken::Comma);
483                    self.b.unparse_tokens(tokens);
484            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
485                    if let Some(opt_18) = self.cache_policy.as_ref() {
486                        opt_18.unparse_tokens(tokens);
487                    }
488            tokens.push(PtxToken::Semicolon);
489        }
490    }
491
492    impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintF16 {
493        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
494            push_opcode(tokens, "atom");
495                    if let Some(sem_19) = self.sem.as_ref() {
496                            match sem_19 {
497                                    Sem::Relaxed => {
498                                            push_directive(tokens, "relaxed");
499                                    }
500                                    Sem::Acquire => {
501                                            push_directive(tokens, "acquire");
502                                    }
503                                    Sem::Release => {
504                                            push_directive(tokens, "release");
505                                    }
506                                    Sem::AcqRel => {
507                                            push_directive(tokens, "acq_rel");
508                                    }
509                            }
510                    }
511                    if let Some(scope_20) = self.scope.as_ref() {
512                            match scope_20 {
513                                    Scope::Cluster => {
514                                            push_directive(tokens, "cluster");
515                                    }
516                                    Scope::Cta => {
517                                            push_directive(tokens, "cta");
518                                    }
519                                    Scope::Gpu => {
520                                            push_directive(tokens, "gpu");
521                                    }
522                                    Scope::Sys => {
523                                            push_directive(tokens, "sys");
524                                    }
525                            }
526                    }
527                    if let Some(space_21) = self.space.as_ref() {
528                            match space_21 {
529                                    Space::SharedCluster => {
530                                            push_directive(tokens, "shared::cluster");
531                                    }
532                                    Space::SharedCta => {
533                                            push_directive(tokens, "shared::cta");
534                                    }
535                                    Space::Global => {
536                                            push_directive(tokens, "global");
537                                    }
538                                    Space::Shared => {
539                                            push_directive(tokens, "shared");
540                                    }
541                            }
542                    }
543                    push_directive(tokens, "add");
544                    push_directive(tokens, "noftz");
545                    if let Some(level_cache_hint_22) = self.level_cache_hint.as_ref() {
546                            match level_cache_hint_22 {
547                                    LevelCacheHint::L2CacheHint => {
548                                            push_directive(tokens, "L2::cache_hint");
549                                    }
550                            }
551                    }
552                    push_directive(tokens, "f16");
553                    self.d.unparse_tokens(tokens);
554            tokens.push(PtxToken::Comma);
555                    self.a.unparse_tokens(tokens);
556            tokens.push(PtxToken::Comma);
557                    self.b.unparse_tokens(tokens);
558            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
559                    if let Some(opt_23) = self.cache_policy.as_ref() {
560                        opt_23.unparse_tokens(tokens);
561                    }
562            tokens.push(PtxToken::Semicolon);
563        }
564    }
565
566    impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintF16x2 {
567        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
568            push_opcode(tokens, "atom");
569                    if let Some(sem_24) = self.sem.as_ref() {
570                            match sem_24 {
571                                    Sem::Relaxed => {
572                                            push_directive(tokens, "relaxed");
573                                    }
574                                    Sem::Acquire => {
575                                            push_directive(tokens, "acquire");
576                                    }
577                                    Sem::Release => {
578                                            push_directive(tokens, "release");
579                                    }
580                                    Sem::AcqRel => {
581                                            push_directive(tokens, "acq_rel");
582                                    }
583                            }
584                    }
585                    if let Some(scope_25) = self.scope.as_ref() {
586                            match scope_25 {
587                                    Scope::Cluster => {
588                                            push_directive(tokens, "cluster");
589                                    }
590                                    Scope::Cta => {
591                                            push_directive(tokens, "cta");
592                                    }
593                                    Scope::Gpu => {
594                                            push_directive(tokens, "gpu");
595                                    }
596                                    Scope::Sys => {
597                                            push_directive(tokens, "sys");
598                                    }
599                            }
600                    }
601                    if let Some(space_26) = self.space.as_ref() {
602                            match space_26 {
603                                    Space::SharedCluster => {
604                                            push_directive(tokens, "shared::cluster");
605                                    }
606                                    Space::SharedCta => {
607                                            push_directive(tokens, "shared::cta");
608                                    }
609                                    Space::Global => {
610                                            push_directive(tokens, "global");
611                                    }
612                                    Space::Shared => {
613                                            push_directive(tokens, "shared");
614                                    }
615                            }
616                    }
617                    push_directive(tokens, "add");
618                    push_directive(tokens, "noftz");
619                    if let Some(level_cache_hint_27) = self.level_cache_hint.as_ref() {
620                            match level_cache_hint_27 {
621                                    LevelCacheHint::L2CacheHint => {
622                                            push_directive(tokens, "L2::cache_hint");
623                                    }
624                            }
625                    }
626                    push_directive(tokens, "f16x2");
627                    self.d.unparse_tokens(tokens);
628            tokens.push(PtxToken::Comma);
629                    self.a.unparse_tokens(tokens);
630            tokens.push(PtxToken::Comma);
631                    self.b.unparse_tokens(tokens);
632            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
633                    if let Some(opt_28) = self.cache_policy.as_ref() {
634                        opt_28.unparse_tokens(tokens);
635                    }
636            tokens.push(PtxToken::Semicolon);
637        }
638    }
639
640    impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintBf16 {
641        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
642            push_opcode(tokens, "atom");
643                    if let Some(sem_29) = self.sem.as_ref() {
644                            match sem_29 {
645                                    Sem::Relaxed => {
646                                            push_directive(tokens, "relaxed");
647                                    }
648                                    Sem::Acquire => {
649                                            push_directive(tokens, "acquire");
650                                    }
651                                    Sem::Release => {
652                                            push_directive(tokens, "release");
653                                    }
654                                    Sem::AcqRel => {
655                                            push_directive(tokens, "acq_rel");
656                                    }
657                            }
658                    }
659                    if let Some(scope_30) = self.scope.as_ref() {
660                            match scope_30 {
661                                    Scope::Cluster => {
662                                            push_directive(tokens, "cluster");
663                                    }
664                                    Scope::Cta => {
665                                            push_directive(tokens, "cta");
666                                    }
667                                    Scope::Gpu => {
668                                            push_directive(tokens, "gpu");
669                                    }
670                                    Scope::Sys => {
671                                            push_directive(tokens, "sys");
672                                    }
673                            }
674                    }
675                    if let Some(space_31) = self.space.as_ref() {
676                            match space_31 {
677                                    Space::SharedCluster => {
678                                            push_directive(tokens, "shared::cluster");
679                                    }
680                                    Space::SharedCta => {
681                                            push_directive(tokens, "shared::cta");
682                                    }
683                                    Space::Global => {
684                                            push_directive(tokens, "global");
685                                    }
686                                    Space::Shared => {
687                                            push_directive(tokens, "shared");
688                                    }
689                            }
690                    }
691                    push_directive(tokens, "add");
692                    push_directive(tokens, "noftz");
693                    if let Some(level_cache_hint_32) = self.level_cache_hint.as_ref() {
694                            match level_cache_hint_32 {
695                                    LevelCacheHint::L2CacheHint => {
696                                            push_directive(tokens, "L2::cache_hint");
697                                    }
698                            }
699                    }
700                    push_directive(tokens, "bf16");
701                    self.d.unparse_tokens(tokens);
702            tokens.push(PtxToken::Comma);
703                    self.a.unparse_tokens(tokens);
704            tokens.push(PtxToken::Comma);
705                    self.b.unparse_tokens(tokens);
706            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
707                    if let Some(opt_33) = self.cache_policy.as_ref() {
708                        opt_33.unparse_tokens(tokens);
709                    }
710            tokens.push(PtxToken::Semicolon);
711        }
712    }
713
714    impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintBf16x2 {
715        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
716            push_opcode(tokens, "atom");
717                    if let Some(sem_34) = self.sem.as_ref() {
718                            match sem_34 {
719                                    Sem::Relaxed => {
720                                            push_directive(tokens, "relaxed");
721                                    }
722                                    Sem::Acquire => {
723                                            push_directive(tokens, "acquire");
724                                    }
725                                    Sem::Release => {
726                                            push_directive(tokens, "release");
727                                    }
728                                    Sem::AcqRel => {
729                                            push_directive(tokens, "acq_rel");
730                                    }
731                            }
732                    }
733                    if let Some(scope_35) = self.scope.as_ref() {
734                            match scope_35 {
735                                    Scope::Cluster => {
736                                            push_directive(tokens, "cluster");
737                                    }
738                                    Scope::Cta => {
739                                            push_directive(tokens, "cta");
740                                    }
741                                    Scope::Gpu => {
742                                            push_directive(tokens, "gpu");
743                                    }
744                                    Scope::Sys => {
745                                            push_directive(tokens, "sys");
746                                    }
747                            }
748                    }
749                    if let Some(space_36) = self.space.as_ref() {
750                            match space_36 {
751                                    Space::SharedCluster => {
752                                            push_directive(tokens, "shared::cluster");
753                                    }
754                                    Space::SharedCta => {
755                                            push_directive(tokens, "shared::cta");
756                                    }
757                                    Space::Global => {
758                                            push_directive(tokens, "global");
759                                    }
760                                    Space::Shared => {
761                                            push_directive(tokens, "shared");
762                                    }
763                            }
764                    }
765                    push_directive(tokens, "add");
766                    push_directive(tokens, "noftz");
767                    if let Some(level_cache_hint_37) = self.level_cache_hint.as_ref() {
768                            match level_cache_hint_37 {
769                                    LevelCacheHint::L2CacheHint => {
770                                            push_directive(tokens, "L2::cache_hint");
771                                    }
772                            }
773                    }
774                    push_directive(tokens, "bf16x2");
775                    self.d.unparse_tokens(tokens);
776            tokens.push(PtxToken::Comma);
777                    self.a.unparse_tokens(tokens);
778            tokens.push(PtxToken::Comma);
779                    self.b.unparse_tokens(tokens);
780            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
781                    if let Some(opt_38) = self.cache_policy.as_ref() {
782                        opt_38.unparse_tokens(tokens);
783                    }
784            tokens.push(PtxToken::Semicolon);
785        }
786    }
787
788}
789
790pub mod section_1 {
791    use super::*;
792    use crate::r#type::instruction::atom::section_1::*;
793
794    impl PtxUnparser for AtomSemScopeGlobalAddLevelCacheHintVec32BitF32 {
795        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
796            push_opcode(tokens, "atom");
797                    if let Some(sem_39) = self.sem.as_ref() {
798                            match sem_39 {
799                                    Sem::Relaxed => {
800                                            push_directive(tokens, "relaxed");
801                                    }
802                                    Sem::Acquire => {
803                                            push_directive(tokens, "acquire");
804                                    }
805                                    Sem::Release => {
806                                            push_directive(tokens, "release");
807                                    }
808                                    Sem::AcqRel => {
809                                            push_directive(tokens, "acq_rel");
810                                    }
811                            }
812                    }
813                    if let Some(scope_40) = self.scope.as_ref() {
814                            match scope_40 {
815                                    Scope::Cluster => {
816                                            push_directive(tokens, "cluster");
817                                    }
818                                    Scope::Cta => {
819                                            push_directive(tokens, "cta");
820                                    }
821                                    Scope::Gpu => {
822                                            push_directive(tokens, "gpu");
823                                    }
824                                    Scope::Sys => {
825                                            push_directive(tokens, "sys");
826                                    }
827                            }
828                    }
829                    if self.global {
830                            push_directive(tokens, "global");
831                    }
832                    push_directive(tokens, "add");
833                    if let Some(level_cache_hint_41) = self.level_cache_hint.as_ref() {
834                            match level_cache_hint_41 {
835                                    LevelCacheHint::L2CacheHint => {
836                                            push_directive(tokens, "L2::cache_hint");
837                                    }
838                            }
839                    }
840                    match &self.vec_32_bit {
841                            Vec32Bit::V2 => {
842                                    push_directive(tokens, "v2");
843                            }
844                            Vec32Bit::V4 => {
845                                    push_directive(tokens, "v4");
846                            }
847                    }
848                    push_directive(tokens, "f32");
849                    self.d.unparse_tokens(tokens);
850            tokens.push(PtxToken::Comma);
851                    self.a.unparse_tokens(tokens);
852            tokens.push(PtxToken::Comma);
853                    self.b.unparse_tokens(tokens);
854            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
855                    if let Some(opt_42) = self.cache_policy.as_ref() {
856                        opt_42.unparse_tokens(tokens);
857                    }
858            tokens.push(PtxToken::Semicolon);
859        }
860    }
861
862    impl PtxUnparser for AtomSemScopeGlobalOpNoftzLevelCacheHintVec16BitHalfWordType {
863        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
864            push_opcode(tokens, "atom");
865                    if let Some(sem_43) = self.sem.as_ref() {
866                            match sem_43 {
867                                    Sem::Relaxed => {
868                                            push_directive(tokens, "relaxed");
869                                    }
870                                    Sem::Acquire => {
871                                            push_directive(tokens, "acquire");
872                                    }
873                                    Sem::Release => {
874                                            push_directive(tokens, "release");
875                                    }
876                                    Sem::AcqRel => {
877                                            push_directive(tokens, "acq_rel");
878                                    }
879                            }
880                    }
881                    if let Some(scope_44) = self.scope.as_ref() {
882                            match scope_44 {
883                                    Scope::Cluster => {
884                                            push_directive(tokens, "cluster");
885                                    }
886                                    Scope::Cta => {
887                                            push_directive(tokens, "cta");
888                                    }
889                                    Scope::Gpu => {
890                                            push_directive(tokens, "gpu");
891                                    }
892                                    Scope::Sys => {
893                                            push_directive(tokens, "sys");
894                                    }
895                            }
896                    }
897                    if self.global {
898                            push_directive(tokens, "global");
899                    }
900                    match &self.op {
901                            Op::Add => {
902                                    push_directive(tokens, "add");
903                            }
904                            Op::Min => {
905                                    push_directive(tokens, "min");
906                            }
907                            Op::Max => {
908                                    push_directive(tokens, "max");
909                            }
910                    }
911                    push_directive(tokens, "noftz");
912                    if let Some(level_cache_hint_45) = self.level_cache_hint.as_ref() {
913                            match level_cache_hint_45 {
914                                    LevelCacheHint::L2CacheHint => {
915                                            push_directive(tokens, "L2::cache_hint");
916                                    }
917                            }
918                    }
919                    match &self.vec_16_bit {
920                            Vec16Bit::V2 => {
921                                    push_directive(tokens, "v2");
922                            }
923                            Vec16Bit::V4 => {
924                                    push_directive(tokens, "v4");
925                            }
926                            Vec16Bit::V8 => {
927                                    push_directive(tokens, "v8");
928                            }
929                    }
930                    match &self.half_word_type {
931                            HalfWordType::Bf16 => {
932                                    push_directive(tokens, "bf16");
933                            }
934                            HalfWordType::F16 => {
935                                    push_directive(tokens, "f16");
936                            }
937                    }
938                    self.d.unparse_tokens(tokens);
939            tokens.push(PtxToken::Comma);
940                    self.a.unparse_tokens(tokens);
941            tokens.push(PtxToken::Comma);
942                    self.b.unparse_tokens(tokens);
943            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
944                    if let Some(opt_46) = self.cache_policy.as_ref() {
945                        opt_46.unparse_tokens(tokens);
946                    }
947            tokens.push(PtxToken::Semicolon);
948        }
949    }
950
951    impl PtxUnparser for AtomSemScopeGlobalOpNoftzLevelCacheHintVec32BitPackedType {
952        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
953            push_opcode(tokens, "atom");
954                    if let Some(sem_47) = self.sem.as_ref() {
955                            match sem_47 {
956                                    Sem::Relaxed => {
957                                            push_directive(tokens, "relaxed");
958                                    }
959                                    Sem::Acquire => {
960                                            push_directive(tokens, "acquire");
961                                    }
962                                    Sem::Release => {
963                                            push_directive(tokens, "release");
964                                    }
965                                    Sem::AcqRel => {
966                                            push_directive(tokens, "acq_rel");
967                                    }
968                            }
969                    }
970                    if let Some(scope_48) = self.scope.as_ref() {
971                            match scope_48 {
972                                    Scope::Cluster => {
973                                            push_directive(tokens, "cluster");
974                                    }
975                                    Scope::Cta => {
976                                            push_directive(tokens, "cta");
977                                    }
978                                    Scope::Gpu => {
979                                            push_directive(tokens, "gpu");
980                                    }
981                                    Scope::Sys => {
982                                            push_directive(tokens, "sys");
983                                    }
984                            }
985                    }
986                    if self.global {
987                            push_directive(tokens, "global");
988                    }
989                    match &self.op {
990                            Op::Add => {
991                                    push_directive(tokens, "add");
992                            }
993                            Op::Min => {
994                                    push_directive(tokens, "min");
995                            }
996                            Op::Max => {
997                                    push_directive(tokens, "max");
998                            }
999                    }
1000                    push_directive(tokens, "noftz");
1001                    if let Some(level_cache_hint_49) = self.level_cache_hint.as_ref() {
1002                            match level_cache_hint_49 {
1003                                    LevelCacheHint::L2CacheHint => {
1004                                            push_directive(tokens, "L2::cache_hint");
1005                                    }
1006                            }
1007                    }
1008                    match &self.vec_32_bit {
1009                            Vec32Bit::V2 => {
1010                                    push_directive(tokens, "v2");
1011                            }
1012                            Vec32Bit::V4 => {
1013                                    push_directive(tokens, "v4");
1014                            }
1015                    }
1016                    match &self.packed_type {
1017                            PackedType::Bf16x2 => {
1018                                    push_directive(tokens, "bf16x2");
1019                            }
1020                            PackedType::F16x2 => {
1021                                    push_directive(tokens, "f16x2");
1022                            }
1023                    }
1024                    self.d.unparse_tokens(tokens);
1025            tokens.push(PtxToken::Comma);
1026                    self.a.unparse_tokens(tokens);
1027            tokens.push(PtxToken::Comma);
1028                    self.b.unparse_tokens(tokens);
1029            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
1030                    if let Some(opt_50) = self.cache_policy.as_ref() {
1031                        opt_50.unparse_tokens(tokens);
1032                    }
1033            tokens.push(PtxToken::Semicolon);
1034        }
1035    }
1036
1037}
1038