ptx_parser/unparser/instruction/
sub_cc.rs

1//! Original PTX specification:
2//!
3//! sub.cc.type  d, a, b;
4//! .type = { .u32, .s32, .u64, .s64 };
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::sub_cc::section_0::*;
14
15    impl PtxUnparser for SubCcType {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            push_opcode(tokens, "sub");
18                    push_directive(tokens, "cc");
19                    match &self.type_ {
20                            Type::U32 => {
21                                    push_directive(tokens, "u32");
22                            }
23                            Type::S32 => {
24                                    push_directive(tokens, "s32");
25                            }
26                            Type::U64 => {
27                                    push_directive(tokens, "u64");
28                            }
29                            Type::S64 => {
30                                    push_directive(tokens, "s64");
31                            }
32                    }
33                    self.d.unparse_tokens(tokens);
34            tokens.push(PtxToken::Comma);
35                    self.a.unparse_tokens(tokens);
36            tokens.push(PtxToken::Comma);
37                    self.b.unparse_tokens(tokens);
38            tokens.push(PtxToken::Semicolon);
39        }
40    }
41
42}
43