ptx_parser/unparser/instruction/
sad.rs1#![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::sad::section_0::*;
14
15 impl PtxUnparser for SadType {
16 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17 self.unparse_tokens_mode(tokens, false);
18 }
19 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
20 push_opcode(tokens, "sad");
21 match &self.type_ {
22 Type::U16 => {
23 push_directive(tokens, "u16");
24 }
25 Type::U32 => {
26 push_directive(tokens, "u32");
27 }
28 Type::U64 => {
29 push_directive(tokens, "u64");
30 }
31 Type::S16 => {
32 push_directive(tokens, "s16");
33 }
34 Type::S32 => {
35 push_directive(tokens, "s32");
36 }
37 Type::S64 => {
38 push_directive(tokens, "s64");
39 }
40 }
41 if spaced {
42 tokens.push(PtxToken::Space);
43 }
44 self.d.unparse_tokens_mode(tokens, spaced);
45 tokens.push(PtxToken::Comma);
46 if spaced {
47 tokens.push(PtxToken::Space);
48 }
49 self.a.unparse_tokens_mode(tokens, spaced);
50 tokens.push(PtxToken::Comma);
51 if spaced {
52 tokens.push(PtxToken::Space);
53 }
54 self.b.unparse_tokens_mode(tokens, spaced);
55 tokens.push(PtxToken::Comma);
56 if spaced {
57 tokens.push(PtxToken::Space);
58 }
59 self.c.unparse_tokens_mode(tokens, spaced);
60 tokens.push(PtxToken::Semicolon);
61 if spaced {
62 tokens.push(PtxToken::Newline);
63 }
64 }
65 }
66}