Skip to main content

ptx_parser/unparser/instruction/
ld.rs

1//! Original PTX specification:
2//!
3//! ld{.weak}{.ss}{.cop}{.level::cache_hint}{.level::prefetch_size}{.vec}.type  d, [a]{.unified}{, cache-policy};
4//! ld{.weak}{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.level::prefetch_size}{.vec}.type  d, [a]{.unified}{, cache-policy};
5//! ld.volatile{.ss}{.level::prefetch_size}{.vec}.type  d, [a];
6//! ld.relaxed.scope{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.level::prefetch_size}{.vec}.type  d, [a]{, cache-policy};
7//! ld.acquire.scope{.ss}{.level1::eviction_priority}{.level2::eviction_priority}{.level::cache_hint}{.level::prefetch_size}{.vec}.type  d, [a]{, cache-policy};
8//! ld.mmio.relaxed.sys{.global}.type  d, [a];
9//! .ss =                       { .const, .global, .local, .param::entry, .param::func, .param, .shared, .shared::cta, .shared::cluster};
10//! .cop =                      { .ca, .cg, .cs, .lu, .cv };
11//! .level1::eviction_priority = { .L1::evict_normal, .L1::evict_unchanged, .L1::evict_first, .L1::evict_last, .L1::no_allocate };
12//! .level2::eviction_priority = {.L2::evict_normal, .L2::evict_first, .L2::evict_last};
13//! .level::cache_hint =        { .L2::cache_hint };
14//! .level::prefetch_size =     { .L2::64B, .L2::128B, .L2::256B };
15//! .scope =                    { .cta, .cluster, .gpu, .sys };
16//! .vec =                      { .v2, .v4, .v8 };
17//! .type =                     { .b8, .b16, .b32, .b64, .b128,
18//! .u8, .u16, .u32, .u64,
19//! .s8, .s16, .s32, .s64,
20//! .f32, .f64 };
21
22#![allow(unused)]
23
24use crate::lexer::PtxToken;
25use crate::unparser::{PtxUnparser, common::*};
26
27pub mod section_0 {
28    use super::*;
29    use crate::r#type::instruction::ld::section_0::*;
30
31    impl PtxUnparser for LdWeakSsCopLevelCacheHintLevelPrefetchSizeVecType {
32        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
33            self.unparse_tokens_mode(tokens, false);
34        }
35        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
36            push_opcode(tokens, "ld");
37            if self.weak {
38                push_directive(tokens, "weak");
39            }
40            if let Some(ss_0) = self.ss.as_ref() {
41                match ss_0 {
42                    Ss::SharedCluster => {
43                        push_directive(tokens, "shared::cluster");
44                    }
45                    Ss::ParamEntry => {
46                        push_directive(tokens, "param::entry");
47                    }
48                    Ss::ParamFunc => {
49                        push_directive(tokens, "param::func");
50                    }
51                    Ss::SharedCta => {
52                        push_directive(tokens, "shared::cta");
53                    }
54                    Ss::Global => {
55                        push_directive(tokens, "global");
56                    }
57                    Ss::Shared => {
58                        push_directive(tokens, "shared");
59                    }
60                    Ss::Const => {
61                        push_directive(tokens, "const");
62                    }
63                    Ss::Local => {
64                        push_directive(tokens, "local");
65                    }
66                    Ss::Param => {
67                        push_directive(tokens, "param");
68                    }
69                }
70            }
71            if let Some(cop_1) = self.cop.as_ref() {
72                match cop_1 {
73                    Cop::Ca => {
74                        push_directive(tokens, "ca");
75                    }
76                    Cop::Cg => {
77                        push_directive(tokens, "cg");
78                    }
79                    Cop::Cs => {
80                        push_directive(tokens, "cs");
81                    }
82                    Cop::Lu => {
83                        push_directive(tokens, "lu");
84                    }
85                    Cop::Cv => {
86                        push_directive(tokens, "cv");
87                    }
88                }
89            }
90            if let Some(level_cache_hint_2) = self.level_cache_hint.as_ref() {
91                match level_cache_hint_2 {
92                    LevelCacheHint::L2CacheHint => {
93                        push_directive(tokens, "L2::cache_hint");
94                    }
95                }
96            }
97            if let Some(level_prefetch_size_3) = self.level_prefetch_size.as_ref() {
98                match level_prefetch_size_3 {
99                    LevelPrefetchSize::L2128b => {
100                        push_directive(tokens, "L2::128B");
101                    }
102                    LevelPrefetchSize::L2256b => {
103                        push_directive(tokens, "L2::256B");
104                    }
105                    LevelPrefetchSize::L264b => {
106                        push_directive(tokens, "L2::64B");
107                    }
108                }
109            }
110            if let Some(vec_4) = self.vec.as_ref() {
111                match vec_4 {
112                    Vec::V2 => {
113                        push_directive(tokens, "v2");
114                    }
115                    Vec::V4 => {
116                        push_directive(tokens, "v4");
117                    }
118                    Vec::V8 => {
119                        push_directive(tokens, "v8");
120                    }
121                }
122            }
123            match &self.type_ {
124                Type::B128 => {
125                    push_directive(tokens, "b128");
126                }
127                Type::B16 => {
128                    push_directive(tokens, "b16");
129                }
130                Type::B32 => {
131                    push_directive(tokens, "b32");
132                }
133                Type::B64 => {
134                    push_directive(tokens, "b64");
135                }
136                Type::U16 => {
137                    push_directive(tokens, "u16");
138                }
139                Type::U32 => {
140                    push_directive(tokens, "u32");
141                }
142                Type::U64 => {
143                    push_directive(tokens, "u64");
144                }
145                Type::S16 => {
146                    push_directive(tokens, "s16");
147                }
148                Type::S32 => {
149                    push_directive(tokens, "s32");
150                }
151                Type::S64 => {
152                    push_directive(tokens, "s64");
153                }
154                Type::F32 => {
155                    push_directive(tokens, "f32");
156                }
157                Type::F64 => {
158                    push_directive(tokens, "f64");
159                }
160                Type::B8 => {
161                    push_directive(tokens, "b8");
162                }
163                Type::U8 => {
164                    push_directive(tokens, "u8");
165                }
166                Type::S8 => {
167                    push_directive(tokens, "s8");
168                }
169            }
170            if spaced {
171                tokens.push(PtxToken::Space);
172            }
173            self.d.unparse_tokens_mode(tokens, spaced);
174            tokens.push(PtxToken::Comma);
175            if spaced {
176                tokens.push(PtxToken::Space);
177            }
178            self.a.unparse_tokens_mode(tokens, spaced);
179            if self.unified {
180                push_directive(tokens, "unified");
181            }
182            if self.cache_policy.is_some() {
183                tokens.push(PtxToken::Comma);
184            }
185            if let Some(opt_5) = self.cache_policy.as_ref() {
186                if spaced {
187                    tokens.push(PtxToken::Space);
188                }
189                opt_5.unparse_tokens_mode(tokens, spaced);
190            }
191            tokens.push(PtxToken::Semicolon);
192            if spaced {
193                tokens.push(PtxToken::Newline);
194            }
195        }
196    }
197
198    impl PtxUnparser for LdWeakSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintLevelPrefetchSizeVecType {
199        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
200            self.unparse_tokens_mode(tokens, false);
201        }
202        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
203            push_opcode(tokens, "ld");
204                    if self.weak {
205                            push_directive(tokens, "weak");
206                    }
207                    if let Some(ss_6) = self.ss.as_ref() {
208                            match ss_6 {
209                                    Ss::SharedCluster => {
210                                            push_directive(tokens, "shared::cluster");
211                                    }
212                                    Ss::ParamEntry => {
213                                            push_directive(tokens, "param::entry");
214                                    }
215                                    Ss::ParamFunc => {
216                                            push_directive(tokens, "param::func");
217                                    }
218                                    Ss::SharedCta => {
219                                            push_directive(tokens, "shared::cta");
220                                    }
221                                    Ss::Global => {
222                                            push_directive(tokens, "global");
223                                    }
224                                    Ss::Shared => {
225                                            push_directive(tokens, "shared");
226                                    }
227                                    Ss::Const => {
228                                            push_directive(tokens, "const");
229                                    }
230                                    Ss::Local => {
231                                            push_directive(tokens, "local");
232                                    }
233                                    Ss::Param => {
234                                            push_directive(tokens, "param");
235                                    }
236                            }
237                    }
238                    if let Some(level1_eviction_priority_7) = self.level1_eviction_priority.as_ref() {
239                            match level1_eviction_priority_7 {
240                                    Level1EvictionPriority::L1EvictUnchanged => {
241                                            push_directive(tokens, "L1::evict_unchanged");
242                                    }
243                                    Level1EvictionPriority::L1EvictNormal => {
244                                            push_directive(tokens, "L1::evict_normal");
245                                    }
246                                    Level1EvictionPriority::L1EvictFirst => {
247                                            push_directive(tokens, "L1::evict_first");
248                                    }
249                                    Level1EvictionPriority::L1NoAllocate => {
250                                            push_directive(tokens, "L1::no_allocate");
251                                    }
252                                    Level1EvictionPriority::L1EvictLast => {
253                                            push_directive(tokens, "L1::evict_last");
254                                    }
255                            }
256                    }
257                    if let Some(level2_eviction_priority_8) = self.level2_eviction_priority.as_ref() {
258                            match level2_eviction_priority_8 {
259                                    Level2EvictionPriority::L2EvictNormal => {
260                                            push_directive(tokens, "L2::evict_normal");
261                                    }
262                                    Level2EvictionPriority::L2EvictFirst => {
263                                            push_directive(tokens, "L2::evict_first");
264                                    }
265                                    Level2EvictionPriority::L2EvictLast => {
266                                            push_directive(tokens, "L2::evict_last");
267                                    }
268                            }
269                    }
270                    if let Some(level_cache_hint_9) = self.level_cache_hint.as_ref() {
271                            match level_cache_hint_9 {
272                                    LevelCacheHint::L2CacheHint => {
273                                            push_directive(tokens, "L2::cache_hint");
274                                    }
275                            }
276                    }
277                    if let Some(level_prefetch_size_10) = self.level_prefetch_size.as_ref() {
278                            match level_prefetch_size_10 {
279                                    LevelPrefetchSize::L2128b => {
280                                            push_directive(tokens, "L2::128B");
281                                    }
282                                    LevelPrefetchSize::L2256b => {
283                                            push_directive(tokens, "L2::256B");
284                                    }
285                                    LevelPrefetchSize::L264b => {
286                                            push_directive(tokens, "L2::64B");
287                                    }
288                            }
289                    }
290                    if let Some(vec_11) = self.vec.as_ref() {
291                            match vec_11 {
292                                    Vec::V2 => {
293                                            push_directive(tokens, "v2");
294                                    }
295                                    Vec::V4 => {
296                                            push_directive(tokens, "v4");
297                                    }
298                                    Vec::V8 => {
299                                            push_directive(tokens, "v8");
300                                    }
301                            }
302                    }
303                    match &self.type_ {
304                            Type::B128 => {
305                                    push_directive(tokens, "b128");
306                            }
307                            Type::B16 => {
308                                    push_directive(tokens, "b16");
309                            }
310                            Type::B32 => {
311                                    push_directive(tokens, "b32");
312                            }
313                            Type::B64 => {
314                                    push_directive(tokens, "b64");
315                            }
316                            Type::U16 => {
317                                    push_directive(tokens, "u16");
318                            }
319                            Type::U32 => {
320                                    push_directive(tokens, "u32");
321                            }
322                            Type::U64 => {
323                                    push_directive(tokens, "u64");
324                            }
325                            Type::S16 => {
326                                    push_directive(tokens, "s16");
327                            }
328                            Type::S32 => {
329                                    push_directive(tokens, "s32");
330                            }
331                            Type::S64 => {
332                                    push_directive(tokens, "s64");
333                            }
334                            Type::F32 => {
335                                    push_directive(tokens, "f32");
336                            }
337                            Type::F64 => {
338                                    push_directive(tokens, "f64");
339                            }
340                            Type::B8 => {
341                                    push_directive(tokens, "b8");
342                            }
343                            Type::U8 => {
344                                    push_directive(tokens, "u8");
345                            }
346                            Type::S8 => {
347                                    push_directive(tokens, "s8");
348                            }
349                    }
350                    if spaced { tokens.push(PtxToken::Space); }
351                    self.d.unparse_tokens_mode(tokens, spaced);
352            tokens.push(PtxToken::Comma);
353                    if spaced { tokens.push(PtxToken::Space); }
354                    self.a.unparse_tokens_mode(tokens, spaced);
355                    if self.unified {
356                            push_directive(tokens, "unified");
357                    }
358            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
359                    if let Some(opt_12) = self.cache_policy.as_ref() {
360                        if spaced { tokens.push(PtxToken::Space); }
361                        opt_12.unparse_tokens_mode(tokens, spaced);
362                    }
363            tokens.push(PtxToken::Semicolon);
364            if spaced { tokens.push(PtxToken::Newline); }
365        }
366    }
367
368    impl PtxUnparser for LdVolatileSsLevelPrefetchSizeVecType {
369        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
370            self.unparse_tokens_mode(tokens, false);
371        }
372        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
373            push_opcode(tokens, "ld");
374            push_directive(tokens, "volatile");
375            if let Some(ss_13) = self.ss.as_ref() {
376                match ss_13 {
377                    Ss::SharedCluster => {
378                        push_directive(tokens, "shared::cluster");
379                    }
380                    Ss::ParamEntry => {
381                        push_directive(tokens, "param::entry");
382                    }
383                    Ss::ParamFunc => {
384                        push_directive(tokens, "param::func");
385                    }
386                    Ss::SharedCta => {
387                        push_directive(tokens, "shared::cta");
388                    }
389                    Ss::Global => {
390                        push_directive(tokens, "global");
391                    }
392                    Ss::Shared => {
393                        push_directive(tokens, "shared");
394                    }
395                    Ss::Const => {
396                        push_directive(tokens, "const");
397                    }
398                    Ss::Local => {
399                        push_directive(tokens, "local");
400                    }
401                    Ss::Param => {
402                        push_directive(tokens, "param");
403                    }
404                }
405            }
406            if let Some(level_prefetch_size_14) = self.level_prefetch_size.as_ref() {
407                match level_prefetch_size_14 {
408                    LevelPrefetchSize::L2128b => {
409                        push_directive(tokens, "L2::128B");
410                    }
411                    LevelPrefetchSize::L2256b => {
412                        push_directive(tokens, "L2::256B");
413                    }
414                    LevelPrefetchSize::L264b => {
415                        push_directive(tokens, "L2::64B");
416                    }
417                }
418            }
419            if let Some(vec_15) = self.vec.as_ref() {
420                match vec_15 {
421                    Vec::V2 => {
422                        push_directive(tokens, "v2");
423                    }
424                    Vec::V4 => {
425                        push_directive(tokens, "v4");
426                    }
427                    Vec::V8 => {
428                        push_directive(tokens, "v8");
429                    }
430                }
431            }
432            match &self.type_ {
433                Type::B128 => {
434                    push_directive(tokens, "b128");
435                }
436                Type::B16 => {
437                    push_directive(tokens, "b16");
438                }
439                Type::B32 => {
440                    push_directive(tokens, "b32");
441                }
442                Type::B64 => {
443                    push_directive(tokens, "b64");
444                }
445                Type::U16 => {
446                    push_directive(tokens, "u16");
447                }
448                Type::U32 => {
449                    push_directive(tokens, "u32");
450                }
451                Type::U64 => {
452                    push_directive(tokens, "u64");
453                }
454                Type::S16 => {
455                    push_directive(tokens, "s16");
456                }
457                Type::S32 => {
458                    push_directive(tokens, "s32");
459                }
460                Type::S64 => {
461                    push_directive(tokens, "s64");
462                }
463                Type::F32 => {
464                    push_directive(tokens, "f32");
465                }
466                Type::F64 => {
467                    push_directive(tokens, "f64");
468                }
469                Type::B8 => {
470                    push_directive(tokens, "b8");
471                }
472                Type::U8 => {
473                    push_directive(tokens, "u8");
474                }
475                Type::S8 => {
476                    push_directive(tokens, "s8");
477                }
478            }
479            if spaced {
480                tokens.push(PtxToken::Space);
481            }
482            self.d.unparse_tokens_mode(tokens, spaced);
483            tokens.push(PtxToken::Comma);
484            if spaced {
485                tokens.push(PtxToken::Space);
486            }
487            self.a.unparse_tokens_mode(tokens, spaced);
488            tokens.push(PtxToken::Semicolon);
489            if spaced {
490                tokens.push(PtxToken::Newline);
491            }
492        }
493    }
494
495    impl PtxUnparser for LdRelaxedScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintLevelPrefetchSizeVecType {
496        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
497            self.unparse_tokens_mode(tokens, false);
498        }
499        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
500            push_opcode(tokens, "ld");
501                    push_directive(tokens, "relaxed");
502                    match &self.scope {
503                            Scope::Cluster => {
504                                    push_directive(tokens, "cluster");
505                            }
506                            Scope::Cta => {
507                                    push_directive(tokens, "cta");
508                            }
509                            Scope::Gpu => {
510                                    push_directive(tokens, "gpu");
511                            }
512                            Scope::Sys => {
513                                    push_directive(tokens, "sys");
514                            }
515                    }
516                    if let Some(ss_16) = self.ss.as_ref() {
517                            match ss_16 {
518                                    Ss::SharedCluster => {
519                                            push_directive(tokens, "shared::cluster");
520                                    }
521                                    Ss::ParamEntry => {
522                                            push_directive(tokens, "param::entry");
523                                    }
524                                    Ss::ParamFunc => {
525                                            push_directive(tokens, "param::func");
526                                    }
527                                    Ss::SharedCta => {
528                                            push_directive(tokens, "shared::cta");
529                                    }
530                                    Ss::Global => {
531                                            push_directive(tokens, "global");
532                                    }
533                                    Ss::Shared => {
534                                            push_directive(tokens, "shared");
535                                    }
536                                    Ss::Const => {
537                                            push_directive(tokens, "const");
538                                    }
539                                    Ss::Local => {
540                                            push_directive(tokens, "local");
541                                    }
542                                    Ss::Param => {
543                                            push_directive(tokens, "param");
544                                    }
545                            }
546                    }
547                    if let Some(level1_eviction_priority_17) = self.level1_eviction_priority.as_ref() {
548                            match level1_eviction_priority_17 {
549                                    Level1EvictionPriority::L1EvictUnchanged => {
550                                            push_directive(tokens, "L1::evict_unchanged");
551                                    }
552                                    Level1EvictionPriority::L1EvictNormal => {
553                                            push_directive(tokens, "L1::evict_normal");
554                                    }
555                                    Level1EvictionPriority::L1EvictFirst => {
556                                            push_directive(tokens, "L1::evict_first");
557                                    }
558                                    Level1EvictionPriority::L1NoAllocate => {
559                                            push_directive(tokens, "L1::no_allocate");
560                                    }
561                                    Level1EvictionPriority::L1EvictLast => {
562                                            push_directive(tokens, "L1::evict_last");
563                                    }
564                            }
565                    }
566                    if let Some(level2_eviction_priority_18) = self.level2_eviction_priority.as_ref() {
567                            match level2_eviction_priority_18 {
568                                    Level2EvictionPriority::L2EvictNormal => {
569                                            push_directive(tokens, "L2::evict_normal");
570                                    }
571                                    Level2EvictionPriority::L2EvictFirst => {
572                                            push_directive(tokens, "L2::evict_first");
573                                    }
574                                    Level2EvictionPriority::L2EvictLast => {
575                                            push_directive(tokens, "L2::evict_last");
576                                    }
577                            }
578                    }
579                    if let Some(level_cache_hint_19) = self.level_cache_hint.as_ref() {
580                            match level_cache_hint_19 {
581                                    LevelCacheHint::L2CacheHint => {
582                                            push_directive(tokens, "L2::cache_hint");
583                                    }
584                            }
585                    }
586                    if let Some(level_prefetch_size_20) = self.level_prefetch_size.as_ref() {
587                            match level_prefetch_size_20 {
588                                    LevelPrefetchSize::L2128b => {
589                                            push_directive(tokens, "L2::128B");
590                                    }
591                                    LevelPrefetchSize::L2256b => {
592                                            push_directive(tokens, "L2::256B");
593                                    }
594                                    LevelPrefetchSize::L264b => {
595                                            push_directive(tokens, "L2::64B");
596                                    }
597                            }
598                    }
599                    if let Some(vec_21) = self.vec.as_ref() {
600                            match vec_21 {
601                                    Vec::V2 => {
602                                            push_directive(tokens, "v2");
603                                    }
604                                    Vec::V4 => {
605                                            push_directive(tokens, "v4");
606                                    }
607                                    Vec::V8 => {
608                                            push_directive(tokens, "v8");
609                                    }
610                            }
611                    }
612                    match &self.type_ {
613                            Type::B128 => {
614                                    push_directive(tokens, "b128");
615                            }
616                            Type::B16 => {
617                                    push_directive(tokens, "b16");
618                            }
619                            Type::B32 => {
620                                    push_directive(tokens, "b32");
621                            }
622                            Type::B64 => {
623                                    push_directive(tokens, "b64");
624                            }
625                            Type::U16 => {
626                                    push_directive(tokens, "u16");
627                            }
628                            Type::U32 => {
629                                    push_directive(tokens, "u32");
630                            }
631                            Type::U64 => {
632                                    push_directive(tokens, "u64");
633                            }
634                            Type::S16 => {
635                                    push_directive(tokens, "s16");
636                            }
637                            Type::S32 => {
638                                    push_directive(tokens, "s32");
639                            }
640                            Type::S64 => {
641                                    push_directive(tokens, "s64");
642                            }
643                            Type::F32 => {
644                                    push_directive(tokens, "f32");
645                            }
646                            Type::F64 => {
647                                    push_directive(tokens, "f64");
648                            }
649                            Type::B8 => {
650                                    push_directive(tokens, "b8");
651                            }
652                            Type::U8 => {
653                                    push_directive(tokens, "u8");
654                            }
655                            Type::S8 => {
656                                    push_directive(tokens, "s8");
657                            }
658                    }
659                    if spaced { tokens.push(PtxToken::Space); }
660                    self.d.unparse_tokens_mode(tokens, spaced);
661            tokens.push(PtxToken::Comma);
662                    if spaced { tokens.push(PtxToken::Space); }
663                    self.a.unparse_tokens_mode(tokens, spaced);
664            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
665                    if let Some(opt_22) = self.cache_policy.as_ref() {
666                        if spaced { tokens.push(PtxToken::Space); }
667                        opt_22.unparse_tokens_mode(tokens, spaced);
668                    }
669            tokens.push(PtxToken::Semicolon);
670            if spaced { tokens.push(PtxToken::Newline); }
671        }
672    }
673
674    impl PtxUnparser for LdAcquireScopeSsLevel1EvictionPriorityLevel2EvictionPriorityLevelCacheHintLevelPrefetchSizeVecType {
675        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
676            self.unparse_tokens_mode(tokens, false);
677        }
678        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
679            push_opcode(tokens, "ld");
680                    push_directive(tokens, "acquire");
681                    match &self.scope {
682                            Scope::Cluster => {
683                                    push_directive(tokens, "cluster");
684                            }
685                            Scope::Cta => {
686                                    push_directive(tokens, "cta");
687                            }
688                            Scope::Gpu => {
689                                    push_directive(tokens, "gpu");
690                            }
691                            Scope::Sys => {
692                                    push_directive(tokens, "sys");
693                            }
694                    }
695                    if let Some(ss_23) = self.ss.as_ref() {
696                            match ss_23 {
697                                    Ss::SharedCluster => {
698                                            push_directive(tokens, "shared::cluster");
699                                    }
700                                    Ss::ParamEntry => {
701                                            push_directive(tokens, "param::entry");
702                                    }
703                                    Ss::ParamFunc => {
704                                            push_directive(tokens, "param::func");
705                                    }
706                                    Ss::SharedCta => {
707                                            push_directive(tokens, "shared::cta");
708                                    }
709                                    Ss::Global => {
710                                            push_directive(tokens, "global");
711                                    }
712                                    Ss::Shared => {
713                                            push_directive(tokens, "shared");
714                                    }
715                                    Ss::Const => {
716                                            push_directive(tokens, "const");
717                                    }
718                                    Ss::Local => {
719                                            push_directive(tokens, "local");
720                                    }
721                                    Ss::Param => {
722                                            push_directive(tokens, "param");
723                                    }
724                            }
725                    }
726                    if let Some(level1_eviction_priority_24) = self.level1_eviction_priority.as_ref() {
727                            match level1_eviction_priority_24 {
728                                    Level1EvictionPriority::L1EvictUnchanged => {
729                                            push_directive(tokens, "L1::evict_unchanged");
730                                    }
731                                    Level1EvictionPriority::L1EvictNormal => {
732                                            push_directive(tokens, "L1::evict_normal");
733                                    }
734                                    Level1EvictionPriority::L1EvictFirst => {
735                                            push_directive(tokens, "L1::evict_first");
736                                    }
737                                    Level1EvictionPriority::L1NoAllocate => {
738                                            push_directive(tokens, "L1::no_allocate");
739                                    }
740                                    Level1EvictionPriority::L1EvictLast => {
741                                            push_directive(tokens, "L1::evict_last");
742                                    }
743                            }
744                    }
745                    if let Some(level2_eviction_priority_25) = self.level2_eviction_priority.as_ref() {
746                            match level2_eviction_priority_25 {
747                                    Level2EvictionPriority::L2EvictNormal => {
748                                            push_directive(tokens, "L2::evict_normal");
749                                    }
750                                    Level2EvictionPriority::L2EvictFirst => {
751                                            push_directive(tokens, "L2::evict_first");
752                                    }
753                                    Level2EvictionPriority::L2EvictLast => {
754                                            push_directive(tokens, "L2::evict_last");
755                                    }
756                            }
757                    }
758                    if let Some(level_cache_hint_26) = self.level_cache_hint.as_ref() {
759                            match level_cache_hint_26 {
760                                    LevelCacheHint::L2CacheHint => {
761                                            push_directive(tokens, "L2::cache_hint");
762                                    }
763                            }
764                    }
765                    if let Some(level_prefetch_size_27) = self.level_prefetch_size.as_ref() {
766                            match level_prefetch_size_27 {
767                                    LevelPrefetchSize::L2128b => {
768                                            push_directive(tokens, "L2::128B");
769                                    }
770                                    LevelPrefetchSize::L2256b => {
771                                            push_directive(tokens, "L2::256B");
772                                    }
773                                    LevelPrefetchSize::L264b => {
774                                            push_directive(tokens, "L2::64B");
775                                    }
776                            }
777                    }
778                    if let Some(vec_28) = self.vec.as_ref() {
779                            match vec_28 {
780                                    Vec::V2 => {
781                                            push_directive(tokens, "v2");
782                                    }
783                                    Vec::V4 => {
784                                            push_directive(tokens, "v4");
785                                    }
786                                    Vec::V8 => {
787                                            push_directive(tokens, "v8");
788                                    }
789                            }
790                    }
791                    match &self.type_ {
792                            Type::B128 => {
793                                    push_directive(tokens, "b128");
794                            }
795                            Type::B16 => {
796                                    push_directive(tokens, "b16");
797                            }
798                            Type::B32 => {
799                                    push_directive(tokens, "b32");
800                            }
801                            Type::B64 => {
802                                    push_directive(tokens, "b64");
803                            }
804                            Type::U16 => {
805                                    push_directive(tokens, "u16");
806                            }
807                            Type::U32 => {
808                                    push_directive(tokens, "u32");
809                            }
810                            Type::U64 => {
811                                    push_directive(tokens, "u64");
812                            }
813                            Type::S16 => {
814                                    push_directive(tokens, "s16");
815                            }
816                            Type::S32 => {
817                                    push_directive(tokens, "s32");
818                            }
819                            Type::S64 => {
820                                    push_directive(tokens, "s64");
821                            }
822                            Type::F32 => {
823                                    push_directive(tokens, "f32");
824                            }
825                            Type::F64 => {
826                                    push_directive(tokens, "f64");
827                            }
828                            Type::B8 => {
829                                    push_directive(tokens, "b8");
830                            }
831                            Type::U8 => {
832                                    push_directive(tokens, "u8");
833                            }
834                            Type::S8 => {
835                                    push_directive(tokens, "s8");
836                            }
837                    }
838                    if spaced { tokens.push(PtxToken::Space); }
839                    self.d.unparse_tokens_mode(tokens, spaced);
840            tokens.push(PtxToken::Comma);
841                    if spaced { tokens.push(PtxToken::Space); }
842                    self.a.unparse_tokens_mode(tokens, spaced);
843            if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
844                    if let Some(opt_29) = self.cache_policy.as_ref() {
845                        if spaced { tokens.push(PtxToken::Space); }
846                        opt_29.unparse_tokens_mode(tokens, spaced);
847                    }
848            tokens.push(PtxToken::Semicolon);
849            if spaced { tokens.push(PtxToken::Newline); }
850        }
851    }
852
853    impl PtxUnparser for LdMmioRelaxedSysGlobalType {
854        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
855            self.unparse_tokens_mode(tokens, false);
856        }
857        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
858            push_opcode(tokens, "ld");
859            push_directive(tokens, "mmio");
860            push_directive(tokens, "relaxed");
861            push_directive(tokens, "sys");
862            if self.global {
863                push_directive(tokens, "global");
864            }
865            match &self.type_ {
866                Type::B128 => {
867                    push_directive(tokens, "b128");
868                }
869                Type::B16 => {
870                    push_directive(tokens, "b16");
871                }
872                Type::B32 => {
873                    push_directive(tokens, "b32");
874                }
875                Type::B64 => {
876                    push_directive(tokens, "b64");
877                }
878                Type::U16 => {
879                    push_directive(tokens, "u16");
880                }
881                Type::U32 => {
882                    push_directive(tokens, "u32");
883                }
884                Type::U64 => {
885                    push_directive(tokens, "u64");
886                }
887                Type::S16 => {
888                    push_directive(tokens, "s16");
889                }
890                Type::S32 => {
891                    push_directive(tokens, "s32");
892                }
893                Type::S64 => {
894                    push_directive(tokens, "s64");
895                }
896                Type::F32 => {
897                    push_directive(tokens, "f32");
898                }
899                Type::F64 => {
900                    push_directive(tokens, "f64");
901                }
902                Type::B8 => {
903                    push_directive(tokens, "b8");
904                }
905                Type::U8 => {
906                    push_directive(tokens, "u8");
907                }
908                Type::S8 => {
909                    push_directive(tokens, "s8");
910                }
911            }
912            if spaced {
913                tokens.push(PtxToken::Space);
914            }
915            self.d.unparse_tokens_mode(tokens, spaced);
916            tokens.push(PtxToken::Comma);
917            if spaced {
918                tokens.push(PtxToken::Space);
919            }
920            self.a.unparse_tokens_mode(tokens, spaced);
921            tokens.push(PtxToken::Semicolon);
922            if spaced {
923                tokens.push(PtxToken::Newline);
924            }
925        }
926    }
927}