1#![allow(unused)]
43
44use crate::lexer::PtxToken;
45use crate::unparser::{PtxUnparser, common::*};
46
47pub mod section_0 {
48 use super::*;
49 use crate::r#type::instruction::atom::section_0::*;
50
51 impl PtxUnparser for AtomSemScopeSpaceOpLevelCacheHintType {
52 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
53 self.unparse_tokens_mode(tokens, false);
54 }
55 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
56 push_opcode(tokens, "atom");
57 if let Some(sem_0) = self.sem.as_ref() {
58 match sem_0 {
59 Sem::Relaxed => {
60 push_directive(tokens, "relaxed");
61 }
62 Sem::Acquire => {
63 push_directive(tokens, "acquire");
64 }
65 Sem::Release => {
66 push_directive(tokens, "release");
67 }
68 Sem::AcqRel => {
69 push_directive(tokens, "acq_rel");
70 }
71 }
72 }
73 if let Some(scope_1) = self.scope.as_ref() {
74 match scope_1 {
75 Scope::Cluster => {
76 push_directive(tokens, "cluster");
77 }
78 Scope::Cta => {
79 push_directive(tokens, "cta");
80 }
81 Scope::Gpu => {
82 push_directive(tokens, "gpu");
83 }
84 Scope::Sys => {
85 push_directive(tokens, "sys");
86 }
87 }
88 }
89 if let Some(space_2) = self.space.as_ref() {
90 match space_2 {
91 Space::SharedCluster => {
92 push_directive(tokens, "shared::cluster");
93 }
94 Space::SharedCta => {
95 push_directive(tokens, "shared::cta");
96 }
97 Space::Global => {
98 push_directive(tokens, "global");
99 }
100 Space::Shared => {
101 push_directive(tokens, "shared");
102 }
103 }
104 }
105 match &self.op {
106 Op::Exch => {
107 push_directive(tokens, "exch");
108 }
109 Op::And => {
110 push_directive(tokens, "and");
111 }
112 Op::Xor => {
113 push_directive(tokens, "xor");
114 }
115 Op::Cas => {
116 push_directive(tokens, "cas");
117 }
118 Op::Add => {
119 push_directive(tokens, "add");
120 }
121 Op::Inc => {
122 push_directive(tokens, "inc");
123 }
124 Op::Dec => {
125 push_directive(tokens, "dec");
126 }
127 Op::Min => {
128 push_directive(tokens, "min");
129 }
130 Op::Max => {
131 push_directive(tokens, "max");
132 }
133 Op::Or => {
134 push_directive(tokens, "or");
135 }
136 }
137 if let Some(level_cache_hint_3) = self.level_cache_hint.as_ref() {
138 match level_cache_hint_3 {
139 LevelCacheHint::L2CacheHint => {
140 push_directive(tokens, "L2::cache_hint");
141 }
142 }
143 }
144 match &self.type_ {
145 Type::B32 => {
146 push_directive(tokens, "b32");
147 }
148 Type::B64 => {
149 push_directive(tokens, "b64");
150 }
151 Type::U32 => {
152 push_directive(tokens, "u32");
153 }
154 Type::U64 => {
155 push_directive(tokens, "u64");
156 }
157 Type::S32 => {
158 push_directive(tokens, "s32");
159 }
160 Type::S64 => {
161 push_directive(tokens, "s64");
162 }
163 Type::F32 => {
164 push_directive(tokens, "f32");
165 }
166 Type::F64 => {
167 push_directive(tokens, "f64");
168 }
169 }
170 if spaced {
171 tokens.push(PtxToken::Space);
172 }
173 self.d.unparse_tokens_mode(tokens, spaced);
174 tokens.push(PtxToken::Comma);
175 if spaced {
176 tokens.push(PtxToken::Space);
177 }
178 self.a.unparse_tokens_mode(tokens, spaced);
179 tokens.push(PtxToken::Comma);
180 if spaced {
181 tokens.push(PtxToken::Space);
182 }
183 self.b.unparse_tokens_mode(tokens, spaced);
184 if self.cache_policy.is_some() {
185 tokens.push(PtxToken::Comma);
186 }
187 if let Some(opt_4) = self.cache_policy.as_ref() {
188 if spaced {
189 tokens.push(PtxToken::Space);
190 }
191 opt_4.unparse_tokens_mode(tokens, spaced);
192 }
193 tokens.push(PtxToken::Semicolon);
194 if spaced {
195 tokens.push(PtxToken::Newline);
196 }
197 }
198 }
199
200 impl PtxUnparser for AtomSemScopeSpaceOpType {
201 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
202 self.unparse_tokens_mode(tokens, false);
203 }
204 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
205 push_opcode(tokens, "atom");
206 if let Some(sem_5) = self.sem.as_ref() {
207 match sem_5 {
208 Sem::Relaxed => {
209 push_directive(tokens, "relaxed");
210 }
211 Sem::Acquire => {
212 push_directive(tokens, "acquire");
213 }
214 Sem::Release => {
215 push_directive(tokens, "release");
216 }
217 Sem::AcqRel => {
218 push_directive(tokens, "acq_rel");
219 }
220 }
221 }
222 if let Some(scope_6) = self.scope.as_ref() {
223 match scope_6 {
224 Scope::Cluster => {
225 push_directive(tokens, "cluster");
226 }
227 Scope::Cta => {
228 push_directive(tokens, "cta");
229 }
230 Scope::Gpu => {
231 push_directive(tokens, "gpu");
232 }
233 Scope::Sys => {
234 push_directive(tokens, "sys");
235 }
236 }
237 }
238 if let Some(space_7) = self.space.as_ref() {
239 match space_7 {
240 Space::SharedCluster => {
241 push_directive(tokens, "shared::cluster");
242 }
243 Space::SharedCta => {
244 push_directive(tokens, "shared::cta");
245 }
246 Space::Global => {
247 push_directive(tokens, "global");
248 }
249 Space::Shared => {
250 push_directive(tokens, "shared");
251 }
252 }
253 }
254 match &self.op {
255 Op::Exch => {
256 push_directive(tokens, "exch");
257 }
258 Op::And => {
259 push_directive(tokens, "and");
260 }
261 Op::Xor => {
262 push_directive(tokens, "xor");
263 }
264 Op::Cas => {
265 push_directive(tokens, "cas");
266 }
267 Op::Add => {
268 push_directive(tokens, "add");
269 }
270 Op::Inc => {
271 push_directive(tokens, "inc");
272 }
273 Op::Dec => {
274 push_directive(tokens, "dec");
275 }
276 Op::Min => {
277 push_directive(tokens, "min");
278 }
279 Op::Max => {
280 push_directive(tokens, "max");
281 }
282 Op::Or => {
283 push_directive(tokens, "or");
284 }
285 }
286 match &self.type_ {
287 Type::B32 => {
288 push_directive(tokens, "b32");
289 }
290 Type::B64 => {
291 push_directive(tokens, "b64");
292 }
293 Type::U32 => {
294 push_directive(tokens, "u32");
295 }
296 Type::U64 => {
297 push_directive(tokens, "u64");
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 }
312 if spaced {
313 tokens.push(PtxToken::Space);
314 }
315 self.d.unparse_tokens_mode(tokens, spaced);
316 tokens.push(PtxToken::Comma);
317 if spaced {
318 tokens.push(PtxToken::Space);
319 }
320 self.a.unparse_tokens_mode(tokens, spaced);
321 tokens.push(PtxToken::Comma);
322 if spaced {
323 tokens.push(PtxToken::Space);
324 }
325 self.b.unparse_tokens_mode(tokens, spaced);
326 tokens.push(PtxToken::Comma);
327 if spaced {
328 tokens.push(PtxToken::Space);
329 }
330 self.c.unparse_tokens_mode(tokens, spaced);
331 tokens.push(PtxToken::Semicolon);
332 if spaced {
333 tokens.push(PtxToken::Newline);
334 }
335 }
336 }
337
338 impl PtxUnparser for AtomSemScopeSpaceCasB16 {
339 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
340 self.unparse_tokens_mode(tokens, false);
341 }
342 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
343 push_opcode(tokens, "atom");
344 if let Some(sem_8) = self.sem.as_ref() {
345 match sem_8 {
346 Sem::Relaxed => {
347 push_directive(tokens, "relaxed");
348 }
349 Sem::Acquire => {
350 push_directive(tokens, "acquire");
351 }
352 Sem::Release => {
353 push_directive(tokens, "release");
354 }
355 Sem::AcqRel => {
356 push_directive(tokens, "acq_rel");
357 }
358 }
359 }
360 if let Some(scope_9) = self.scope.as_ref() {
361 match scope_9 {
362 Scope::Cluster => {
363 push_directive(tokens, "cluster");
364 }
365 Scope::Cta => {
366 push_directive(tokens, "cta");
367 }
368 Scope::Gpu => {
369 push_directive(tokens, "gpu");
370 }
371 Scope::Sys => {
372 push_directive(tokens, "sys");
373 }
374 }
375 }
376 if let Some(space_10) = self.space.as_ref() {
377 match space_10 {
378 Space::SharedCluster => {
379 push_directive(tokens, "shared::cluster");
380 }
381 Space::SharedCta => {
382 push_directive(tokens, "shared::cta");
383 }
384 Space::Global => {
385 push_directive(tokens, "global");
386 }
387 Space::Shared => {
388 push_directive(tokens, "shared");
389 }
390 }
391 }
392 push_directive(tokens, "cas");
393 push_directive(tokens, "b16");
394 if spaced {
395 tokens.push(PtxToken::Space);
396 }
397 self.d.unparse_tokens_mode(tokens, spaced);
398 tokens.push(PtxToken::Comma);
399 if spaced {
400 tokens.push(PtxToken::Space);
401 }
402 self.a.unparse_tokens_mode(tokens, spaced);
403 tokens.push(PtxToken::Comma);
404 if spaced {
405 tokens.push(PtxToken::Space);
406 }
407 self.b.unparse_tokens_mode(tokens, spaced);
408 tokens.push(PtxToken::Comma);
409 if spaced {
410 tokens.push(PtxToken::Space);
411 }
412 self.c.unparse_tokens_mode(tokens, spaced);
413 tokens.push(PtxToken::Semicolon);
414 if spaced {
415 tokens.push(PtxToken::Newline);
416 }
417 }
418 }
419
420 impl PtxUnparser for AtomSemScopeSpaceCasB128 {
421 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
422 self.unparse_tokens_mode(tokens, false);
423 }
424 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
425 push_opcode(tokens, "atom");
426 if let Some(sem_11) = self.sem.as_ref() {
427 match sem_11 {
428 Sem::Relaxed => {
429 push_directive(tokens, "relaxed");
430 }
431 Sem::Acquire => {
432 push_directive(tokens, "acquire");
433 }
434 Sem::Release => {
435 push_directive(tokens, "release");
436 }
437 Sem::AcqRel => {
438 push_directive(tokens, "acq_rel");
439 }
440 }
441 }
442 if let Some(scope_12) = self.scope.as_ref() {
443 match scope_12 {
444 Scope::Cluster => {
445 push_directive(tokens, "cluster");
446 }
447 Scope::Cta => {
448 push_directive(tokens, "cta");
449 }
450 Scope::Gpu => {
451 push_directive(tokens, "gpu");
452 }
453 Scope::Sys => {
454 push_directive(tokens, "sys");
455 }
456 }
457 }
458 if let Some(space_13) = self.space.as_ref() {
459 match space_13 {
460 Space::SharedCluster => {
461 push_directive(tokens, "shared::cluster");
462 }
463 Space::SharedCta => {
464 push_directive(tokens, "shared::cta");
465 }
466 Space::Global => {
467 push_directive(tokens, "global");
468 }
469 Space::Shared => {
470 push_directive(tokens, "shared");
471 }
472 }
473 }
474 push_directive(tokens, "cas");
475 push_directive(tokens, "b128");
476 if spaced {
477 tokens.push(PtxToken::Space);
478 }
479 self.d.unparse_tokens_mode(tokens, spaced);
480 tokens.push(PtxToken::Comma);
481 if spaced {
482 tokens.push(PtxToken::Space);
483 }
484 self.a.unparse_tokens_mode(tokens, spaced);
485 tokens.push(PtxToken::Comma);
486 if spaced {
487 tokens.push(PtxToken::Space);
488 }
489 self.b.unparse_tokens_mode(tokens, spaced);
490 tokens.push(PtxToken::Comma);
491 if spaced {
492 tokens.push(PtxToken::Space);
493 }
494 self.c.unparse_tokens_mode(tokens, spaced);
495 tokens.push(PtxToken::Semicolon);
496 if spaced {
497 tokens.push(PtxToken::Newline);
498 }
499 }
500 }
501
502 impl PtxUnparser for AtomSemScopeSpaceExchLevelCacheHintB128 {
503 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
504 self.unparse_tokens_mode(tokens, false);
505 }
506 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
507 push_opcode(tokens, "atom");
508 if let Some(sem_14) = self.sem.as_ref() {
509 match sem_14 {
510 Sem::Relaxed => {
511 push_directive(tokens, "relaxed");
512 }
513 Sem::Acquire => {
514 push_directive(tokens, "acquire");
515 }
516 Sem::Release => {
517 push_directive(tokens, "release");
518 }
519 Sem::AcqRel => {
520 push_directive(tokens, "acq_rel");
521 }
522 }
523 }
524 if let Some(scope_15) = self.scope.as_ref() {
525 match scope_15 {
526 Scope::Cluster => {
527 push_directive(tokens, "cluster");
528 }
529 Scope::Cta => {
530 push_directive(tokens, "cta");
531 }
532 Scope::Gpu => {
533 push_directive(tokens, "gpu");
534 }
535 Scope::Sys => {
536 push_directive(tokens, "sys");
537 }
538 }
539 }
540 if let Some(space_16) = self.space.as_ref() {
541 match space_16 {
542 Space::SharedCluster => {
543 push_directive(tokens, "shared::cluster");
544 }
545 Space::SharedCta => {
546 push_directive(tokens, "shared::cta");
547 }
548 Space::Global => {
549 push_directive(tokens, "global");
550 }
551 Space::Shared => {
552 push_directive(tokens, "shared");
553 }
554 }
555 }
556 push_directive(tokens, "exch");
557 if let Some(level_cache_hint_17) = self.level_cache_hint.as_ref() {
558 match level_cache_hint_17 {
559 LevelCacheHint::L2CacheHint => {
560 push_directive(tokens, "L2::cache_hint");
561 }
562 }
563 }
564 push_directive(tokens, "b128");
565 if spaced {
566 tokens.push(PtxToken::Space);
567 }
568 self.d.unparse_tokens_mode(tokens, spaced);
569 tokens.push(PtxToken::Comma);
570 if spaced {
571 tokens.push(PtxToken::Space);
572 }
573 self.a.unparse_tokens_mode(tokens, spaced);
574 tokens.push(PtxToken::Comma);
575 if spaced {
576 tokens.push(PtxToken::Space);
577 }
578 self.b.unparse_tokens_mode(tokens, spaced);
579 if self.cache_policy.is_some() {
580 tokens.push(PtxToken::Comma);
581 }
582 if let Some(opt_18) = self.cache_policy.as_ref() {
583 if spaced {
584 tokens.push(PtxToken::Space);
585 }
586 opt_18.unparse_tokens_mode(tokens, spaced);
587 }
588 tokens.push(PtxToken::Semicolon);
589 if spaced {
590 tokens.push(PtxToken::Newline);
591 }
592 }
593 }
594
595 impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintF16 {
596 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
597 self.unparse_tokens_mode(tokens, false);
598 }
599 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
600 push_opcode(tokens, "atom");
601 if let Some(sem_19) = self.sem.as_ref() {
602 match sem_19 {
603 Sem::Relaxed => {
604 push_directive(tokens, "relaxed");
605 }
606 Sem::Acquire => {
607 push_directive(tokens, "acquire");
608 }
609 Sem::Release => {
610 push_directive(tokens, "release");
611 }
612 Sem::AcqRel => {
613 push_directive(tokens, "acq_rel");
614 }
615 }
616 }
617 if let Some(scope_20) = self.scope.as_ref() {
618 match scope_20 {
619 Scope::Cluster => {
620 push_directive(tokens, "cluster");
621 }
622 Scope::Cta => {
623 push_directive(tokens, "cta");
624 }
625 Scope::Gpu => {
626 push_directive(tokens, "gpu");
627 }
628 Scope::Sys => {
629 push_directive(tokens, "sys");
630 }
631 }
632 }
633 if let Some(space_21) = self.space.as_ref() {
634 match space_21 {
635 Space::SharedCluster => {
636 push_directive(tokens, "shared::cluster");
637 }
638 Space::SharedCta => {
639 push_directive(tokens, "shared::cta");
640 }
641 Space::Global => {
642 push_directive(tokens, "global");
643 }
644 Space::Shared => {
645 push_directive(tokens, "shared");
646 }
647 }
648 }
649 push_directive(tokens, "add");
650 push_directive(tokens, "noftz");
651 if let Some(level_cache_hint_22) = self.level_cache_hint.as_ref() {
652 match level_cache_hint_22 {
653 LevelCacheHint::L2CacheHint => {
654 push_directive(tokens, "L2::cache_hint");
655 }
656 }
657 }
658 push_directive(tokens, "f16");
659 if spaced {
660 tokens.push(PtxToken::Space);
661 }
662 self.d.unparse_tokens_mode(tokens, spaced);
663 tokens.push(PtxToken::Comma);
664 if spaced {
665 tokens.push(PtxToken::Space);
666 }
667 self.a.unparse_tokens_mode(tokens, spaced);
668 tokens.push(PtxToken::Comma);
669 if spaced {
670 tokens.push(PtxToken::Space);
671 }
672 self.b.unparse_tokens_mode(tokens, spaced);
673 if self.cache_policy.is_some() {
674 tokens.push(PtxToken::Comma);
675 }
676 if let Some(opt_23) = self.cache_policy.as_ref() {
677 if spaced {
678 tokens.push(PtxToken::Space);
679 }
680 opt_23.unparse_tokens_mode(tokens, spaced);
681 }
682 tokens.push(PtxToken::Semicolon);
683 if spaced {
684 tokens.push(PtxToken::Newline);
685 }
686 }
687 }
688
689 impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintF16x2 {
690 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
691 self.unparse_tokens_mode(tokens, false);
692 }
693 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
694 push_opcode(tokens, "atom");
695 if let Some(sem_24) = self.sem.as_ref() {
696 match sem_24 {
697 Sem::Relaxed => {
698 push_directive(tokens, "relaxed");
699 }
700 Sem::Acquire => {
701 push_directive(tokens, "acquire");
702 }
703 Sem::Release => {
704 push_directive(tokens, "release");
705 }
706 Sem::AcqRel => {
707 push_directive(tokens, "acq_rel");
708 }
709 }
710 }
711 if let Some(scope_25) = self.scope.as_ref() {
712 match scope_25 {
713 Scope::Cluster => {
714 push_directive(tokens, "cluster");
715 }
716 Scope::Cta => {
717 push_directive(tokens, "cta");
718 }
719 Scope::Gpu => {
720 push_directive(tokens, "gpu");
721 }
722 Scope::Sys => {
723 push_directive(tokens, "sys");
724 }
725 }
726 }
727 if let Some(space_26) = self.space.as_ref() {
728 match space_26 {
729 Space::SharedCluster => {
730 push_directive(tokens, "shared::cluster");
731 }
732 Space::SharedCta => {
733 push_directive(tokens, "shared::cta");
734 }
735 Space::Global => {
736 push_directive(tokens, "global");
737 }
738 Space::Shared => {
739 push_directive(tokens, "shared");
740 }
741 }
742 }
743 push_directive(tokens, "add");
744 push_directive(tokens, "noftz");
745 if let Some(level_cache_hint_27) = self.level_cache_hint.as_ref() {
746 match level_cache_hint_27 {
747 LevelCacheHint::L2CacheHint => {
748 push_directive(tokens, "L2::cache_hint");
749 }
750 }
751 }
752 push_directive(tokens, "f16x2");
753 if spaced {
754 tokens.push(PtxToken::Space);
755 }
756 self.d.unparse_tokens_mode(tokens, spaced);
757 tokens.push(PtxToken::Comma);
758 if spaced {
759 tokens.push(PtxToken::Space);
760 }
761 self.a.unparse_tokens_mode(tokens, spaced);
762 tokens.push(PtxToken::Comma);
763 if spaced {
764 tokens.push(PtxToken::Space);
765 }
766 self.b.unparse_tokens_mode(tokens, spaced);
767 if self.cache_policy.is_some() {
768 tokens.push(PtxToken::Comma);
769 }
770 if let Some(opt_28) = self.cache_policy.as_ref() {
771 if spaced {
772 tokens.push(PtxToken::Space);
773 }
774 opt_28.unparse_tokens_mode(tokens, spaced);
775 }
776 tokens.push(PtxToken::Semicolon);
777 if spaced {
778 tokens.push(PtxToken::Newline);
779 }
780 }
781 }
782
783 impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintBf16 {
784 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
785 self.unparse_tokens_mode(tokens, false);
786 }
787 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
788 push_opcode(tokens, "atom");
789 if let Some(sem_29) = self.sem.as_ref() {
790 match sem_29 {
791 Sem::Relaxed => {
792 push_directive(tokens, "relaxed");
793 }
794 Sem::Acquire => {
795 push_directive(tokens, "acquire");
796 }
797 Sem::Release => {
798 push_directive(tokens, "release");
799 }
800 Sem::AcqRel => {
801 push_directive(tokens, "acq_rel");
802 }
803 }
804 }
805 if let Some(scope_30) = self.scope.as_ref() {
806 match scope_30 {
807 Scope::Cluster => {
808 push_directive(tokens, "cluster");
809 }
810 Scope::Cta => {
811 push_directive(tokens, "cta");
812 }
813 Scope::Gpu => {
814 push_directive(tokens, "gpu");
815 }
816 Scope::Sys => {
817 push_directive(tokens, "sys");
818 }
819 }
820 }
821 if let Some(space_31) = self.space.as_ref() {
822 match space_31 {
823 Space::SharedCluster => {
824 push_directive(tokens, "shared::cluster");
825 }
826 Space::SharedCta => {
827 push_directive(tokens, "shared::cta");
828 }
829 Space::Global => {
830 push_directive(tokens, "global");
831 }
832 Space::Shared => {
833 push_directive(tokens, "shared");
834 }
835 }
836 }
837 push_directive(tokens, "add");
838 push_directive(tokens, "noftz");
839 if let Some(level_cache_hint_32) = self.level_cache_hint.as_ref() {
840 match level_cache_hint_32 {
841 LevelCacheHint::L2CacheHint => {
842 push_directive(tokens, "L2::cache_hint");
843 }
844 }
845 }
846 push_directive(tokens, "bf16");
847 if spaced {
848 tokens.push(PtxToken::Space);
849 }
850 self.d.unparse_tokens_mode(tokens, spaced);
851 tokens.push(PtxToken::Comma);
852 if spaced {
853 tokens.push(PtxToken::Space);
854 }
855 self.a.unparse_tokens_mode(tokens, spaced);
856 tokens.push(PtxToken::Comma);
857 if spaced {
858 tokens.push(PtxToken::Space);
859 }
860 self.b.unparse_tokens_mode(tokens, spaced);
861 if self.cache_policy.is_some() {
862 tokens.push(PtxToken::Comma);
863 }
864 if let Some(opt_33) = self.cache_policy.as_ref() {
865 if spaced {
866 tokens.push(PtxToken::Space);
867 }
868 opt_33.unparse_tokens_mode(tokens, spaced);
869 }
870 tokens.push(PtxToken::Semicolon);
871 if spaced {
872 tokens.push(PtxToken::Newline);
873 }
874 }
875 }
876
877 impl PtxUnparser for AtomSemScopeSpaceAddNoftzLevelCacheHintBf16x2 {
878 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
879 self.unparse_tokens_mode(tokens, false);
880 }
881 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
882 push_opcode(tokens, "atom");
883 if let Some(sem_34) = self.sem.as_ref() {
884 match sem_34 {
885 Sem::Relaxed => {
886 push_directive(tokens, "relaxed");
887 }
888 Sem::Acquire => {
889 push_directive(tokens, "acquire");
890 }
891 Sem::Release => {
892 push_directive(tokens, "release");
893 }
894 Sem::AcqRel => {
895 push_directive(tokens, "acq_rel");
896 }
897 }
898 }
899 if let Some(scope_35) = self.scope.as_ref() {
900 match scope_35 {
901 Scope::Cluster => {
902 push_directive(tokens, "cluster");
903 }
904 Scope::Cta => {
905 push_directive(tokens, "cta");
906 }
907 Scope::Gpu => {
908 push_directive(tokens, "gpu");
909 }
910 Scope::Sys => {
911 push_directive(tokens, "sys");
912 }
913 }
914 }
915 if let Some(space_36) = self.space.as_ref() {
916 match space_36 {
917 Space::SharedCluster => {
918 push_directive(tokens, "shared::cluster");
919 }
920 Space::SharedCta => {
921 push_directive(tokens, "shared::cta");
922 }
923 Space::Global => {
924 push_directive(tokens, "global");
925 }
926 Space::Shared => {
927 push_directive(tokens, "shared");
928 }
929 }
930 }
931 push_directive(tokens, "add");
932 push_directive(tokens, "noftz");
933 if let Some(level_cache_hint_37) = self.level_cache_hint.as_ref() {
934 match level_cache_hint_37 {
935 LevelCacheHint::L2CacheHint => {
936 push_directive(tokens, "L2::cache_hint");
937 }
938 }
939 }
940 push_directive(tokens, "bf16x2");
941 if spaced {
942 tokens.push(PtxToken::Space);
943 }
944 self.d.unparse_tokens_mode(tokens, spaced);
945 tokens.push(PtxToken::Comma);
946 if spaced {
947 tokens.push(PtxToken::Space);
948 }
949 self.a.unparse_tokens_mode(tokens, spaced);
950 tokens.push(PtxToken::Comma);
951 if spaced {
952 tokens.push(PtxToken::Space);
953 }
954 self.b.unparse_tokens_mode(tokens, spaced);
955 if self.cache_policy.is_some() {
956 tokens.push(PtxToken::Comma);
957 }
958 if let Some(opt_38) = self.cache_policy.as_ref() {
959 if spaced {
960 tokens.push(PtxToken::Space);
961 }
962 opt_38.unparse_tokens_mode(tokens, spaced);
963 }
964 tokens.push(PtxToken::Semicolon);
965 if spaced {
966 tokens.push(PtxToken::Newline);
967 }
968 }
969 }
970}
971
972pub mod section_1 {
973 use super::*;
974 use crate::r#type::instruction::atom::section_1::*;
975
976 impl PtxUnparser for AtomSemScopeGlobalAddLevelCacheHintVec32BitF32 {
977 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
978 self.unparse_tokens_mode(tokens, false);
979 }
980 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
981 push_opcode(tokens, "atom");
982 if let Some(sem_39) = self.sem.as_ref() {
983 match sem_39 {
984 Sem::Relaxed => {
985 push_directive(tokens, "relaxed");
986 }
987 Sem::Acquire => {
988 push_directive(tokens, "acquire");
989 }
990 Sem::Release => {
991 push_directive(tokens, "release");
992 }
993 Sem::AcqRel => {
994 push_directive(tokens, "acq_rel");
995 }
996 }
997 }
998 if let Some(scope_40) = self.scope.as_ref() {
999 match scope_40 {
1000 Scope::Cluster => {
1001 push_directive(tokens, "cluster");
1002 }
1003 Scope::Cta => {
1004 push_directive(tokens, "cta");
1005 }
1006 Scope::Gpu => {
1007 push_directive(tokens, "gpu");
1008 }
1009 Scope::Sys => {
1010 push_directive(tokens, "sys");
1011 }
1012 }
1013 }
1014 if self.global {
1015 push_directive(tokens, "global");
1016 }
1017 push_directive(tokens, "add");
1018 if let Some(level_cache_hint_41) = self.level_cache_hint.as_ref() {
1019 match level_cache_hint_41 {
1020 LevelCacheHint::L2CacheHint => {
1021 push_directive(tokens, "L2::cache_hint");
1022 }
1023 }
1024 }
1025 match &self.vec_32_bit {
1026 Vec32Bit::V2 => {
1027 push_directive(tokens, "v2");
1028 }
1029 Vec32Bit::V4 => {
1030 push_directive(tokens, "v4");
1031 }
1032 }
1033 push_directive(tokens, "f32");
1034 if spaced {
1035 tokens.push(PtxToken::Space);
1036 }
1037 self.d.unparse_tokens_mode(tokens, spaced);
1038 tokens.push(PtxToken::Comma);
1039 if spaced {
1040 tokens.push(PtxToken::Space);
1041 }
1042 self.a.unparse_tokens_mode(tokens, spaced);
1043 tokens.push(PtxToken::Comma);
1044 if spaced {
1045 tokens.push(PtxToken::Space);
1046 }
1047 self.b.unparse_tokens_mode(tokens, spaced);
1048 if self.cache_policy.is_some() {
1049 tokens.push(PtxToken::Comma);
1050 }
1051 if let Some(opt_42) = self.cache_policy.as_ref() {
1052 if spaced {
1053 tokens.push(PtxToken::Space);
1054 }
1055 opt_42.unparse_tokens_mode(tokens, spaced);
1056 }
1057 tokens.push(PtxToken::Semicolon);
1058 if spaced {
1059 tokens.push(PtxToken::Newline);
1060 }
1061 }
1062 }
1063
1064 impl PtxUnparser for AtomSemScopeGlobalOpNoftzLevelCacheHintVec16BitHalfWordType {
1065 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1066 self.unparse_tokens_mode(tokens, false);
1067 }
1068 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
1069 push_opcode(tokens, "atom");
1070 if let Some(sem_43) = self.sem.as_ref() {
1071 match sem_43 {
1072 Sem::Relaxed => {
1073 push_directive(tokens, "relaxed");
1074 }
1075 Sem::Acquire => {
1076 push_directive(tokens, "acquire");
1077 }
1078 Sem::Release => {
1079 push_directive(tokens, "release");
1080 }
1081 Sem::AcqRel => {
1082 push_directive(tokens, "acq_rel");
1083 }
1084 }
1085 }
1086 if let Some(scope_44) = self.scope.as_ref() {
1087 match scope_44 {
1088 Scope::Cluster => {
1089 push_directive(tokens, "cluster");
1090 }
1091 Scope::Cta => {
1092 push_directive(tokens, "cta");
1093 }
1094 Scope::Gpu => {
1095 push_directive(tokens, "gpu");
1096 }
1097 Scope::Sys => {
1098 push_directive(tokens, "sys");
1099 }
1100 }
1101 }
1102 if self.global {
1103 push_directive(tokens, "global");
1104 }
1105 match &self.op {
1106 Op::Add => {
1107 push_directive(tokens, "add");
1108 }
1109 Op::Min => {
1110 push_directive(tokens, "min");
1111 }
1112 Op::Max => {
1113 push_directive(tokens, "max");
1114 }
1115 }
1116 push_directive(tokens, "noftz");
1117 if let Some(level_cache_hint_45) = self.level_cache_hint.as_ref() {
1118 match level_cache_hint_45 {
1119 LevelCacheHint::L2CacheHint => {
1120 push_directive(tokens, "L2::cache_hint");
1121 }
1122 }
1123 }
1124 match &self.vec_16_bit {
1125 Vec16Bit::V2 => {
1126 push_directive(tokens, "v2");
1127 }
1128 Vec16Bit::V4 => {
1129 push_directive(tokens, "v4");
1130 }
1131 Vec16Bit::V8 => {
1132 push_directive(tokens, "v8");
1133 }
1134 }
1135 match &self.half_word_type {
1136 HalfWordType::Bf16 => {
1137 push_directive(tokens, "bf16");
1138 }
1139 HalfWordType::F16 => {
1140 push_directive(tokens, "f16");
1141 }
1142 }
1143 if spaced {
1144 tokens.push(PtxToken::Space);
1145 }
1146 self.d.unparse_tokens_mode(tokens, spaced);
1147 tokens.push(PtxToken::Comma);
1148 if spaced {
1149 tokens.push(PtxToken::Space);
1150 }
1151 self.a.unparse_tokens_mode(tokens, spaced);
1152 tokens.push(PtxToken::Comma);
1153 if spaced {
1154 tokens.push(PtxToken::Space);
1155 }
1156 self.b.unparse_tokens_mode(tokens, spaced);
1157 if self.cache_policy.is_some() {
1158 tokens.push(PtxToken::Comma);
1159 }
1160 if let Some(opt_46) = self.cache_policy.as_ref() {
1161 if spaced {
1162 tokens.push(PtxToken::Space);
1163 }
1164 opt_46.unparse_tokens_mode(tokens, spaced);
1165 }
1166 tokens.push(PtxToken::Semicolon);
1167 if spaced {
1168 tokens.push(PtxToken::Newline);
1169 }
1170 }
1171 }
1172
1173 impl PtxUnparser for AtomSemScopeGlobalOpNoftzLevelCacheHintVec32BitPackedType {
1174 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1175 self.unparse_tokens_mode(tokens, false);
1176 }
1177 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
1178 push_opcode(tokens, "atom");
1179 if let Some(sem_47) = self.sem.as_ref() {
1180 match sem_47 {
1181 Sem::Relaxed => {
1182 push_directive(tokens, "relaxed");
1183 }
1184 Sem::Acquire => {
1185 push_directive(tokens, "acquire");
1186 }
1187 Sem::Release => {
1188 push_directive(tokens, "release");
1189 }
1190 Sem::AcqRel => {
1191 push_directive(tokens, "acq_rel");
1192 }
1193 }
1194 }
1195 if let Some(scope_48) = self.scope.as_ref() {
1196 match scope_48 {
1197 Scope::Cluster => {
1198 push_directive(tokens, "cluster");
1199 }
1200 Scope::Cta => {
1201 push_directive(tokens, "cta");
1202 }
1203 Scope::Gpu => {
1204 push_directive(tokens, "gpu");
1205 }
1206 Scope::Sys => {
1207 push_directive(tokens, "sys");
1208 }
1209 }
1210 }
1211 if self.global {
1212 push_directive(tokens, "global");
1213 }
1214 match &self.op {
1215 Op::Add => {
1216 push_directive(tokens, "add");
1217 }
1218 Op::Min => {
1219 push_directive(tokens, "min");
1220 }
1221 Op::Max => {
1222 push_directive(tokens, "max");
1223 }
1224 }
1225 push_directive(tokens, "noftz");
1226 if let Some(level_cache_hint_49) = self.level_cache_hint.as_ref() {
1227 match level_cache_hint_49 {
1228 LevelCacheHint::L2CacheHint => {
1229 push_directive(tokens, "L2::cache_hint");
1230 }
1231 }
1232 }
1233 match &self.vec_32_bit {
1234 Vec32Bit::V2 => {
1235 push_directive(tokens, "v2");
1236 }
1237 Vec32Bit::V4 => {
1238 push_directive(tokens, "v4");
1239 }
1240 }
1241 match &self.packed_type {
1242 PackedType::Bf16x2 => {
1243 push_directive(tokens, "bf16x2");
1244 }
1245 PackedType::F16x2 => {
1246 push_directive(tokens, "f16x2");
1247 }
1248 }
1249 if spaced {
1250 tokens.push(PtxToken::Space);
1251 }
1252 self.d.unparse_tokens_mode(tokens, spaced);
1253 tokens.push(PtxToken::Comma);
1254 if spaced {
1255 tokens.push(PtxToken::Space);
1256 }
1257 self.a.unparse_tokens_mode(tokens, spaced);
1258 tokens.push(PtxToken::Comma);
1259 if spaced {
1260 tokens.push(PtxToken::Space);
1261 }
1262 self.b.unparse_tokens_mode(tokens, spaced);
1263 if self.cache_policy.is_some() {
1264 tokens.push(PtxToken::Comma);
1265 }
1266 if let Some(opt_50) = self.cache_policy.as_ref() {
1267 if spaced {
1268 tokens.push(PtxToken::Space);
1269 }
1270 opt_50.unparse_tokens_mode(tokens, spaced);
1271 }
1272 tokens.push(PtxToken::Semicolon);
1273 if spaced {
1274 tokens.push(PtxToken::Newline);
1275 }
1276 }
1277 }
1278}
1279
1280pub mod section_2 {
1281 use super::*;
1282 use crate::r#type::instruction::atom::section_2::*;
1283
1284 impl PtxUnparser for AtomOpSpaceSemScopeType {
1285 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1286 self.unparse_tokens_mode(tokens, false);
1287 }
1288 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
1289 push_opcode(tokens, "atom");
1290 match &self.op {
1291 Op::Exch => {
1292 push_directive(tokens, "exch");
1293 }
1294 Op::And => {
1295 push_directive(tokens, "and");
1296 }
1297 Op::Xor => {
1298 push_directive(tokens, "xor");
1299 }
1300 Op::Cas => {
1301 push_directive(tokens, "cas");
1302 }
1303 Op::Add => {
1304 push_directive(tokens, "add");
1305 }
1306 Op::Inc => {
1307 push_directive(tokens, "inc");
1308 }
1309 Op::Dec => {
1310 push_directive(tokens, "dec");
1311 }
1312 Op::Min => {
1313 push_directive(tokens, "min");
1314 }
1315 Op::Max => {
1316 push_directive(tokens, "max");
1317 }
1318 Op::Or => {
1319 push_directive(tokens, "or");
1320 }
1321 }
1322 if let Some(space_51) = self.space.as_ref() {
1323 match space_51 {
1324 Space::SharedCluster => {
1325 push_directive(tokens, "shared::cluster");
1326 }
1327 Space::SharedCta => {
1328 push_directive(tokens, "shared::cta");
1329 }
1330 Space::Global => {
1331 push_directive(tokens, "global");
1332 }
1333 Space::Shared => {
1334 push_directive(tokens, "shared");
1335 }
1336 }
1337 }
1338 if let Some(sem_52) = self.sem.as_ref() {
1339 match sem_52 {
1340 Sem::Relaxed => {
1341 push_directive(tokens, "relaxed");
1342 }
1343 Sem::Acquire => {
1344 push_directive(tokens, "acquire");
1345 }
1346 Sem::Release => {
1347 push_directive(tokens, "release");
1348 }
1349 Sem::AcqRel => {
1350 push_directive(tokens, "acq_rel");
1351 }
1352 }
1353 }
1354 if let Some(scope_53) = self.scope.as_ref() {
1355 match scope_53 {
1356 Scope::Cluster => {
1357 push_directive(tokens, "cluster");
1358 }
1359 Scope::Cta => {
1360 push_directive(tokens, "cta");
1361 }
1362 Scope::Gpu => {
1363 push_directive(tokens, "gpu");
1364 }
1365 Scope::Sys => {
1366 push_directive(tokens, "sys");
1367 }
1368 }
1369 }
1370 match &self.type_ {
1371 Type::B32 => {
1372 push_directive(tokens, "b32");
1373 }
1374 Type::B64 => {
1375 push_directive(tokens, "b64");
1376 }
1377 Type::U32 => {
1378 push_directive(tokens, "u32");
1379 }
1380 Type::U64 => {
1381 push_directive(tokens, "u64");
1382 }
1383 Type::S32 => {
1384 push_directive(tokens, "s32");
1385 }
1386 Type::S64 => {
1387 push_directive(tokens, "s64");
1388 }
1389 Type::F32 => {
1390 push_directive(tokens, "f32");
1391 }
1392 Type::F64 => {
1393 push_directive(tokens, "f64");
1394 }
1395 }
1396 if spaced {
1397 tokens.push(PtxToken::Space);
1398 }
1399 self.d.unparse_tokens_mode(tokens, spaced);
1400 tokens.push(PtxToken::Comma);
1401 if spaced {
1402 tokens.push(PtxToken::Space);
1403 }
1404 self.a.unparse_tokens_mode(tokens, spaced);
1405 tokens.push(PtxToken::Comma);
1406 if spaced {
1407 tokens.push(PtxToken::Space);
1408 }
1409 self.b.unparse_tokens_mode(tokens, spaced);
1410 tokens.push(PtxToken::Semicolon);
1411 if spaced {
1412 tokens.push(PtxToken::Newline);
1413 }
1414 }
1415 }
1416
1417 impl PtxUnparser for AtomOpSpaceSemScopeType1 {
1418 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1419 self.unparse_tokens_mode(tokens, false);
1420 }
1421 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
1422 push_opcode(tokens, "atom");
1423 match &self.op {
1424 Op::Exch => {
1425 push_directive(tokens, "exch");
1426 }
1427 Op::And => {
1428 push_directive(tokens, "and");
1429 }
1430 Op::Xor => {
1431 push_directive(tokens, "xor");
1432 }
1433 Op::Cas => {
1434 push_directive(tokens, "cas");
1435 }
1436 Op::Add => {
1437 push_directive(tokens, "add");
1438 }
1439 Op::Inc => {
1440 push_directive(tokens, "inc");
1441 }
1442 Op::Dec => {
1443 push_directive(tokens, "dec");
1444 }
1445 Op::Min => {
1446 push_directive(tokens, "min");
1447 }
1448 Op::Max => {
1449 push_directive(tokens, "max");
1450 }
1451 Op::Or => {
1452 push_directive(tokens, "or");
1453 }
1454 }
1455 if let Some(space_54) = self.space.as_ref() {
1456 match space_54 {
1457 Space::SharedCluster => {
1458 push_directive(tokens, "shared::cluster");
1459 }
1460 Space::SharedCta => {
1461 push_directive(tokens, "shared::cta");
1462 }
1463 Space::Global => {
1464 push_directive(tokens, "global");
1465 }
1466 Space::Shared => {
1467 push_directive(tokens, "shared");
1468 }
1469 }
1470 }
1471 if let Some(sem_55) = self.sem.as_ref() {
1472 match sem_55 {
1473 Sem::Relaxed => {
1474 push_directive(tokens, "relaxed");
1475 }
1476 Sem::Acquire => {
1477 push_directive(tokens, "acquire");
1478 }
1479 Sem::Release => {
1480 push_directive(tokens, "release");
1481 }
1482 Sem::AcqRel => {
1483 push_directive(tokens, "acq_rel");
1484 }
1485 }
1486 }
1487 if let Some(scope_56) = self.scope.as_ref() {
1488 match scope_56 {
1489 Scope::Cluster => {
1490 push_directive(tokens, "cluster");
1491 }
1492 Scope::Cta => {
1493 push_directive(tokens, "cta");
1494 }
1495 Scope::Gpu => {
1496 push_directive(tokens, "gpu");
1497 }
1498 Scope::Sys => {
1499 push_directive(tokens, "sys");
1500 }
1501 }
1502 }
1503 match &self.type_ {
1504 Type::B32 => {
1505 push_directive(tokens, "b32");
1506 }
1507 Type::B64 => {
1508 push_directive(tokens, "b64");
1509 }
1510 Type::U32 => {
1511 push_directive(tokens, "u32");
1512 }
1513 Type::U64 => {
1514 push_directive(tokens, "u64");
1515 }
1516 Type::S32 => {
1517 push_directive(tokens, "s32");
1518 }
1519 Type::S64 => {
1520 push_directive(tokens, "s64");
1521 }
1522 Type::F32 => {
1523 push_directive(tokens, "f32");
1524 }
1525 Type::F64 => {
1526 push_directive(tokens, "f64");
1527 }
1528 }
1529 if spaced {
1530 tokens.push(PtxToken::Space);
1531 }
1532 self.d.unparse_tokens_mode(tokens, spaced);
1533 tokens.push(PtxToken::Comma);
1534 if spaced {
1535 tokens.push(PtxToken::Space);
1536 }
1537 self.a.unparse_tokens_mode(tokens, spaced);
1538 tokens.push(PtxToken::Comma);
1539 if spaced {
1540 tokens.push(PtxToken::Space);
1541 }
1542 self.b.unparse_tokens_mode(tokens, spaced);
1543 tokens.push(PtxToken::Comma);
1544 if spaced {
1545 tokens.push(PtxToken::Space);
1546 }
1547 self.c.unparse_tokens_mode(tokens, spaced);
1548 tokens.push(PtxToken::Semicolon);
1549 if spaced {
1550 tokens.push(PtxToken::Newline);
1551 }
1552 }
1553 }
1554}