Skip to main content

ptx_parser/unparser/instruction/
fns.rs

1//! Original PTX specification:
2//!
3//! fns.b32 d, mask, base, offset;
4
5#![allow(unused)]
6
7use crate::lexer::PtxToken;
8use crate::unparser::{PtxUnparser, common::*};
9
10pub mod section_0 {
11    use super::*;
12    use crate::r#type::instruction::fns::section_0::*;
13
14    impl PtxUnparser for FnsB32 {
15        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
16            self.unparse_tokens_mode(tokens, false);
17        }
18        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
19            push_opcode(tokens, "fns");
20            push_directive(tokens, "b32");
21            if spaced {
22                tokens.push(PtxToken::Space);
23            }
24            self.d.unparse_tokens_mode(tokens, spaced);
25            tokens.push(PtxToken::Comma);
26            if spaced {
27                tokens.push(PtxToken::Space);
28            }
29            self.mask.unparse_tokens_mode(tokens, spaced);
30            tokens.push(PtxToken::Comma);
31            if spaced {
32                tokens.push(PtxToken::Space);
33            }
34            self.base.unparse_tokens_mode(tokens, spaced);
35            tokens.push(PtxToken::Comma);
36            if spaced {
37                tokens.push(PtxToken::Space);
38            }
39            self.offset.unparse_tokens_mode(tokens, spaced);
40            tokens.push(PtxToken::Semicolon);
41            if spaced {
42                tokens.push(PtxToken::Newline);
43            }
44        }
45    }
46}