1#![allow(unused)]
41
42use crate::lexer::PtxToken;
43use crate::unparser::{PtxUnparser, common::*};
44
45pub mod section_0 {
46 use super::*;
47 use crate::r#type::instruction::cvt::section_0::*;
48
49 impl PtxUnparser for CvtIrndFtzSatDtypeAtype {
50 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
51 push_opcode(tokens, "cvt");
52 if let Some(irnd_0) = self.irnd.as_ref() {
53 match irnd_0 {
54 Irnd::Rni => {
55 push_directive(tokens, "rni");
56 }
57 Irnd::Rzi => {
58 push_directive(tokens, "rzi");
59 }
60 Irnd::Rmi => {
61 push_directive(tokens, "rmi");
62 }
63 Irnd::Rpi => {
64 push_directive(tokens, "rpi");
65 }
66 }
67 }
68 if self.ftz {
69 push_directive(tokens, "ftz");
70 }
71 if self.sat {
72 push_directive(tokens, "sat");
73 }
74 match &self.dtype {
75 Dtype::Bf16 => {
76 push_directive(tokens, "bf16");
77 }
78 Dtype::U16 => {
79 push_directive(tokens, "u16");
80 }
81 Dtype::U32 => {
82 push_directive(tokens, "u32");
83 }
84 Dtype::U64 => {
85 push_directive(tokens, "u64");
86 }
87 Dtype::S16 => {
88 push_directive(tokens, "s16");
89 }
90 Dtype::S32 => {
91 push_directive(tokens, "s32");
92 }
93 Dtype::S64 => {
94 push_directive(tokens, "s64");
95 }
96 Dtype::F16 => {
97 push_directive(tokens, "f16");
98 }
99 Dtype::F32 => {
100 push_directive(tokens, "f32");
101 }
102 Dtype::F64 => {
103 push_directive(tokens, "f64");
104 }
105 Dtype::U8 => {
106 push_directive(tokens, "u8");
107 }
108 Dtype::S8 => {
109 push_directive(tokens, "s8");
110 }
111 }
112 match &self.atype {
113 Atype::Bf16 => {
114 push_directive(tokens, "bf16");
115 }
116 Atype::U16 => {
117 push_directive(tokens, "u16");
118 }
119 Atype::U32 => {
120 push_directive(tokens, "u32");
121 }
122 Atype::U64 => {
123 push_directive(tokens, "u64");
124 }
125 Atype::S16 => {
126 push_directive(tokens, "s16");
127 }
128 Atype::S32 => {
129 push_directive(tokens, "s32");
130 }
131 Atype::S64 => {
132 push_directive(tokens, "s64");
133 }
134 Atype::F16 => {
135 push_directive(tokens, "f16");
136 }
137 Atype::F32 => {
138 push_directive(tokens, "f32");
139 }
140 Atype::F64 => {
141 push_directive(tokens, "f64");
142 }
143 Atype::U8 => {
144 push_directive(tokens, "u8");
145 }
146 Atype::S8 => {
147 push_directive(tokens, "s8");
148 }
149 }
150 self.d.unparse_tokens(tokens);
151 tokens.push(PtxToken::Comma);
152 self.a.unparse_tokens(tokens);
153 tokens.push(PtxToken::Semicolon);
154 }
155 }
156
157 impl PtxUnparser for CvtFrndFtzSatDtypeAtype {
158 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
159 push_opcode(tokens, "cvt");
160 if let Some(frnd_1) = self.frnd.as_ref() {
161 match frnd_1 {
162 Frnd::Rn => {
163 push_directive(tokens, "rn");
164 }
165 Frnd::Rz => {
166 push_directive(tokens, "rz");
167 }
168 Frnd::Rm => {
169 push_directive(tokens, "rm");
170 }
171 Frnd::Rp => {
172 push_directive(tokens, "rp");
173 }
174 }
175 }
176 if self.ftz {
177 push_directive(tokens, "ftz");
178 }
179 if self.sat {
180 push_directive(tokens, "sat");
181 }
182 match &self.dtype {
183 Dtype::Bf16 => {
184 push_directive(tokens, "bf16");
185 }
186 Dtype::U16 => {
187 push_directive(tokens, "u16");
188 }
189 Dtype::U32 => {
190 push_directive(tokens, "u32");
191 }
192 Dtype::U64 => {
193 push_directive(tokens, "u64");
194 }
195 Dtype::S16 => {
196 push_directive(tokens, "s16");
197 }
198 Dtype::S32 => {
199 push_directive(tokens, "s32");
200 }
201 Dtype::S64 => {
202 push_directive(tokens, "s64");
203 }
204 Dtype::F16 => {
205 push_directive(tokens, "f16");
206 }
207 Dtype::F32 => {
208 push_directive(tokens, "f32");
209 }
210 Dtype::F64 => {
211 push_directive(tokens, "f64");
212 }
213 Dtype::U8 => {
214 push_directive(tokens, "u8");
215 }
216 Dtype::S8 => {
217 push_directive(tokens, "s8");
218 }
219 }
220 match &self.atype {
221 Atype::Bf16 => {
222 push_directive(tokens, "bf16");
223 }
224 Atype::U16 => {
225 push_directive(tokens, "u16");
226 }
227 Atype::U32 => {
228 push_directive(tokens, "u32");
229 }
230 Atype::U64 => {
231 push_directive(tokens, "u64");
232 }
233 Atype::S16 => {
234 push_directive(tokens, "s16");
235 }
236 Atype::S32 => {
237 push_directive(tokens, "s32");
238 }
239 Atype::S64 => {
240 push_directive(tokens, "s64");
241 }
242 Atype::F16 => {
243 push_directive(tokens, "f16");
244 }
245 Atype::F32 => {
246 push_directive(tokens, "f32");
247 }
248 Atype::F64 => {
249 push_directive(tokens, "f64");
250 }
251 Atype::U8 => {
252 push_directive(tokens, "u8");
253 }
254 Atype::S8 => {
255 push_directive(tokens, "s8");
256 }
257 }
258 self.d.unparse_tokens(tokens);
259 tokens.push(PtxToken::Comma);
260 self.a.unparse_tokens(tokens);
261 tokens.push(PtxToken::Semicolon);
262 }
263 }
264
265 impl PtxUnparser for CvtFrnd2ReluSatfiniteF16F32 {
266 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
267 push_opcode(tokens, "cvt");
268 match &self.frnd2 {
269 Frnd2::Rn => {
270 push_directive(tokens, "rn");
271 }
272 Frnd2::Rz => {
273 push_directive(tokens, "rz");
274 }
275 }
276 if self.relu {
277 push_directive(tokens, "relu");
278 }
279 if self.satfinite {
280 push_directive(tokens, "satfinite");
281 }
282 push_directive(tokens, "f16");
283 push_directive(tokens, "f32");
284 self.d.unparse_tokens(tokens);
285 tokens.push(PtxToken::Comma);
286 self.a.unparse_tokens(tokens);
287 tokens.push(PtxToken::Semicolon);
288 }
289 }
290
291 impl PtxUnparser for CvtFrnd2ReluSatfiniteF16x2F32 {
292 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
293 push_opcode(tokens, "cvt");
294 match &self.frnd2 {
295 Frnd2::Rn => {
296 push_directive(tokens, "rn");
297 }
298 Frnd2::Rz => {
299 push_directive(tokens, "rz");
300 }
301 }
302 if self.relu {
303 push_directive(tokens, "relu");
304 }
305 if self.satfinite {
306 push_directive(tokens, "satfinite");
307 }
308 push_directive(tokens, "f16x2");
309 push_directive(tokens, "f32");
310 self.d.unparse_tokens(tokens);
311 tokens.push(PtxToken::Comma);
312 self.a.unparse_tokens(tokens);
313 tokens.push(PtxToken::Comma);
314 self.b.unparse_tokens(tokens);
315 tokens.push(PtxToken::Semicolon);
316 }
317 }
318
319 impl PtxUnparser for CvtRsReluSatfiniteF16x2F32 {
320 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
321 push_opcode(tokens, "cvt");
322 push_directive(tokens, "rs");
323 if self.relu {
324 push_directive(tokens, "relu");
325 }
326 if self.satfinite {
327 push_directive(tokens, "satfinite");
328 }
329 push_directive(tokens, "f16x2");
330 push_directive(tokens, "f32");
331 self.d.unparse_tokens(tokens);
332 tokens.push(PtxToken::Comma);
333 self.a.unparse_tokens(tokens);
334 tokens.push(PtxToken::Comma);
335 self.b.unparse_tokens(tokens);
336 tokens.push(PtxToken::Comma);
337 self.rbits.unparse_tokens(tokens);
338 tokens.push(PtxToken::Semicolon);
339 }
340 }
341
342 impl PtxUnparser for CvtFrnd2ReluSatfiniteBf16F32 {
343 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
344 push_opcode(tokens, "cvt");
345 match &self.frnd2 {
346 Frnd2::Rn => {
347 push_directive(tokens, "rn");
348 }
349 Frnd2::Rz => {
350 push_directive(tokens, "rz");
351 }
352 }
353 if self.relu {
354 push_directive(tokens, "relu");
355 }
356 if self.satfinite {
357 push_directive(tokens, "satfinite");
358 }
359 push_directive(tokens, "bf16");
360 push_directive(tokens, "f32");
361 self.d.unparse_tokens(tokens);
362 tokens.push(PtxToken::Comma);
363 self.a.unparse_tokens(tokens);
364 tokens.push(PtxToken::Semicolon);
365 }
366 }
367
368 impl PtxUnparser for CvtFrnd2ReluSatfiniteBf16x2F32 {
369 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
370 push_opcode(tokens, "cvt");
371 match &self.frnd2 {
372 Frnd2::Rn => {
373 push_directive(tokens, "rn");
374 }
375 Frnd2::Rz => {
376 push_directive(tokens, "rz");
377 }
378 }
379 if self.relu {
380 push_directive(tokens, "relu");
381 }
382 if self.satfinite {
383 push_directive(tokens, "satfinite");
384 }
385 push_directive(tokens, "bf16x2");
386 push_directive(tokens, "f32");
387 self.d.unparse_tokens(tokens);
388 tokens.push(PtxToken::Comma);
389 self.a.unparse_tokens(tokens);
390 tokens.push(PtxToken::Comma);
391 self.b.unparse_tokens(tokens);
392 tokens.push(PtxToken::Semicolon);
393 }
394 }
395
396 impl PtxUnparser for CvtRsReluSatfiniteBf16x2F32 {
397 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
398 push_opcode(tokens, "cvt");
399 push_directive(tokens, "rs");
400 if self.relu {
401 push_directive(tokens, "relu");
402 }
403 if self.satfinite {
404 push_directive(tokens, "satfinite");
405 }
406 push_directive(tokens, "bf16x2");
407 push_directive(tokens, "f32");
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.rbits.unparse_tokens(tokens);
415 tokens.push(PtxToken::Semicolon);
416 }
417 }
418
419 impl PtxUnparser for CvtRnaSatfiniteTf32F32 {
420 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
421 push_opcode(tokens, "cvt");
422 push_directive(tokens, "rna");
423 if self.satfinite {
424 push_directive(tokens, "satfinite");
425 }
426 push_directive(tokens, "tf32");
427 push_directive(tokens, "f32");
428 self.d.unparse_tokens(tokens);
429 tokens.push(PtxToken::Comma);
430 self.a.unparse_tokens(tokens);
431 tokens.push(PtxToken::Semicolon);
432 }
433 }
434
435 impl PtxUnparser for CvtFrnd2SatfiniteReluTf32F32 {
436 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
437 push_opcode(tokens, "cvt");
438 match &self.frnd2 {
439 Frnd2::Rn => {
440 push_directive(tokens, "rn");
441 }
442 Frnd2::Rz => {
443 push_directive(tokens, "rz");
444 }
445 }
446 if self.satfinite {
447 push_directive(tokens, "satfinite");
448 }
449 if self.relu {
450 push_directive(tokens, "relu");
451 }
452 push_directive(tokens, "tf32");
453 push_directive(tokens, "f32");
454 self.d.unparse_tokens(tokens);
455 tokens.push(PtxToken::Comma);
456 self.a.unparse_tokens(tokens);
457 tokens.push(PtxToken::Semicolon);
458 }
459 }
460
461 impl PtxUnparser for CvtRnSatfiniteReluF8x2typeF32 {
462 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
463 push_opcode(tokens, "cvt");
464 push_directive(tokens, "rn");
465 push_directive(tokens, "satfinite");
466 if self.relu {
467 push_directive(tokens, "relu");
468 }
469 match &self.f8x2type {
470 F8x2type::E4m3x2 => {
471 push_directive(tokens, "e4m3x2");
472 }
473 F8x2type::E5m2x2 => {
474 push_directive(tokens, "e5m2x2");
475 }
476 }
477 push_directive(tokens, "f32");
478 self.d.unparse_tokens(tokens);
479 tokens.push(PtxToken::Comma);
480 self.a.unparse_tokens(tokens);
481 tokens.push(PtxToken::Comma);
482 self.b.unparse_tokens(tokens);
483 tokens.push(PtxToken::Semicolon);
484 }
485 }
486
487 impl PtxUnparser for CvtRnSatfiniteReluF8x2typeF16x2 {
488 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
489 push_opcode(tokens, "cvt");
490 push_directive(tokens, "rn");
491 push_directive(tokens, "satfinite");
492 if self.relu {
493 push_directive(tokens, "relu");
494 }
495 match &self.f8x2type {
496 F8x2type::E4m3x2 => {
497 push_directive(tokens, "e4m3x2");
498 }
499 F8x2type::E5m2x2 => {
500 push_directive(tokens, "e5m2x2");
501 }
502 }
503 push_directive(tokens, "f16x2");
504 self.d.unparse_tokens(tokens);
505 tokens.push(PtxToken::Comma);
506 self.a.unparse_tokens(tokens);
507 tokens.push(PtxToken::Semicolon);
508 }
509 }
510
511 impl PtxUnparser for CvtRnReluF16x2F8x2type {
512 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
513 push_opcode(tokens, "cvt");
514 push_directive(tokens, "rn");
515 if self.relu {
516 push_directive(tokens, "relu");
517 }
518 push_directive(tokens, "f16x2");
519 match &self.f8x2type {
520 F8x2type::E4m3x2 => {
521 push_directive(tokens, "e4m3x2");
522 }
523 F8x2type::E5m2x2 => {
524 push_directive(tokens, "e5m2x2");
525 }
526 }
527 self.d.unparse_tokens(tokens);
528 tokens.push(PtxToken::Comma);
529 self.a.unparse_tokens(tokens);
530 tokens.push(PtxToken::Semicolon);
531 }
532 }
533
534 impl PtxUnparser for CvtRsReluSatfiniteF8x4typeF32 {
535 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
536 push_opcode(tokens, "cvt");
537 push_directive(tokens, "rs");
538 if self.relu {
539 push_directive(tokens, "relu");
540 }
541 push_directive(tokens, "satfinite");
542 match &self.f8x4type {
543 F8x4type::E4m3x4 => {
544 push_directive(tokens, "e4m3x4");
545 }
546 F8x4type::E5m2x4 => {
547 push_directive(tokens, "e5m2x4");
548 }
549 }
550 push_directive(tokens, "f32");
551 self.d.unparse_tokens(tokens);
552 tokens.push(PtxToken::Comma);
553 self.a.unparse_tokens(tokens);
554 tokens.push(PtxToken::Comma);
555 self.rbits.unparse_tokens(tokens);
556 tokens.push(PtxToken::Semicolon);
557 }
558 }
559
560 impl PtxUnparser for CvtRnSatfiniteReluF4x2typeF32 {
561 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
562 push_opcode(tokens, "cvt");
563 push_directive(tokens, "rn");
564 push_directive(tokens, "satfinite");
565 if self.relu {
566 push_directive(tokens, "relu");
567 }
568 match &self.f4x2type {
569 F4x2type::E2m1x2 => {
570 push_directive(tokens, "e2m1x2");
571 }
572 }
573 push_directive(tokens, "f32");
574 self.d.unparse_tokens(tokens);
575 tokens.push(PtxToken::Comma);
576 self.a.unparse_tokens(tokens);
577 tokens.push(PtxToken::Comma);
578 self.b.unparse_tokens(tokens);
579 tokens.push(PtxToken::Semicolon);
580 }
581 }
582
583 impl PtxUnparser for CvtRnReluF16x2F4x2type {
584 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
585 push_opcode(tokens, "cvt");
586 push_directive(tokens, "rn");
587 if self.relu {
588 push_directive(tokens, "relu");
589 }
590 push_directive(tokens, "f16x2");
591 match &self.f4x2type {
592 F4x2type::E2m1x2 => {
593 push_directive(tokens, "e2m1x2");
594 }
595 }
596 self.d.unparse_tokens(tokens);
597 tokens.push(PtxToken::Comma);
598 self.a.unparse_tokens(tokens);
599 tokens.push(PtxToken::Semicolon);
600 }
601 }
602
603 impl PtxUnparser for CvtRsReluSatfiniteF4x4typeF32 {
604 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
605 push_opcode(tokens, "cvt");
606 push_directive(tokens, "rs");
607 if self.relu {
608 push_directive(tokens, "relu");
609 }
610 push_directive(tokens, "satfinite");
611 match &self.f4x4type {
612 F4x4type::E2m1x4 => {
613 push_directive(tokens, "e2m1x4");
614 }
615 }
616 push_directive(tokens, "f32");
617 self.d.unparse_tokens(tokens);
618 tokens.push(PtxToken::Comma);
619 self.a.unparse_tokens(tokens);
620 tokens.push(PtxToken::Comma);
621 self.rbits.unparse_tokens(tokens);
622 tokens.push(PtxToken::Semicolon);
623 }
624 }
625
626 impl PtxUnparser for CvtRnSatfiniteReluF6x2typeF32 {
627 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
628 push_opcode(tokens, "cvt");
629 push_directive(tokens, "rn");
630 push_directive(tokens, "satfinite");
631 if self.relu {
632 push_directive(tokens, "relu");
633 }
634 match &self.f6x2type {
635 F6x2type::E2m3x2 => {
636 push_directive(tokens, "e2m3x2");
637 }
638 F6x2type::E3m2x2 => {
639 push_directive(tokens, "e3m2x2");
640 }
641 }
642 push_directive(tokens, "f32");
643 self.d.unparse_tokens(tokens);
644 tokens.push(PtxToken::Comma);
645 self.a.unparse_tokens(tokens);
646 tokens.push(PtxToken::Comma);
647 self.b.unparse_tokens(tokens);
648 tokens.push(PtxToken::Semicolon);
649 }
650 }
651
652 impl PtxUnparser for CvtRnReluF16x2F6x2type {
653 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
654 push_opcode(tokens, "cvt");
655 push_directive(tokens, "rn");
656 if self.relu {
657 push_directive(tokens, "relu");
658 }
659 push_directive(tokens, "f16x2");
660 match &self.f6x2type {
661 F6x2type::E2m3x2 => {
662 push_directive(tokens, "e2m3x2");
663 }
664 F6x2type::E3m2x2 => {
665 push_directive(tokens, "e3m2x2");
666 }
667 }
668 self.d.unparse_tokens(tokens);
669 tokens.push(PtxToken::Comma);
670 self.a.unparse_tokens(tokens);
671 tokens.push(PtxToken::Semicolon);
672 }
673 }
674
675 impl PtxUnparser for CvtRsReluSatfiniteF6x4typeF32 {
676 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
677 push_opcode(tokens, "cvt");
678 push_directive(tokens, "rs");
679 if self.relu {
680 push_directive(tokens, "relu");
681 }
682 push_directive(tokens, "satfinite");
683 match &self.f6x4type {
684 F6x4type::E2m3x4 => {
685 push_directive(tokens, "e2m3x4");
686 }
687 F6x4type::E3m2x4 => {
688 push_directive(tokens, "e3m2x4");
689 }
690 }
691 push_directive(tokens, "f32");
692 self.d.unparse_tokens(tokens);
693 tokens.push(PtxToken::Comma);
694 self.a.unparse_tokens(tokens);
695 tokens.push(PtxToken::Comma);
696 self.rbits.unparse_tokens(tokens);
697 tokens.push(PtxToken::Semicolon);
698 }
699 }
700
701 impl PtxUnparser for CvtFrnd3SatfiniteUe8m0x2F32 {
702 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
703 push_opcode(tokens, "cvt");
704 match &self.frnd3 {
705 Frnd3::Rz => {
706 push_directive(tokens, "rz");
707 }
708 Frnd3::Rp => {
709 push_directive(tokens, "rp");
710 }
711 }
712 if self.satfinite {
713 push_directive(tokens, "satfinite");
714 }
715 push_directive(tokens, "ue8m0x2");
716 push_directive(tokens, "f32");
717 self.d.unparse_tokens(tokens);
718 tokens.push(PtxToken::Comma);
719 self.a.unparse_tokens(tokens);
720 tokens.push(PtxToken::Comma);
721 self.b.unparse_tokens(tokens);
722 tokens.push(PtxToken::Semicolon);
723 }
724 }
725
726 impl PtxUnparser for CvtFrnd3SatfiniteUe8m0x2Bf16x2 {
727 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
728 push_opcode(tokens, "cvt");
729 match &self.frnd3 {
730 Frnd3::Rz => {
731 push_directive(tokens, "rz");
732 }
733 Frnd3::Rp => {
734 push_directive(tokens, "rp");
735 }
736 }
737 if self.satfinite {
738 push_directive(tokens, "satfinite");
739 }
740 push_directive(tokens, "ue8m0x2");
741 push_directive(tokens, "bf16x2");
742 self.d.unparse_tokens(tokens);
743 tokens.push(PtxToken::Comma);
744 self.a.unparse_tokens(tokens);
745 tokens.push(PtxToken::Semicolon);
746 }
747 }
748
749 impl PtxUnparser for CvtRnBf16x2Ue8m0x2 {
750 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
751 push_opcode(tokens, "cvt");
752 push_directive(tokens, "rn");
753 push_directive(tokens, "bf16x2");
754 push_directive(tokens, "ue8m0x2");
755 self.d.unparse_tokens(tokens);
756 tokens.push(PtxToken::Comma);
757 self.a.unparse_tokens(tokens);
758 tokens.push(PtxToken::Semicolon);
759 }
760 }
761}