ptx_parser/unparser/instruction/
vop.rs

1//! Original PTX specification:
2//!
3//! // 32-bit scalar operation, with optional secondary operation
4//! vop.dtype.atype.btype{.sat}       d, a{.asel}, b{.bsel};
5//! vop.dtype.atype.btype{.sat}.op2   d, a{.asel}, b{.bsel}, c;
6//! // 32-bit scalar operation, with optional data merge
7//! vop.dtype.atype.btype{.sat}  d.dsel, a{.asel}, b{.bsel}, c;
8//! vop   = { vadd, vsub, vabsdiff, vmin, vmax };
9//! .dtype = .atype = .btype = { .u32, .s32 };
10//! .dsel  = .asel  = .bsel  = { .b0, .b1, .b2, .b3, .h0, .h1 };
11//! .op2   = { .add, .min, .max };
12
13#![allow(unused)]
14
15use crate::lexer::PtxToken;
16use crate::unparser::{PtxUnparser, common::*};
17
18pub mod section_0 {
19    use super::*;
20    use crate::r#type::instruction::vop::section_0::*;
21
22    impl PtxUnparser for VaddDtypeAtypeBtypeSat {
23        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
24            push_opcode(tokens, "vadd");
25                    match &self.dtype {
26                            Dtype::U32 => {
27                                    push_directive(tokens, "u32");
28                            }
29                            Dtype::S32 => {
30                                    push_directive(tokens, "s32");
31                            }
32                    }
33                    match &self.atype {
34                            Atype::U32 => {
35                                    push_directive(tokens, "u32");
36                            }
37                            Atype::S32 => {
38                                    push_directive(tokens, "s32");
39                            }
40                    }
41                    match &self.btype {
42                            Btype::U32 => {
43                                    push_directive(tokens, "u32");
44                            }
45                            Btype::S32 => {
46                                    push_directive(tokens, "s32");
47                            }
48                    }
49                    if self.sat {
50                            push_directive(tokens, "sat");
51                    }
52                    self.d.unparse_tokens(tokens);
53            tokens.push(PtxToken::Comma);
54                    self.a.unparse_tokens(tokens);
55                    if let Some(asel_0) = self.asel.as_ref() {
56                            match asel_0 {
57                                    Asel::B0 => {
58                                            push_directive(tokens, "b0");
59                                    }
60                                    Asel::B1 => {
61                                            push_directive(tokens, "b1");
62                                    }
63                                    Asel::B2 => {
64                                            push_directive(tokens, "b2");
65                                    }
66                                    Asel::B3 => {
67                                            push_directive(tokens, "b3");
68                                    }
69                                    Asel::H0 => {
70                                            push_directive(tokens, "h0");
71                                    }
72                                    Asel::H1 => {
73                                            push_directive(tokens, "h1");
74                                    }
75                            }
76                    }
77            tokens.push(PtxToken::Comma);
78                    self.b.unparse_tokens(tokens);
79                    if let Some(bsel_1) = self.bsel.as_ref() {
80                            match bsel_1 {
81                                    Bsel::B0 => {
82                                            push_directive(tokens, "b0");
83                                    }
84                                    Bsel::B1 => {
85                                            push_directive(tokens, "b1");
86                                    }
87                                    Bsel::B2 => {
88                                            push_directive(tokens, "b2");
89                                    }
90                                    Bsel::B3 => {
91                                            push_directive(tokens, "b3");
92                                    }
93                                    Bsel::H0 => {
94                                            push_directive(tokens, "h0");
95                                    }
96                                    Bsel::H1 => {
97                                            push_directive(tokens, "h1");
98                                    }
99                            }
100                    }
101            tokens.push(PtxToken::Semicolon);
102        }
103    }
104
105    impl PtxUnparser for VsubDtypeAtypeBtypeSat {
106        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
107            push_opcode(tokens, "vsub");
108                    match &self.dtype {
109                            Dtype::U32 => {
110                                    push_directive(tokens, "u32");
111                            }
112                            Dtype::S32 => {
113                                    push_directive(tokens, "s32");
114                            }
115                    }
116                    match &self.atype {
117                            Atype::U32 => {
118                                    push_directive(tokens, "u32");
119                            }
120                            Atype::S32 => {
121                                    push_directive(tokens, "s32");
122                            }
123                    }
124                    match &self.btype {
125                            Btype::U32 => {
126                                    push_directive(tokens, "u32");
127                            }
128                            Btype::S32 => {
129                                    push_directive(tokens, "s32");
130                            }
131                    }
132                    if self.sat {
133                            push_directive(tokens, "sat");
134                    }
135                    self.d.unparse_tokens(tokens);
136            tokens.push(PtxToken::Comma);
137                    self.a.unparse_tokens(tokens);
138                    if let Some(asel_2) = self.asel.as_ref() {
139                            match asel_2 {
140                                    Asel::B0 => {
141                                            push_directive(tokens, "b0");
142                                    }
143                                    Asel::B1 => {
144                                            push_directive(tokens, "b1");
145                                    }
146                                    Asel::B2 => {
147                                            push_directive(tokens, "b2");
148                                    }
149                                    Asel::B3 => {
150                                            push_directive(tokens, "b3");
151                                    }
152                                    Asel::H0 => {
153                                            push_directive(tokens, "h0");
154                                    }
155                                    Asel::H1 => {
156                                            push_directive(tokens, "h1");
157                                    }
158                            }
159                    }
160            tokens.push(PtxToken::Comma);
161                    self.b.unparse_tokens(tokens);
162                    if let Some(bsel_3) = self.bsel.as_ref() {
163                            match bsel_3 {
164                                    Bsel::B0 => {
165                                            push_directive(tokens, "b0");
166                                    }
167                                    Bsel::B1 => {
168                                            push_directive(tokens, "b1");
169                                    }
170                                    Bsel::B2 => {
171                                            push_directive(tokens, "b2");
172                                    }
173                                    Bsel::B3 => {
174                                            push_directive(tokens, "b3");
175                                    }
176                                    Bsel::H0 => {
177                                            push_directive(tokens, "h0");
178                                    }
179                                    Bsel::H1 => {
180                                            push_directive(tokens, "h1");
181                                    }
182                            }
183                    }
184            tokens.push(PtxToken::Semicolon);
185        }
186    }
187
188    impl PtxUnparser for VabsdiffDtypeAtypeBtypeSat {
189        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
190            push_opcode(tokens, "vabsdiff");
191                    match &self.dtype {
192                            Dtype::U32 => {
193                                    push_directive(tokens, "u32");
194                            }
195                            Dtype::S32 => {
196                                    push_directive(tokens, "s32");
197                            }
198                    }
199                    match &self.atype {
200                            Atype::U32 => {
201                                    push_directive(tokens, "u32");
202                            }
203                            Atype::S32 => {
204                                    push_directive(tokens, "s32");
205                            }
206                    }
207                    match &self.btype {
208                            Btype::U32 => {
209                                    push_directive(tokens, "u32");
210                            }
211                            Btype::S32 => {
212                                    push_directive(tokens, "s32");
213                            }
214                    }
215                    if self.sat {
216                            push_directive(tokens, "sat");
217                    }
218                    self.d.unparse_tokens(tokens);
219            tokens.push(PtxToken::Comma);
220                    self.a.unparse_tokens(tokens);
221                    if let Some(asel_4) = self.asel.as_ref() {
222                            match asel_4 {
223                                    Asel::B0 => {
224                                            push_directive(tokens, "b0");
225                                    }
226                                    Asel::B1 => {
227                                            push_directive(tokens, "b1");
228                                    }
229                                    Asel::B2 => {
230                                            push_directive(tokens, "b2");
231                                    }
232                                    Asel::B3 => {
233                                            push_directive(tokens, "b3");
234                                    }
235                                    Asel::H0 => {
236                                            push_directive(tokens, "h0");
237                                    }
238                                    Asel::H1 => {
239                                            push_directive(tokens, "h1");
240                                    }
241                            }
242                    }
243            tokens.push(PtxToken::Comma);
244                    self.b.unparse_tokens(tokens);
245                    if let Some(bsel_5) = self.bsel.as_ref() {
246                            match bsel_5 {
247                                    Bsel::B0 => {
248                                            push_directive(tokens, "b0");
249                                    }
250                                    Bsel::B1 => {
251                                            push_directive(tokens, "b1");
252                                    }
253                                    Bsel::B2 => {
254                                            push_directive(tokens, "b2");
255                                    }
256                                    Bsel::B3 => {
257                                            push_directive(tokens, "b3");
258                                    }
259                                    Bsel::H0 => {
260                                            push_directive(tokens, "h0");
261                                    }
262                                    Bsel::H1 => {
263                                            push_directive(tokens, "h1");
264                                    }
265                            }
266                    }
267            tokens.push(PtxToken::Semicolon);
268        }
269    }
270
271    impl PtxUnparser for VminDtypeAtypeBtypeSat {
272        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
273            push_opcode(tokens, "vmin");
274                    match &self.dtype {
275                            Dtype::U32 => {
276                                    push_directive(tokens, "u32");
277                            }
278                            Dtype::S32 => {
279                                    push_directive(tokens, "s32");
280                            }
281                    }
282                    match &self.atype {
283                            Atype::U32 => {
284                                    push_directive(tokens, "u32");
285                            }
286                            Atype::S32 => {
287                                    push_directive(tokens, "s32");
288                            }
289                    }
290                    match &self.btype {
291                            Btype::U32 => {
292                                    push_directive(tokens, "u32");
293                            }
294                            Btype::S32 => {
295                                    push_directive(tokens, "s32");
296                            }
297                    }
298                    if self.sat {
299                            push_directive(tokens, "sat");
300                    }
301                    self.d.unparse_tokens(tokens);
302            tokens.push(PtxToken::Comma);
303                    self.a.unparse_tokens(tokens);
304                    if let Some(asel_6) = self.asel.as_ref() {
305                            match asel_6 {
306                                    Asel::B0 => {
307                                            push_directive(tokens, "b0");
308                                    }
309                                    Asel::B1 => {
310                                            push_directive(tokens, "b1");
311                                    }
312                                    Asel::B2 => {
313                                            push_directive(tokens, "b2");
314                                    }
315                                    Asel::B3 => {
316                                            push_directive(tokens, "b3");
317                                    }
318                                    Asel::H0 => {
319                                            push_directive(tokens, "h0");
320                                    }
321                                    Asel::H1 => {
322                                            push_directive(tokens, "h1");
323                                    }
324                            }
325                    }
326            tokens.push(PtxToken::Comma);
327                    self.b.unparse_tokens(tokens);
328                    if let Some(bsel_7) = self.bsel.as_ref() {
329                            match bsel_7 {
330                                    Bsel::B0 => {
331                                            push_directive(tokens, "b0");
332                                    }
333                                    Bsel::B1 => {
334                                            push_directive(tokens, "b1");
335                                    }
336                                    Bsel::B2 => {
337                                            push_directive(tokens, "b2");
338                                    }
339                                    Bsel::B3 => {
340                                            push_directive(tokens, "b3");
341                                    }
342                                    Bsel::H0 => {
343                                            push_directive(tokens, "h0");
344                                    }
345                                    Bsel::H1 => {
346                                            push_directive(tokens, "h1");
347                                    }
348                            }
349                    }
350            tokens.push(PtxToken::Semicolon);
351        }
352    }
353
354    impl PtxUnparser for VmaxDtypeAtypeBtypeSat {
355        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
356            push_opcode(tokens, "vmax");
357                    match &self.dtype {
358                            Dtype::U32 => {
359                                    push_directive(tokens, "u32");
360                            }
361                            Dtype::S32 => {
362                                    push_directive(tokens, "s32");
363                            }
364                    }
365                    match &self.atype {
366                            Atype::U32 => {
367                                    push_directive(tokens, "u32");
368                            }
369                            Atype::S32 => {
370                                    push_directive(tokens, "s32");
371                            }
372                    }
373                    match &self.btype {
374                            Btype::U32 => {
375                                    push_directive(tokens, "u32");
376                            }
377                            Btype::S32 => {
378                                    push_directive(tokens, "s32");
379                            }
380                    }
381                    if self.sat {
382                            push_directive(tokens, "sat");
383                    }
384                    self.d.unparse_tokens(tokens);
385            tokens.push(PtxToken::Comma);
386                    self.a.unparse_tokens(tokens);
387                    if let Some(asel_8) = self.asel.as_ref() {
388                            match asel_8 {
389                                    Asel::B0 => {
390                                            push_directive(tokens, "b0");
391                                    }
392                                    Asel::B1 => {
393                                            push_directive(tokens, "b1");
394                                    }
395                                    Asel::B2 => {
396                                            push_directive(tokens, "b2");
397                                    }
398                                    Asel::B3 => {
399                                            push_directive(tokens, "b3");
400                                    }
401                                    Asel::H0 => {
402                                            push_directive(tokens, "h0");
403                                    }
404                                    Asel::H1 => {
405                                            push_directive(tokens, "h1");
406                                    }
407                            }
408                    }
409            tokens.push(PtxToken::Comma);
410                    self.b.unparse_tokens(tokens);
411                    if let Some(bsel_9) = self.bsel.as_ref() {
412                            match bsel_9 {
413                                    Bsel::B0 => {
414                                            push_directive(tokens, "b0");
415                                    }
416                                    Bsel::B1 => {
417                                            push_directive(tokens, "b1");
418                                    }
419                                    Bsel::B2 => {
420                                            push_directive(tokens, "b2");
421                                    }
422                                    Bsel::B3 => {
423                                            push_directive(tokens, "b3");
424                                    }
425                                    Bsel::H0 => {
426                                            push_directive(tokens, "h0");
427                                    }
428                                    Bsel::H1 => {
429                                            push_directive(tokens, "h1");
430                                    }
431                            }
432                    }
433            tokens.push(PtxToken::Semicolon);
434        }
435    }
436
437    impl PtxUnparser for VaddDtypeAtypeBtypeSatOp2 {
438        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
439            push_opcode(tokens, "vadd");
440                    match &self.dtype {
441                            Dtype::U32 => {
442                                    push_directive(tokens, "u32");
443                            }
444                            Dtype::S32 => {
445                                    push_directive(tokens, "s32");
446                            }
447                    }
448                    match &self.atype {
449                            Atype::U32 => {
450                                    push_directive(tokens, "u32");
451                            }
452                            Atype::S32 => {
453                                    push_directive(tokens, "s32");
454                            }
455                    }
456                    match &self.btype {
457                            Btype::U32 => {
458                                    push_directive(tokens, "u32");
459                            }
460                            Btype::S32 => {
461                                    push_directive(tokens, "s32");
462                            }
463                    }
464                    if self.sat {
465                            push_directive(tokens, "sat");
466                    }
467                    match &self.op2 {
468                            Op2::Add => {
469                                    push_directive(tokens, "add");
470                            }
471                            Op2::Min => {
472                                    push_directive(tokens, "min");
473                            }
474                            Op2::Max => {
475                                    push_directive(tokens, "max");
476                            }
477                    }
478                    self.d.unparse_tokens(tokens);
479            tokens.push(PtxToken::Comma);
480                    self.a.unparse_tokens(tokens);
481                    if let Some(asel_10) = self.asel.as_ref() {
482                            match asel_10 {
483                                    Asel::B0 => {
484                                            push_directive(tokens, "b0");
485                                    }
486                                    Asel::B1 => {
487                                            push_directive(tokens, "b1");
488                                    }
489                                    Asel::B2 => {
490                                            push_directive(tokens, "b2");
491                                    }
492                                    Asel::B3 => {
493                                            push_directive(tokens, "b3");
494                                    }
495                                    Asel::H0 => {
496                                            push_directive(tokens, "h0");
497                                    }
498                                    Asel::H1 => {
499                                            push_directive(tokens, "h1");
500                                    }
501                            }
502                    }
503            tokens.push(PtxToken::Comma);
504                    self.b.unparse_tokens(tokens);
505                    if let Some(bsel_11) = self.bsel.as_ref() {
506                            match bsel_11 {
507                                    Bsel::B0 => {
508                                            push_directive(tokens, "b0");
509                                    }
510                                    Bsel::B1 => {
511                                            push_directive(tokens, "b1");
512                                    }
513                                    Bsel::B2 => {
514                                            push_directive(tokens, "b2");
515                                    }
516                                    Bsel::B3 => {
517                                            push_directive(tokens, "b3");
518                                    }
519                                    Bsel::H0 => {
520                                            push_directive(tokens, "h0");
521                                    }
522                                    Bsel::H1 => {
523                                            push_directive(tokens, "h1");
524                                    }
525                            }
526                    }
527            tokens.push(PtxToken::Comma);
528                    self.c.unparse_tokens(tokens);
529            tokens.push(PtxToken::Semicolon);
530        }
531    }
532
533    impl PtxUnparser for VsubDtypeAtypeBtypeSatOp2 {
534        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
535            push_opcode(tokens, "vsub");
536                    match &self.dtype {
537                            Dtype::U32 => {
538                                    push_directive(tokens, "u32");
539                            }
540                            Dtype::S32 => {
541                                    push_directive(tokens, "s32");
542                            }
543                    }
544                    match &self.atype {
545                            Atype::U32 => {
546                                    push_directive(tokens, "u32");
547                            }
548                            Atype::S32 => {
549                                    push_directive(tokens, "s32");
550                            }
551                    }
552                    match &self.btype {
553                            Btype::U32 => {
554                                    push_directive(tokens, "u32");
555                            }
556                            Btype::S32 => {
557                                    push_directive(tokens, "s32");
558                            }
559                    }
560                    if self.sat {
561                            push_directive(tokens, "sat");
562                    }
563                    match &self.op2 {
564                            Op2::Add => {
565                                    push_directive(tokens, "add");
566                            }
567                            Op2::Min => {
568                                    push_directive(tokens, "min");
569                            }
570                            Op2::Max => {
571                                    push_directive(tokens, "max");
572                            }
573                    }
574                    self.d.unparse_tokens(tokens);
575            tokens.push(PtxToken::Comma);
576                    self.a.unparse_tokens(tokens);
577                    if let Some(asel_12) = self.asel.as_ref() {
578                            match asel_12 {
579                                    Asel::B0 => {
580                                            push_directive(tokens, "b0");
581                                    }
582                                    Asel::B1 => {
583                                            push_directive(tokens, "b1");
584                                    }
585                                    Asel::B2 => {
586                                            push_directive(tokens, "b2");
587                                    }
588                                    Asel::B3 => {
589                                            push_directive(tokens, "b3");
590                                    }
591                                    Asel::H0 => {
592                                            push_directive(tokens, "h0");
593                                    }
594                                    Asel::H1 => {
595                                            push_directive(tokens, "h1");
596                                    }
597                            }
598                    }
599            tokens.push(PtxToken::Comma);
600                    self.b.unparse_tokens(tokens);
601                    if let Some(bsel_13) = self.bsel.as_ref() {
602                            match bsel_13 {
603                                    Bsel::B0 => {
604                                            push_directive(tokens, "b0");
605                                    }
606                                    Bsel::B1 => {
607                                            push_directive(tokens, "b1");
608                                    }
609                                    Bsel::B2 => {
610                                            push_directive(tokens, "b2");
611                                    }
612                                    Bsel::B3 => {
613                                            push_directive(tokens, "b3");
614                                    }
615                                    Bsel::H0 => {
616                                            push_directive(tokens, "h0");
617                                    }
618                                    Bsel::H1 => {
619                                            push_directive(tokens, "h1");
620                                    }
621                            }
622                    }
623            tokens.push(PtxToken::Comma);
624                    self.c.unparse_tokens(tokens);
625            tokens.push(PtxToken::Semicolon);
626        }
627    }
628
629    impl PtxUnparser for VabsdiffDtypeAtypeBtypeSatOp2 {
630        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
631            push_opcode(tokens, "vabsdiff");
632                    match &self.dtype {
633                            Dtype::U32 => {
634                                    push_directive(tokens, "u32");
635                            }
636                            Dtype::S32 => {
637                                    push_directive(tokens, "s32");
638                            }
639                    }
640                    match &self.atype {
641                            Atype::U32 => {
642                                    push_directive(tokens, "u32");
643                            }
644                            Atype::S32 => {
645                                    push_directive(tokens, "s32");
646                            }
647                    }
648                    match &self.btype {
649                            Btype::U32 => {
650                                    push_directive(tokens, "u32");
651                            }
652                            Btype::S32 => {
653                                    push_directive(tokens, "s32");
654                            }
655                    }
656                    if self.sat {
657                            push_directive(tokens, "sat");
658                    }
659                    match &self.op2 {
660                            Op2::Add => {
661                                    push_directive(tokens, "add");
662                            }
663                            Op2::Min => {
664                                    push_directive(tokens, "min");
665                            }
666                            Op2::Max => {
667                                    push_directive(tokens, "max");
668                            }
669                    }
670                    self.d.unparse_tokens(tokens);
671            tokens.push(PtxToken::Comma);
672                    self.a.unparse_tokens(tokens);
673                    if let Some(asel_14) = self.asel.as_ref() {
674                            match asel_14 {
675                                    Asel::B0 => {
676                                            push_directive(tokens, "b0");
677                                    }
678                                    Asel::B1 => {
679                                            push_directive(tokens, "b1");
680                                    }
681                                    Asel::B2 => {
682                                            push_directive(tokens, "b2");
683                                    }
684                                    Asel::B3 => {
685                                            push_directive(tokens, "b3");
686                                    }
687                                    Asel::H0 => {
688                                            push_directive(tokens, "h0");
689                                    }
690                                    Asel::H1 => {
691                                            push_directive(tokens, "h1");
692                                    }
693                            }
694                    }
695            tokens.push(PtxToken::Comma);
696                    self.b.unparse_tokens(tokens);
697                    if let Some(bsel_15) = self.bsel.as_ref() {
698                            match bsel_15 {
699                                    Bsel::B0 => {
700                                            push_directive(tokens, "b0");
701                                    }
702                                    Bsel::B1 => {
703                                            push_directive(tokens, "b1");
704                                    }
705                                    Bsel::B2 => {
706                                            push_directive(tokens, "b2");
707                                    }
708                                    Bsel::B3 => {
709                                            push_directive(tokens, "b3");
710                                    }
711                                    Bsel::H0 => {
712                                            push_directive(tokens, "h0");
713                                    }
714                                    Bsel::H1 => {
715                                            push_directive(tokens, "h1");
716                                    }
717                            }
718                    }
719            tokens.push(PtxToken::Comma);
720                    self.c.unparse_tokens(tokens);
721            tokens.push(PtxToken::Semicolon);
722        }
723    }
724
725    impl PtxUnparser for VminDtypeAtypeBtypeSatOp2 {
726        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
727            push_opcode(tokens, "vmin");
728                    match &self.dtype {
729                            Dtype::U32 => {
730                                    push_directive(tokens, "u32");
731                            }
732                            Dtype::S32 => {
733                                    push_directive(tokens, "s32");
734                            }
735                    }
736                    match &self.atype {
737                            Atype::U32 => {
738                                    push_directive(tokens, "u32");
739                            }
740                            Atype::S32 => {
741                                    push_directive(tokens, "s32");
742                            }
743                    }
744                    match &self.btype {
745                            Btype::U32 => {
746                                    push_directive(tokens, "u32");
747                            }
748                            Btype::S32 => {
749                                    push_directive(tokens, "s32");
750                            }
751                    }
752                    if self.sat {
753                            push_directive(tokens, "sat");
754                    }
755                    match &self.op2 {
756                            Op2::Add => {
757                                    push_directive(tokens, "add");
758                            }
759                            Op2::Min => {
760                                    push_directive(tokens, "min");
761                            }
762                            Op2::Max => {
763                                    push_directive(tokens, "max");
764                            }
765                    }
766                    self.d.unparse_tokens(tokens);
767            tokens.push(PtxToken::Comma);
768                    self.a.unparse_tokens(tokens);
769                    if let Some(asel_16) = self.asel.as_ref() {
770                            match asel_16 {
771                                    Asel::B0 => {
772                                            push_directive(tokens, "b0");
773                                    }
774                                    Asel::B1 => {
775                                            push_directive(tokens, "b1");
776                                    }
777                                    Asel::B2 => {
778                                            push_directive(tokens, "b2");
779                                    }
780                                    Asel::B3 => {
781                                            push_directive(tokens, "b3");
782                                    }
783                                    Asel::H0 => {
784                                            push_directive(tokens, "h0");
785                                    }
786                                    Asel::H1 => {
787                                            push_directive(tokens, "h1");
788                                    }
789                            }
790                    }
791            tokens.push(PtxToken::Comma);
792                    self.b.unparse_tokens(tokens);
793                    if let Some(bsel_17) = self.bsel.as_ref() {
794                            match bsel_17 {
795                                    Bsel::B0 => {
796                                            push_directive(tokens, "b0");
797                                    }
798                                    Bsel::B1 => {
799                                            push_directive(tokens, "b1");
800                                    }
801                                    Bsel::B2 => {
802                                            push_directive(tokens, "b2");
803                                    }
804                                    Bsel::B3 => {
805                                            push_directive(tokens, "b3");
806                                    }
807                                    Bsel::H0 => {
808                                            push_directive(tokens, "h0");
809                                    }
810                                    Bsel::H1 => {
811                                            push_directive(tokens, "h1");
812                                    }
813                            }
814                    }
815            tokens.push(PtxToken::Comma);
816                    self.c.unparse_tokens(tokens);
817            tokens.push(PtxToken::Semicolon);
818        }
819    }
820
821    impl PtxUnparser for VmaxDtypeAtypeBtypeSatOp2 {
822        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
823            push_opcode(tokens, "vmax");
824                    match &self.dtype {
825                            Dtype::U32 => {
826                                    push_directive(tokens, "u32");
827                            }
828                            Dtype::S32 => {
829                                    push_directive(tokens, "s32");
830                            }
831                    }
832                    match &self.atype {
833                            Atype::U32 => {
834                                    push_directive(tokens, "u32");
835                            }
836                            Atype::S32 => {
837                                    push_directive(tokens, "s32");
838                            }
839                    }
840                    match &self.btype {
841                            Btype::U32 => {
842                                    push_directive(tokens, "u32");
843                            }
844                            Btype::S32 => {
845                                    push_directive(tokens, "s32");
846                            }
847                    }
848                    if self.sat {
849                            push_directive(tokens, "sat");
850                    }
851                    match &self.op2 {
852                            Op2::Add => {
853                                    push_directive(tokens, "add");
854                            }
855                            Op2::Min => {
856                                    push_directive(tokens, "min");
857                            }
858                            Op2::Max => {
859                                    push_directive(tokens, "max");
860                            }
861                    }
862                    self.d.unparse_tokens(tokens);
863            tokens.push(PtxToken::Comma);
864                    self.a.unparse_tokens(tokens);
865                    if let Some(asel_18) = self.asel.as_ref() {
866                            match asel_18 {
867                                    Asel::B0 => {
868                                            push_directive(tokens, "b0");
869                                    }
870                                    Asel::B1 => {
871                                            push_directive(tokens, "b1");
872                                    }
873                                    Asel::B2 => {
874                                            push_directive(tokens, "b2");
875                                    }
876                                    Asel::B3 => {
877                                            push_directive(tokens, "b3");
878                                    }
879                                    Asel::H0 => {
880                                            push_directive(tokens, "h0");
881                                    }
882                                    Asel::H1 => {
883                                            push_directive(tokens, "h1");
884                                    }
885                            }
886                    }
887            tokens.push(PtxToken::Comma);
888                    self.b.unparse_tokens(tokens);
889                    if let Some(bsel_19) = self.bsel.as_ref() {
890                            match bsel_19 {
891                                    Bsel::B0 => {
892                                            push_directive(tokens, "b0");
893                                    }
894                                    Bsel::B1 => {
895                                            push_directive(tokens, "b1");
896                                    }
897                                    Bsel::B2 => {
898                                            push_directive(tokens, "b2");
899                                    }
900                                    Bsel::B3 => {
901                                            push_directive(tokens, "b3");
902                                    }
903                                    Bsel::H0 => {
904                                            push_directive(tokens, "h0");
905                                    }
906                                    Bsel::H1 => {
907                                            push_directive(tokens, "h1");
908                                    }
909                            }
910                    }
911            tokens.push(PtxToken::Comma);
912                    self.c.unparse_tokens(tokens);
913            tokens.push(PtxToken::Semicolon);
914        }
915    }
916
917    impl PtxUnparser for VaddDtypeAtypeBtypeSat1 {
918        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
919            push_opcode(tokens, "vadd");
920                    match &self.dtype {
921                            Dtype::U32 => {
922                                    push_directive(tokens, "u32");
923                            }
924                            Dtype::S32 => {
925                                    push_directive(tokens, "s32");
926                            }
927                    }
928                    match &self.atype {
929                            Atype::U32 => {
930                                    push_directive(tokens, "u32");
931                            }
932                            Atype::S32 => {
933                                    push_directive(tokens, "s32");
934                            }
935                    }
936                    match &self.btype {
937                            Btype::U32 => {
938                                    push_directive(tokens, "u32");
939                            }
940                            Btype::S32 => {
941                                    push_directive(tokens, "s32");
942                            }
943                    }
944                    if self.sat {
945                            push_directive(tokens, "sat");
946                    }
947                    self.d.unparse_tokens(tokens);
948                    match &self.dsel {
949                            Dsel::B0 => {
950                                    push_directive(tokens, "b0");
951                            }
952                            Dsel::B1 => {
953                                    push_directive(tokens, "b1");
954                            }
955                            Dsel::B2 => {
956                                    push_directive(tokens, "b2");
957                            }
958                            Dsel::B3 => {
959                                    push_directive(tokens, "b3");
960                            }
961                            Dsel::H0 => {
962                                    push_directive(tokens, "h0");
963                            }
964                            Dsel::H1 => {
965                                    push_directive(tokens, "h1");
966                            }
967                    }
968            tokens.push(PtxToken::Comma);
969                    self.a.unparse_tokens(tokens);
970                    if let Some(asel_20) = self.asel.as_ref() {
971                            match asel_20 {
972                                    Asel::B0 => {
973                                            push_directive(tokens, "b0");
974                                    }
975                                    Asel::B1 => {
976                                            push_directive(tokens, "b1");
977                                    }
978                                    Asel::B2 => {
979                                            push_directive(tokens, "b2");
980                                    }
981                                    Asel::B3 => {
982                                            push_directive(tokens, "b3");
983                                    }
984                                    Asel::H0 => {
985                                            push_directive(tokens, "h0");
986                                    }
987                                    Asel::H1 => {
988                                            push_directive(tokens, "h1");
989                                    }
990                            }
991                    }
992            tokens.push(PtxToken::Comma);
993                    self.b.unparse_tokens(tokens);
994                    if let Some(bsel_21) = self.bsel.as_ref() {
995                            match bsel_21 {
996                                    Bsel::B0 => {
997                                            push_directive(tokens, "b0");
998                                    }
999                                    Bsel::B1 => {
1000                                            push_directive(tokens, "b1");
1001                                    }
1002                                    Bsel::B2 => {
1003                                            push_directive(tokens, "b2");
1004                                    }
1005                                    Bsel::B3 => {
1006                                            push_directive(tokens, "b3");
1007                                    }
1008                                    Bsel::H0 => {
1009                                            push_directive(tokens, "h0");
1010                                    }
1011                                    Bsel::H1 => {
1012                                            push_directive(tokens, "h1");
1013                                    }
1014                            }
1015                    }
1016            tokens.push(PtxToken::Comma);
1017                    self.c.unparse_tokens(tokens);
1018            tokens.push(PtxToken::Semicolon);
1019        }
1020    }
1021
1022    impl PtxUnparser for VsubDtypeAtypeBtypeSat1 {
1023        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1024            push_opcode(tokens, "vsub");
1025                    match &self.dtype {
1026                            Dtype::U32 => {
1027                                    push_directive(tokens, "u32");
1028                            }
1029                            Dtype::S32 => {
1030                                    push_directive(tokens, "s32");
1031                            }
1032                    }
1033                    match &self.atype {
1034                            Atype::U32 => {
1035                                    push_directive(tokens, "u32");
1036                            }
1037                            Atype::S32 => {
1038                                    push_directive(tokens, "s32");
1039                            }
1040                    }
1041                    match &self.btype {
1042                            Btype::U32 => {
1043                                    push_directive(tokens, "u32");
1044                            }
1045                            Btype::S32 => {
1046                                    push_directive(tokens, "s32");
1047                            }
1048                    }
1049                    if self.sat {
1050                            push_directive(tokens, "sat");
1051                    }
1052                    self.d.unparse_tokens(tokens);
1053                    match &self.dsel {
1054                            Dsel::B0 => {
1055                                    push_directive(tokens, "b0");
1056                            }
1057                            Dsel::B1 => {
1058                                    push_directive(tokens, "b1");
1059                            }
1060                            Dsel::B2 => {
1061                                    push_directive(tokens, "b2");
1062                            }
1063                            Dsel::B3 => {
1064                                    push_directive(tokens, "b3");
1065                            }
1066                            Dsel::H0 => {
1067                                    push_directive(tokens, "h0");
1068                            }
1069                            Dsel::H1 => {
1070                                    push_directive(tokens, "h1");
1071                            }
1072                    }
1073            tokens.push(PtxToken::Comma);
1074                    self.a.unparse_tokens(tokens);
1075                    if let Some(asel_22) = self.asel.as_ref() {
1076                            match asel_22 {
1077                                    Asel::B0 => {
1078                                            push_directive(tokens, "b0");
1079                                    }
1080                                    Asel::B1 => {
1081                                            push_directive(tokens, "b1");
1082                                    }
1083                                    Asel::B2 => {
1084                                            push_directive(tokens, "b2");
1085                                    }
1086                                    Asel::B3 => {
1087                                            push_directive(tokens, "b3");
1088                                    }
1089                                    Asel::H0 => {
1090                                            push_directive(tokens, "h0");
1091                                    }
1092                                    Asel::H1 => {
1093                                            push_directive(tokens, "h1");
1094                                    }
1095                            }
1096                    }
1097            tokens.push(PtxToken::Comma);
1098                    self.b.unparse_tokens(tokens);
1099                    if let Some(bsel_23) = self.bsel.as_ref() {
1100                            match bsel_23 {
1101                                    Bsel::B0 => {
1102                                            push_directive(tokens, "b0");
1103                                    }
1104                                    Bsel::B1 => {
1105                                            push_directive(tokens, "b1");
1106                                    }
1107                                    Bsel::B2 => {
1108                                            push_directive(tokens, "b2");
1109                                    }
1110                                    Bsel::B3 => {
1111                                            push_directive(tokens, "b3");
1112                                    }
1113                                    Bsel::H0 => {
1114                                            push_directive(tokens, "h0");
1115                                    }
1116                                    Bsel::H1 => {
1117                                            push_directive(tokens, "h1");
1118                                    }
1119                            }
1120                    }
1121            tokens.push(PtxToken::Comma);
1122                    self.c.unparse_tokens(tokens);
1123            tokens.push(PtxToken::Semicolon);
1124        }
1125    }
1126
1127    impl PtxUnparser for VabsdiffDtypeAtypeBtypeSat1 {
1128        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1129            push_opcode(tokens, "vabsdiff");
1130                    match &self.dtype {
1131                            Dtype::U32 => {
1132                                    push_directive(tokens, "u32");
1133                            }
1134                            Dtype::S32 => {
1135                                    push_directive(tokens, "s32");
1136                            }
1137                    }
1138                    match &self.atype {
1139                            Atype::U32 => {
1140                                    push_directive(tokens, "u32");
1141                            }
1142                            Atype::S32 => {
1143                                    push_directive(tokens, "s32");
1144                            }
1145                    }
1146                    match &self.btype {
1147                            Btype::U32 => {
1148                                    push_directive(tokens, "u32");
1149                            }
1150                            Btype::S32 => {
1151                                    push_directive(tokens, "s32");
1152                            }
1153                    }
1154                    if self.sat {
1155                            push_directive(tokens, "sat");
1156                    }
1157                    self.d.unparse_tokens(tokens);
1158                    match &self.dsel {
1159                            Dsel::B0 => {
1160                                    push_directive(tokens, "b0");
1161                            }
1162                            Dsel::B1 => {
1163                                    push_directive(tokens, "b1");
1164                            }
1165                            Dsel::B2 => {
1166                                    push_directive(tokens, "b2");
1167                            }
1168                            Dsel::B3 => {
1169                                    push_directive(tokens, "b3");
1170                            }
1171                            Dsel::H0 => {
1172                                    push_directive(tokens, "h0");
1173                            }
1174                            Dsel::H1 => {
1175                                    push_directive(tokens, "h1");
1176                            }
1177                    }
1178            tokens.push(PtxToken::Comma);
1179                    self.a.unparse_tokens(tokens);
1180                    if let Some(asel_24) = self.asel.as_ref() {
1181                            match asel_24 {
1182                                    Asel::B0 => {
1183                                            push_directive(tokens, "b0");
1184                                    }
1185                                    Asel::B1 => {
1186                                            push_directive(tokens, "b1");
1187                                    }
1188                                    Asel::B2 => {
1189                                            push_directive(tokens, "b2");
1190                                    }
1191                                    Asel::B3 => {
1192                                            push_directive(tokens, "b3");
1193                                    }
1194                                    Asel::H0 => {
1195                                            push_directive(tokens, "h0");
1196                                    }
1197                                    Asel::H1 => {
1198                                            push_directive(tokens, "h1");
1199                                    }
1200                            }
1201                    }
1202            tokens.push(PtxToken::Comma);
1203                    self.b.unparse_tokens(tokens);
1204                    if let Some(bsel_25) = self.bsel.as_ref() {
1205                            match bsel_25 {
1206                                    Bsel::B0 => {
1207                                            push_directive(tokens, "b0");
1208                                    }
1209                                    Bsel::B1 => {
1210                                            push_directive(tokens, "b1");
1211                                    }
1212                                    Bsel::B2 => {
1213                                            push_directive(tokens, "b2");
1214                                    }
1215                                    Bsel::B3 => {
1216                                            push_directive(tokens, "b3");
1217                                    }
1218                                    Bsel::H0 => {
1219                                            push_directive(tokens, "h0");
1220                                    }
1221                                    Bsel::H1 => {
1222                                            push_directive(tokens, "h1");
1223                                    }
1224                            }
1225                    }
1226            tokens.push(PtxToken::Comma);
1227                    self.c.unparse_tokens(tokens);
1228            tokens.push(PtxToken::Semicolon);
1229        }
1230    }
1231
1232    impl PtxUnparser for VminDtypeAtypeBtypeSat1 {
1233        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1234            push_opcode(tokens, "vmin");
1235                    match &self.dtype {
1236                            Dtype::U32 => {
1237                                    push_directive(tokens, "u32");
1238                            }
1239                            Dtype::S32 => {
1240                                    push_directive(tokens, "s32");
1241                            }
1242                    }
1243                    match &self.atype {
1244                            Atype::U32 => {
1245                                    push_directive(tokens, "u32");
1246                            }
1247                            Atype::S32 => {
1248                                    push_directive(tokens, "s32");
1249                            }
1250                    }
1251                    match &self.btype {
1252                            Btype::U32 => {
1253                                    push_directive(tokens, "u32");
1254                            }
1255                            Btype::S32 => {
1256                                    push_directive(tokens, "s32");
1257                            }
1258                    }
1259                    if self.sat {
1260                            push_directive(tokens, "sat");
1261                    }
1262                    self.d.unparse_tokens(tokens);
1263                    match &self.dsel {
1264                            Dsel::B0 => {
1265                                    push_directive(tokens, "b0");
1266                            }
1267                            Dsel::B1 => {
1268                                    push_directive(tokens, "b1");
1269                            }
1270                            Dsel::B2 => {
1271                                    push_directive(tokens, "b2");
1272                            }
1273                            Dsel::B3 => {
1274                                    push_directive(tokens, "b3");
1275                            }
1276                            Dsel::H0 => {
1277                                    push_directive(tokens, "h0");
1278                            }
1279                            Dsel::H1 => {
1280                                    push_directive(tokens, "h1");
1281                            }
1282                    }
1283            tokens.push(PtxToken::Comma);
1284                    self.a.unparse_tokens(tokens);
1285                    if let Some(asel_26) = self.asel.as_ref() {
1286                            match asel_26 {
1287                                    Asel::B0 => {
1288                                            push_directive(tokens, "b0");
1289                                    }
1290                                    Asel::B1 => {
1291                                            push_directive(tokens, "b1");
1292                                    }
1293                                    Asel::B2 => {
1294                                            push_directive(tokens, "b2");
1295                                    }
1296                                    Asel::B3 => {
1297                                            push_directive(tokens, "b3");
1298                                    }
1299                                    Asel::H0 => {
1300                                            push_directive(tokens, "h0");
1301                                    }
1302                                    Asel::H1 => {
1303                                            push_directive(tokens, "h1");
1304                                    }
1305                            }
1306                    }
1307            tokens.push(PtxToken::Comma);
1308                    self.b.unparse_tokens(tokens);
1309                    if let Some(bsel_27) = self.bsel.as_ref() {
1310                            match bsel_27 {
1311                                    Bsel::B0 => {
1312                                            push_directive(tokens, "b0");
1313                                    }
1314                                    Bsel::B1 => {
1315                                            push_directive(tokens, "b1");
1316                                    }
1317                                    Bsel::B2 => {
1318                                            push_directive(tokens, "b2");
1319                                    }
1320                                    Bsel::B3 => {
1321                                            push_directive(tokens, "b3");
1322                                    }
1323                                    Bsel::H0 => {
1324                                            push_directive(tokens, "h0");
1325                                    }
1326                                    Bsel::H1 => {
1327                                            push_directive(tokens, "h1");
1328                                    }
1329                            }
1330                    }
1331            tokens.push(PtxToken::Comma);
1332                    self.c.unparse_tokens(tokens);
1333            tokens.push(PtxToken::Semicolon);
1334        }
1335    }
1336
1337    impl PtxUnparser for VmaxDtypeAtypeBtypeSat1 {
1338        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1339            push_opcode(tokens, "vmax");
1340                    match &self.dtype {
1341                            Dtype::U32 => {
1342                                    push_directive(tokens, "u32");
1343                            }
1344                            Dtype::S32 => {
1345                                    push_directive(tokens, "s32");
1346                            }
1347                    }
1348                    match &self.atype {
1349                            Atype::U32 => {
1350                                    push_directive(tokens, "u32");
1351                            }
1352                            Atype::S32 => {
1353                                    push_directive(tokens, "s32");
1354                            }
1355                    }
1356                    match &self.btype {
1357                            Btype::U32 => {
1358                                    push_directive(tokens, "u32");
1359                            }
1360                            Btype::S32 => {
1361                                    push_directive(tokens, "s32");
1362                            }
1363                    }
1364                    if self.sat {
1365                            push_directive(tokens, "sat");
1366                    }
1367                    self.d.unparse_tokens(tokens);
1368                    match &self.dsel {
1369                            Dsel::B0 => {
1370                                    push_directive(tokens, "b0");
1371                            }
1372                            Dsel::B1 => {
1373                                    push_directive(tokens, "b1");
1374                            }
1375                            Dsel::B2 => {
1376                                    push_directive(tokens, "b2");
1377                            }
1378                            Dsel::B3 => {
1379                                    push_directive(tokens, "b3");
1380                            }
1381                            Dsel::H0 => {
1382                                    push_directive(tokens, "h0");
1383                            }
1384                            Dsel::H1 => {
1385                                    push_directive(tokens, "h1");
1386                            }
1387                    }
1388            tokens.push(PtxToken::Comma);
1389                    self.a.unparse_tokens(tokens);
1390                    if let Some(asel_28) = self.asel.as_ref() {
1391                            match asel_28 {
1392                                    Asel::B0 => {
1393                                            push_directive(tokens, "b0");
1394                                    }
1395                                    Asel::B1 => {
1396                                            push_directive(tokens, "b1");
1397                                    }
1398                                    Asel::B2 => {
1399                                            push_directive(tokens, "b2");
1400                                    }
1401                                    Asel::B3 => {
1402                                            push_directive(tokens, "b3");
1403                                    }
1404                                    Asel::H0 => {
1405                                            push_directive(tokens, "h0");
1406                                    }
1407                                    Asel::H1 => {
1408                                            push_directive(tokens, "h1");
1409                                    }
1410                            }
1411                    }
1412            tokens.push(PtxToken::Comma);
1413                    self.b.unparse_tokens(tokens);
1414                    if let Some(bsel_29) = self.bsel.as_ref() {
1415                            match bsel_29 {
1416                                    Bsel::B0 => {
1417                                            push_directive(tokens, "b0");
1418                                    }
1419                                    Bsel::B1 => {
1420                                            push_directive(tokens, "b1");
1421                                    }
1422                                    Bsel::B2 => {
1423                                            push_directive(tokens, "b2");
1424                                    }
1425                                    Bsel::B3 => {
1426                                            push_directive(tokens, "b3");
1427                                    }
1428                                    Bsel::H0 => {
1429                                            push_directive(tokens, "h0");
1430                                    }
1431                                    Bsel::H1 => {
1432                                            push_directive(tokens, "h1");
1433                                    }
1434                            }
1435                    }
1436            tokens.push(PtxToken::Comma);
1437                    self.c.unparse_tokens(tokens);
1438            tokens.push(PtxToken::Semicolon);
1439        }
1440    }
1441
1442}
1443