ptx_parser/unparser/instruction/
subc.rs

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