ptx_parser/unparser/instruction/
suld.rs1#![allow(unused)]
12
13use crate::lexer::PtxToken;
14use crate::unparser::{PtxUnparser, common::*};
15
16pub mod section_0 {
17 use super::*;
18 use crate::r#type::instruction::suld::section_0::*;
19
20 impl PtxUnparser for SuldBGeomCopVecDtypeMode {
21 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
22 self.unparse_tokens_mode(tokens, false);
23 }
24 fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
25 push_opcode(tokens, "suld");
26 push_directive(tokens, "b");
27 match &self.geom {
28 Geom::A1d => {
29 push_directive(tokens, "a1d");
30 }
31 Geom::A2d => {
32 push_directive(tokens, "a2d");
33 }
34 Geom::_1d => {
35 push_directive(tokens, "1d");
36 }
37 Geom::_2d => {
38 push_directive(tokens, "2d");
39 }
40 Geom::_3d => {
41 push_directive(tokens, "3d");
42 }
43 }
44 if let Some(cop_0) = self.cop.as_ref() {
45 match cop_0 {
46 Cop::Ca => {
47 push_directive(tokens, "ca");
48 }
49 Cop::Cg => {
50 push_directive(tokens, "cg");
51 }
52 Cop::Cs => {
53 push_directive(tokens, "cs");
54 }
55 Cop::Cv => {
56 push_directive(tokens, "cv");
57 }
58 }
59 }
60 match &self.vec {
61 Vec::None => {
62 push_token_from_str(tokens, "none");
63 }
64 Vec::V2 => {
65 push_directive(tokens, "v2");
66 }
67 Vec::V4 => {
68 push_directive(tokens, "v4");
69 }
70 }
71 match &self.dtype {
72 Dtype::B16 => {
73 push_directive(tokens, "b16");
74 }
75 Dtype::B32 => {
76 push_directive(tokens, "b32");
77 }
78 Dtype::B64 => {
79 push_directive(tokens, "b64");
80 }
81 Dtype::B8 => {
82 push_directive(tokens, "b8");
83 }
84 }
85 if let Some(mode_1) = self.mode.as_ref() {
86 match mode_1 {
87 Mode::Clamp => {
88 push_directive(tokens, "clamp");
89 }
90 Mode::Trap => {
91 push_directive(tokens, "trap");
92 }
93 Mode::Zero => {
94 push_directive(tokens, "zero");
95 }
96 }
97 }
98 if spaced {
99 tokens.push(PtxToken::Space);
100 }
101 self.d.unparse_tokens_mode(tokens, spaced);
102 tokens.push(PtxToken::Comma);
103 if spaced {
104 tokens.push(PtxToken::Space);
105 }
106 self.a.unparse_tokens_mode(tokens, spaced);
107 tokens.push(PtxToken::Semicolon);
108 if spaced {
109 tokens.push(PtxToken::Newline);
110 }
111 }
112 }
113}