ptx_parser/unparser/instruction/
setmaxnreg.rs

1//! Original PTX specification:
2//!
3//! setmaxnreg.action.sync.aligned.u32 imm-reg-count;
4//! .action = { .inc, .dec };
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::setmaxnreg::section_0::*;
14
15    impl PtxUnparser for SetmaxnregActionSyncAlignedU32 {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            push_opcode(tokens, "setmaxnreg");
18                    match &self.action {
19                            Action::Inc => {
20                                    push_directive(tokens, "inc");
21                            }
22                            Action::Dec => {
23                                    push_directive(tokens, "dec");
24                            }
25                    }
26                    push_directive(tokens, "sync");
27                    push_directive(tokens, "aligned");
28                    push_directive(tokens, "u32");
29                    self.imm_reg_count.unparse_tokens(tokens);
30            tokens.push(PtxToken::Semicolon);
31        }
32    }
33
34}
35