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