ptx_parser/unparser/instruction/
cnot.rs

1//! Original PTX specification:
2//!
3//! cnot.type d, a;
4//! .type = { .b16, .b32, .b64 };
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::cnot::section_0::*;
14
15    impl PtxUnparser for CnotType {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            push_opcode(tokens, "cnot");
18            match &self.type_ {
19                Type::B16 => {
20                    push_directive(tokens, "b16");
21                }
22                Type::B32 => {
23                    push_directive(tokens, "b32");
24                }
25                Type::B64 => {
26                    push_directive(tokens, "b64");
27                }
28            }
29            self.d.unparse_tokens(tokens);
30            tokens.push(PtxToken::Comma);
31            self.a.unparse_tokens(tokens);
32            tokens.push(PtxToken::Semicolon);
33        }
34    }
35}