1#![allow(unused)]
30
31use crate::lexer::PtxToken;
32use crate::unparser::{PtxUnparser, common::*};
33
34pub mod section_0 {
35 use super::*;
36 use crate::r#type::instruction::red::section_0::*;
37
38 impl PtxUnparser for RedOpSpaceSemScopeLevelCacheHintType {
39 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
40 self.unparse_tokens_mode(tokens, false);
41 }
42 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
43 push_opcode(tokens, "red");
44 match &self.op {
45 Op::And => {
46 push_directive(tokens, "and");
47 }
48 Op::Xor => {
49 push_directive(tokens, "xor");
50 }
51 Op::Add => {
52 push_directive(tokens, "add");
53 }
54 Op::Inc => {
55 push_directive(tokens, "inc");
56 }
57 Op::Dec => {
58 push_directive(tokens, "dec");
59 }
60 Op::Min => {
61 push_directive(tokens, "min");
62 }
63 Op::Max => {
64 push_directive(tokens, "max");
65 }
66 Op::Or => {
67 push_directive(tokens, "or");
68 }
69 }
70 if let Some(space_0) = self.space.as_ref() {
71 match space_0 {
72 Space::SharedCluster => {
73 push_directive(tokens, "shared::cluster");
74 }
75 Space::SharedCta => {
76 push_directive(tokens, "shared::cta");
77 }
78 Space::Global => {
79 push_directive(tokens, "global");
80 }
81 Space::Shared => {
82 push_directive(tokens, "shared");
83 }
84 }
85 }
86 if let Some(sem_1) = self.sem.as_ref() {
87 match sem_1 {
88 Sem::Relaxed => {
89 push_directive(tokens, "relaxed");
90 }
91 Sem::Release => {
92 push_directive(tokens, "release");
93 }
94 }
95 }
96 if let Some(scope_2) = self.scope.as_ref() {
97 match scope_2 {
98 Scope::Cluster => {
99 push_directive(tokens, "cluster");
100 }
101 Scope::Cta => {
102 push_directive(tokens, "cta");
103 }
104 Scope::Gpu => {
105 push_directive(tokens, "gpu");
106 }
107 Scope::Sys => {
108 push_directive(tokens, "sys");
109 }
110 }
111 }
112 if let Some(level_cache_hint_3) = self.level_cache_hint.as_ref() {
113 match level_cache_hint_3 {
114 LevelCacheHint::L2CacheHint => {
115 push_directive(tokens, "L2::cache_hint");
116 }
117 }
118 }
119 match &self.type_ {
120 Type::B32 => {
121 push_directive(tokens, "b32");
122 }
123 Type::B64 => {
124 push_directive(tokens, "b64");
125 }
126 Type::U32 => {
127 push_directive(tokens, "u32");
128 }
129 Type::U64 => {
130 push_directive(tokens, "u64");
131 }
132 Type::S32 => {
133 push_directive(tokens, "s32");
134 }
135 Type::S64 => {
136 push_directive(tokens, "s64");
137 }
138 Type::F32 => {
139 push_directive(tokens, "f32");
140 }
141 Type::F64 => {
142 push_directive(tokens, "f64");
143 }
144 }
145 if spaced {
146 tokens.push(PtxToken::Space);
147 }
148 self.a.unparse_tokens_mode(tokens, spaced);
149 tokens.push(PtxToken::Comma);
150 if spaced {
151 tokens.push(PtxToken::Space);
152 }
153 self.b.unparse_tokens_mode(tokens, spaced);
154 if self.cache_policy.is_some() {
155 tokens.push(PtxToken::Comma);
156 }
157 if let Some(opt_4) = self.cache_policy.as_ref() {
158 if spaced {
159 tokens.push(PtxToken::Space);
160 }
161 opt_4.unparse_tokens_mode(tokens, spaced);
162 }
163 tokens.push(PtxToken::Semicolon);
164 if spaced {
165 tokens.push(PtxToken::Newline);
166 }
167 }
168 }
169
170 impl PtxUnparser for RedAddSpaceSemScopeNoftzLevelCacheHintF16 {
171 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
172 self.unparse_tokens_mode(tokens, false);
173 }
174 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
175 push_opcode(tokens, "red");
176 push_directive(tokens, "add");
177 if let Some(space_5) = self.space.as_ref() {
178 match space_5 {
179 Space::SharedCluster => {
180 push_directive(tokens, "shared::cluster");
181 }
182 Space::SharedCta => {
183 push_directive(tokens, "shared::cta");
184 }
185 Space::Global => {
186 push_directive(tokens, "global");
187 }
188 Space::Shared => {
189 push_directive(tokens, "shared");
190 }
191 }
192 }
193 if let Some(sem_6) = self.sem.as_ref() {
194 match sem_6 {
195 Sem::Relaxed => {
196 push_directive(tokens, "relaxed");
197 }
198 Sem::Release => {
199 push_directive(tokens, "release");
200 }
201 }
202 }
203 if let Some(scope_7) = self.scope.as_ref() {
204 match scope_7 {
205 Scope::Cluster => {
206 push_directive(tokens, "cluster");
207 }
208 Scope::Cta => {
209 push_directive(tokens, "cta");
210 }
211 Scope::Gpu => {
212 push_directive(tokens, "gpu");
213 }
214 Scope::Sys => {
215 push_directive(tokens, "sys");
216 }
217 }
218 }
219 push_directive(tokens, "noftz");
220 if let Some(level_cache_hint_8) = self.level_cache_hint.as_ref() {
221 match level_cache_hint_8 {
222 LevelCacheHint::L2CacheHint => {
223 push_directive(tokens, "L2::cache_hint");
224 }
225 }
226 }
227 push_directive(tokens, "f16");
228 if spaced {
229 tokens.push(PtxToken::Space);
230 }
231 self.a.unparse_tokens_mode(tokens, spaced);
232 tokens.push(PtxToken::Comma);
233 if spaced {
234 tokens.push(PtxToken::Space);
235 }
236 self.b.unparse_tokens_mode(tokens, spaced);
237 if self.cache_policy.is_some() {
238 tokens.push(PtxToken::Comma);
239 }
240 if let Some(opt_9) = self.cache_policy.as_ref() {
241 if spaced {
242 tokens.push(PtxToken::Space);
243 }
244 opt_9.unparse_tokens_mode(tokens, spaced);
245 }
246 tokens.push(PtxToken::Semicolon);
247 if spaced {
248 tokens.push(PtxToken::Newline);
249 }
250 }
251 }
252
253 impl PtxUnparser for RedAddSpaceSemScopeNoftzLevelCacheHintF16x2 {
254 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
255 self.unparse_tokens_mode(tokens, false);
256 }
257 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
258 push_opcode(tokens, "red");
259 push_directive(tokens, "add");
260 if let Some(space_10) = self.space.as_ref() {
261 match space_10 {
262 Space::SharedCluster => {
263 push_directive(tokens, "shared::cluster");
264 }
265 Space::SharedCta => {
266 push_directive(tokens, "shared::cta");
267 }
268 Space::Global => {
269 push_directive(tokens, "global");
270 }
271 Space::Shared => {
272 push_directive(tokens, "shared");
273 }
274 }
275 }
276 if let Some(sem_11) = self.sem.as_ref() {
277 match sem_11 {
278 Sem::Relaxed => {
279 push_directive(tokens, "relaxed");
280 }
281 Sem::Release => {
282 push_directive(tokens, "release");
283 }
284 }
285 }
286 if let Some(scope_12) = self.scope.as_ref() {
287 match scope_12 {
288 Scope::Cluster => {
289 push_directive(tokens, "cluster");
290 }
291 Scope::Cta => {
292 push_directive(tokens, "cta");
293 }
294 Scope::Gpu => {
295 push_directive(tokens, "gpu");
296 }
297 Scope::Sys => {
298 push_directive(tokens, "sys");
299 }
300 }
301 }
302 push_directive(tokens, "noftz");
303 if let Some(level_cache_hint_13) = self.level_cache_hint.as_ref() {
304 match level_cache_hint_13 {
305 LevelCacheHint::L2CacheHint => {
306 push_directive(tokens, "L2::cache_hint");
307 }
308 }
309 }
310 push_directive(tokens, "f16x2");
311 if spaced {
312 tokens.push(PtxToken::Space);
313 }
314 self.a.unparse_tokens_mode(tokens, spaced);
315 tokens.push(PtxToken::Comma);
316 if spaced {
317 tokens.push(PtxToken::Space);
318 }
319 self.b.unparse_tokens_mode(tokens, spaced);
320 if self.cache_policy.is_some() {
321 tokens.push(PtxToken::Comma);
322 }
323 if let Some(opt_14) = self.cache_policy.as_ref() {
324 if spaced {
325 tokens.push(PtxToken::Space);
326 }
327 opt_14.unparse_tokens_mode(tokens, spaced);
328 }
329 tokens.push(PtxToken::Semicolon);
330 if spaced {
331 tokens.push(PtxToken::Newline);
332 }
333 }
334 }
335
336 impl PtxUnparser for RedAddSpaceSemScopeNoftzLevelCacheHintBf16 {
337 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
338 self.unparse_tokens_mode(tokens, false);
339 }
340 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
341 push_opcode(tokens, "red");
342 push_directive(tokens, "add");
343 if let Some(space_15) = self.space.as_ref() {
344 match space_15 {
345 Space::SharedCluster => {
346 push_directive(tokens, "shared::cluster");
347 }
348 Space::SharedCta => {
349 push_directive(tokens, "shared::cta");
350 }
351 Space::Global => {
352 push_directive(tokens, "global");
353 }
354 Space::Shared => {
355 push_directive(tokens, "shared");
356 }
357 }
358 }
359 if let Some(sem_16) = self.sem.as_ref() {
360 match sem_16 {
361 Sem::Relaxed => {
362 push_directive(tokens, "relaxed");
363 }
364 Sem::Release => {
365 push_directive(tokens, "release");
366 }
367 }
368 }
369 if let Some(scope_17) = self.scope.as_ref() {
370 match scope_17 {
371 Scope::Cluster => {
372 push_directive(tokens, "cluster");
373 }
374 Scope::Cta => {
375 push_directive(tokens, "cta");
376 }
377 Scope::Gpu => {
378 push_directive(tokens, "gpu");
379 }
380 Scope::Sys => {
381 push_directive(tokens, "sys");
382 }
383 }
384 }
385 push_directive(tokens, "noftz");
386 if let Some(level_cache_hint_18) = self.level_cache_hint.as_ref() {
387 match level_cache_hint_18 {
388 LevelCacheHint::L2CacheHint => {
389 push_directive(tokens, "L2::cache_hint");
390 }
391 }
392 }
393 push_directive(tokens, "bf16");
394 if spaced {
395 tokens.push(PtxToken::Space);
396 }
397 self.a.unparse_tokens_mode(tokens, spaced);
398 tokens.push(PtxToken::Comma);
399 if spaced {
400 tokens.push(PtxToken::Space);
401 }
402 self.b.unparse_tokens_mode(tokens, spaced);
403 if self.cache_policy.is_some() {
404 tokens.push(PtxToken::Comma);
405 }
406 if let Some(opt_19) = self.cache_policy.as_ref() {
407 if spaced {
408 tokens.push(PtxToken::Space);
409 }
410 opt_19.unparse_tokens_mode(tokens, spaced);
411 }
412 tokens.push(PtxToken::Semicolon);
413 if spaced {
414 tokens.push(PtxToken::Newline);
415 }
416 }
417 }
418
419 impl PtxUnparser for RedAddSpaceSemScopeNoftzLevelCacheHintBf16x2 {
420 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
421 self.unparse_tokens_mode(tokens, false);
422 }
423 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
424 push_opcode(tokens, "red");
425 push_directive(tokens, "add");
426 if let Some(space_20) = self.space.as_ref() {
427 match space_20 {
428 Space::SharedCluster => {
429 push_directive(tokens, "shared::cluster");
430 }
431 Space::SharedCta => {
432 push_directive(tokens, "shared::cta");
433 }
434 Space::Global => {
435 push_directive(tokens, "global");
436 }
437 Space::Shared => {
438 push_directive(tokens, "shared");
439 }
440 }
441 }
442 if let Some(sem_21) = self.sem.as_ref() {
443 match sem_21 {
444 Sem::Relaxed => {
445 push_directive(tokens, "relaxed");
446 }
447 Sem::Release => {
448 push_directive(tokens, "release");
449 }
450 }
451 }
452 if let Some(scope_22) = self.scope.as_ref() {
453 match scope_22 {
454 Scope::Cluster => {
455 push_directive(tokens, "cluster");
456 }
457 Scope::Cta => {
458 push_directive(tokens, "cta");
459 }
460 Scope::Gpu => {
461 push_directive(tokens, "gpu");
462 }
463 Scope::Sys => {
464 push_directive(tokens, "sys");
465 }
466 }
467 }
468 push_directive(tokens, "noftz");
469 if let Some(level_cache_hint_23) = self.level_cache_hint.as_ref() {
470 match level_cache_hint_23 {
471 LevelCacheHint::L2CacheHint => {
472 push_directive(tokens, "L2::cache_hint");
473 }
474 }
475 }
476 push_directive(tokens, "bf16x2");
477 if spaced {
478 tokens.push(PtxToken::Space);
479 }
480 self.a.unparse_tokens_mode(tokens, spaced);
481 tokens.push(PtxToken::Comma);
482 if spaced {
483 tokens.push(PtxToken::Space);
484 }
485 self.b.unparse_tokens_mode(tokens, spaced);
486 if self.cache_policy.is_some() {
487 tokens.push(PtxToken::Comma);
488 }
489 if let Some(opt_24) = self.cache_policy.as_ref() {
490 if spaced {
491 tokens.push(PtxToken::Space);
492 }
493 opt_24.unparse_tokens_mode(tokens, spaced);
494 }
495 tokens.push(PtxToken::Semicolon);
496 if spaced {
497 tokens.push(PtxToken::Newline);
498 }
499 }
500 }
501}
502
503pub mod section_1 {
504 use super::*;
505 use crate::r#type::instruction::red::section_1::*;
506
507 impl PtxUnparser for RedAddSpaceSemScopeLevelCacheHintVec32BitF32 {
508 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
509 self.unparse_tokens_mode(tokens, false);
510 }
511 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
512 push_opcode(tokens, "red");
513 push_directive(tokens, "add");
514 if let Some(space_25) = self.space.as_ref() {
515 match space_25 {
516 Space::SharedCluster => {
517 push_directive(tokens, "shared::cluster");
518 }
519 Space::SharedCta => {
520 push_directive(tokens, "shared::cta");
521 }
522 Space::Global => {
523 push_directive(tokens, "global");
524 }
525 Space::Shared => {
526 push_directive(tokens, "shared");
527 }
528 }
529 }
530 if let Some(sem_26) = self.sem.as_ref() {
531 match sem_26 {
532 Sem::Relaxed => {
533 push_directive(tokens, "relaxed");
534 }
535 Sem::Release => {
536 push_directive(tokens, "release");
537 }
538 }
539 }
540 if let Some(scope_27) = self.scope.as_ref() {
541 match scope_27 {
542 Scope::Cluster => {
543 push_directive(tokens, "cluster");
544 }
545 Scope::Cta => {
546 push_directive(tokens, "cta");
547 }
548 Scope::Gpu => {
549 push_directive(tokens, "gpu");
550 }
551 Scope::Sys => {
552 push_directive(tokens, "sys");
553 }
554 }
555 }
556 if let Some(level_cache_hint_28) = self.level_cache_hint.as_ref() {
557 match level_cache_hint_28 {
558 LevelCacheHint::L2CacheHint => {
559 push_directive(tokens, "L2::cache_hint");
560 }
561 }
562 }
563 match &self.vec_32_bit {
564 Vec32Bit::V2 => {
565 push_directive(tokens, "v2");
566 }
567 Vec32Bit::V4 => {
568 push_directive(tokens, "v4");
569 }
570 }
571 push_directive(tokens, "f32");
572 if spaced {
573 tokens.push(PtxToken::Space);
574 }
575 self.a.unparse_tokens_mode(tokens, spaced);
576 tokens.push(PtxToken::Comma);
577 if spaced {
578 tokens.push(PtxToken::Space);
579 }
580 self.b.unparse_tokens_mode(tokens, spaced);
581 if self.cache_policy.is_some() {
582 tokens.push(PtxToken::Comma);
583 }
584 if let Some(opt_29) = self.cache_policy.as_ref() {
585 if spaced {
586 tokens.push(PtxToken::Space);
587 }
588 opt_29.unparse_tokens_mode(tokens, spaced);
589 }
590 tokens.push(PtxToken::Semicolon);
591 if spaced {
592 tokens.push(PtxToken::Newline);
593 }
594 }
595 }
596
597 impl PtxUnparser for RedOpSpaceSemScopeNoftzLevelCacheHintVec16BitHalfWordType {
598 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
599 self.unparse_tokens_mode(tokens, false);
600 }
601 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
602 push_opcode(tokens, "red");
603 match &self.op {
604 Op::Add => {
605 push_directive(tokens, "add");
606 }
607 Op::Min => {
608 push_directive(tokens, "min");
609 }
610 Op::Max => {
611 push_directive(tokens, "max");
612 }
613 }
614 if let Some(space_30) = self.space.as_ref() {
615 match space_30 {
616 Space::SharedCluster => {
617 push_directive(tokens, "shared::cluster");
618 }
619 Space::SharedCta => {
620 push_directive(tokens, "shared::cta");
621 }
622 Space::Global => {
623 push_directive(tokens, "global");
624 }
625 Space::Shared => {
626 push_directive(tokens, "shared");
627 }
628 }
629 }
630 if let Some(sem_31) = self.sem.as_ref() {
631 match sem_31 {
632 Sem::Relaxed => {
633 push_directive(tokens, "relaxed");
634 }
635 Sem::Release => {
636 push_directive(tokens, "release");
637 }
638 }
639 }
640 if let Some(scope_32) = self.scope.as_ref() {
641 match scope_32 {
642 Scope::Cluster => {
643 push_directive(tokens, "cluster");
644 }
645 Scope::Cta => {
646 push_directive(tokens, "cta");
647 }
648 Scope::Gpu => {
649 push_directive(tokens, "gpu");
650 }
651 Scope::Sys => {
652 push_directive(tokens, "sys");
653 }
654 }
655 }
656 push_directive(tokens, "noftz");
657 if let Some(level_cache_hint_33) = self.level_cache_hint.as_ref() {
658 match level_cache_hint_33 {
659 LevelCacheHint::L2CacheHint => {
660 push_directive(tokens, "L2::cache_hint");
661 }
662 }
663 }
664 match &self.vec_16_bit {
665 Vec16Bit::V2 => {
666 push_directive(tokens, "v2");
667 }
668 Vec16Bit::V4 => {
669 push_directive(tokens, "v4");
670 }
671 Vec16Bit::V8 => {
672 push_directive(tokens, "v8");
673 }
674 }
675 match &self.half_word_type {
676 HalfWordType::Bf16 => {
677 push_directive(tokens, "bf16");
678 }
679 HalfWordType::F16 => {
680 push_directive(tokens, "f16");
681 }
682 }
683 if spaced {
684 tokens.push(PtxToken::Space);
685 }
686 self.a.unparse_tokens_mode(tokens, spaced);
687 tokens.push(PtxToken::Comma);
688 if spaced {
689 tokens.push(PtxToken::Space);
690 }
691 self.b.unparse_tokens_mode(tokens, spaced);
692 if self.cache_policy.is_some() {
693 tokens.push(PtxToken::Comma);
694 }
695 if let Some(opt_34) = self.cache_policy.as_ref() {
696 if spaced {
697 tokens.push(PtxToken::Space);
698 }
699 opt_34.unparse_tokens_mode(tokens, spaced);
700 }
701 tokens.push(PtxToken::Semicolon);
702 if spaced {
703 tokens.push(PtxToken::Newline);
704 }
705 }
706 }
707
708 impl PtxUnparser for RedOpSpaceSemScopeNoftzLevelCacheHintVec32BitPackedType {
709 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
710 self.unparse_tokens_mode(tokens, false);
711 }
712 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
713 push_opcode(tokens, "red");
714 match &self.op {
715 Op::Add => {
716 push_directive(tokens, "add");
717 }
718 Op::Min => {
719 push_directive(tokens, "min");
720 }
721 Op::Max => {
722 push_directive(tokens, "max");
723 }
724 }
725 if let Some(space_35) = self.space.as_ref() {
726 match space_35 {
727 Space::SharedCluster => {
728 push_directive(tokens, "shared::cluster");
729 }
730 Space::SharedCta => {
731 push_directive(tokens, "shared::cta");
732 }
733 Space::Global => {
734 push_directive(tokens, "global");
735 }
736 Space::Shared => {
737 push_directive(tokens, "shared");
738 }
739 }
740 }
741 if let Some(sem_36) = self.sem.as_ref() {
742 match sem_36 {
743 Sem::Relaxed => {
744 push_directive(tokens, "relaxed");
745 }
746 Sem::Release => {
747 push_directive(tokens, "release");
748 }
749 }
750 }
751 if let Some(scope_37) = self.scope.as_ref() {
752 match scope_37 {
753 Scope::Cluster => {
754 push_directive(tokens, "cluster");
755 }
756 Scope::Cta => {
757 push_directive(tokens, "cta");
758 }
759 Scope::Gpu => {
760 push_directive(tokens, "gpu");
761 }
762 Scope::Sys => {
763 push_directive(tokens, "sys");
764 }
765 }
766 }
767 push_directive(tokens, "noftz");
768 if let Some(level_cache_hint_38) = self.level_cache_hint.as_ref() {
769 match level_cache_hint_38 {
770 LevelCacheHint::L2CacheHint => {
771 push_directive(tokens, "L2::cache_hint");
772 }
773 }
774 }
775 match &self.vec_32_bit {
776 Vec32Bit::V2 => {
777 push_directive(tokens, "v2");
778 }
779 Vec32Bit::V4 => {
780 push_directive(tokens, "v4");
781 }
782 }
783 match &self.packed_type {
784 PackedType::Bf16x2 => {
785 push_directive(tokens, "bf16x2");
786 }
787 PackedType::F16x2 => {
788 push_directive(tokens, "f16x2");
789 }
790 }
791 if spaced {
792 tokens.push(PtxToken::Space);
793 }
794 self.a.unparse_tokens_mode(tokens, spaced);
795 tokens.push(PtxToken::Comma);
796 if spaced {
797 tokens.push(PtxToken::Space);
798 }
799 self.b.unparse_tokens_mode(tokens, spaced);
800 if self.cache_policy.is_some() {
801 tokens.push(PtxToken::Comma);
802 }
803 if let Some(opt_39) = self.cache_policy.as_ref() {
804 if spaced {
805 tokens.push(PtxToken::Space);
806 }
807 opt_39.unparse_tokens_mode(tokens, spaced);
808 }
809 tokens.push(PtxToken::Semicolon);
810 if spaced {
811 tokens.push(PtxToken::Newline);
812 }
813 }
814 }
815}