Skip to main content

ptx_parser/unparser/instruction/
mbarrier_inval.rs

1//! Original PTX specification:
2//!
3//! mbarrier.inval{.state}.b64 [addr];
4//! .state = { .shared, .shared::cta}
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::mbarrier_inval::section_0::*;
14
15    impl PtxUnparser for MbarrierInvalStateB64 {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            self.unparse_tokens_mode(tokens, false);
18        }
19        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
20            push_opcode(tokens, "mbarrier");
21            push_directive(tokens, "inval");
22            if let Some(state_0) = self.state.as_ref() {
23                match state_0 {
24                    State::SharedCta => {
25                        push_directive(tokens, "shared::cta");
26                    }
27                    State::Shared => {
28                        push_directive(tokens, "shared");
29                    }
30                }
31            }
32            push_directive(tokens, "b64");
33            if spaced {
34                tokens.push(PtxToken::Space);
35            }
36            self.addr.unparse_tokens_mode(tokens, spaced);
37            tokens.push(PtxToken::Semicolon);
38            if spaced {
39                tokens.push(PtxToken::Newline);
40            }
41        }
42    }
43}