ptx_parser/unparser/instruction/
lop3.rs1#![allow(unused)]
8
9use crate::lexer::PtxToken;
10use crate::unparser::{PtxUnparser, common::*};
11
12pub mod section_0 {
13 use super::*;
14 use crate::r#type::instruction::lop3::section_0::*;
15
16 impl PtxUnparser for Lop3B32 {
17 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
18 self.unparse_tokens_mode(tokens, false);
19 }
20 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
21 push_opcode(tokens, "lop3");
22 push_directive(tokens, "b32");
23 if spaced {
24 tokens.push(PtxToken::Space);
25 }
26 self.d.unparse_tokens_mode(tokens, spaced);
27 tokens.push(PtxToken::Comma);
28 if spaced {
29 tokens.push(PtxToken::Space);
30 }
31 self.a.unparse_tokens_mode(tokens, spaced);
32 tokens.push(PtxToken::Comma);
33 if spaced {
34 tokens.push(PtxToken::Space);
35 }
36 self.b.unparse_tokens_mode(tokens, spaced);
37 tokens.push(PtxToken::Comma);
38 if spaced {
39 tokens.push(PtxToken::Space);
40 }
41 self.c.unparse_tokens_mode(tokens, spaced);
42 tokens.push(PtxToken::Comma);
43 if spaced {
44 tokens.push(PtxToken::Space);
45 }
46 self.immlut.unparse_tokens_mode(tokens, spaced);
47 tokens.push(PtxToken::Semicolon);
48 if spaced {
49 tokens.push(PtxToken::Newline);
50 }
51 }
52 }
53
54 impl PtxUnparser for Lop3BoolopB32 {
55 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
56 self.unparse_tokens_mode(tokens, false);
57 }
58 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
59 push_opcode(tokens, "lop3");
60 match &self.boolop {
61 Boolop::And => {
62 push_directive(tokens, "and");
63 }
64 Boolop::Or => {
65 push_directive(tokens, "or");
66 }
67 }
68 push_directive(tokens, "b32");
69 if spaced {
70 tokens.push(PtxToken::Space);
71 }
72 self.d.unparse_tokens_mode(tokens, spaced);
73 tokens.push(PtxToken::Pipe);
74 self.p.unparse_tokens_mode(tokens, spaced);
75 tokens.push(PtxToken::Comma);
76 if spaced {
77 tokens.push(PtxToken::Space);
78 }
79 self.a.unparse_tokens_mode(tokens, spaced);
80 tokens.push(PtxToken::Comma);
81 if spaced {
82 tokens.push(PtxToken::Space);
83 }
84 self.b.unparse_tokens_mode(tokens, spaced);
85 tokens.push(PtxToken::Comma);
86 if spaced {
87 tokens.push(PtxToken::Space);
88 }
89 self.c.unparse_tokens_mode(tokens, spaced);
90 tokens.push(PtxToken::Comma);
91 if spaced {
92 tokens.push(PtxToken::Space);
93 }
94 self.immlut.unparse_tokens_mode(tokens, spaced);
95 tokens.push(PtxToken::Comma);
96 if spaced {
97 tokens.push(PtxToken::Space);
98 }
99 self.q.unparse_tokens_mode(tokens, spaced);
100 tokens.push(PtxToken::Semicolon);
101 if spaced {
102 tokens.push(PtxToken::Newline);
103 }
104 }
105 }
106}