ptx_parser/unparser/instruction/
istypep.rs

1//! Original PTX specification:
2//!
3//! istypep.type   p, a;  // result is .pred
4//! .type = { .texref, .samplerref, .surfref };
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::istypep::section_0::*;
14
15    impl PtxUnparser for IstypepType {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            push_opcode(tokens, "istypep");
18            match &self.type_ {
19                Type::Samplerref => {
20                    push_directive(tokens, "samplerref");
21                }
22                Type::Surfref => {
23                    push_directive(tokens, "surfref");
24                }
25                Type::Texref => {
26                    push_directive(tokens, "texref");
27                }
28            }
29            self.p.unparse_tokens(tokens);
30            tokens.push(PtxToken::Comma);
31            self.a.unparse_tokens(tokens);
32            tokens.push(PtxToken::Semicolon);
33        }
34    }
35}