ptx_parser/unparser/instruction/
discard.rs

1//! Original PTX specification:
2//!
3//! discard{.global}.level  [a], size;
4//! .level = { .L2 };
5
6#![allow(unused)]
7
8use crate::lexer::PtxToken;
9use crate::unparser::{PtxUnparser, common::*};
10
11pub mod section_0 {
12    use super::*;
13    use crate::r#type::instruction::discard::section_0::*;
14
15    impl PtxUnparser for DiscardGlobalLevel {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            push_opcode(tokens, "discard");
18                    if self.global {
19                            push_directive(tokens, "global");
20                    }
21                    match &self.level {
22                            Level::L2 => {
23                                    push_directive(tokens, "L2");
24                            }
25                    }
26                    self.a.unparse_tokens(tokens);
27            tokens.push(PtxToken::Comma);
28                    self.size.unparse_tokens(tokens);
29            tokens.push(PtxToken::Semicolon);
30        }
31    }
32
33}
34