ptx_parser/unparser/instruction/
set.rs

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