ptx_parser/unparser/instruction/
xor.rs

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