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