ptx_parser/unparser/instruction/
shfl.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::shfl::section_0::*;
14
15 impl PtxUnparser for ShflModeB32 {
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, "shfl");
21 match &self.mode {
22 Mode::Down => {
23 push_directive(tokens, "down");
24 }
25 Mode::Bfly => {
26 push_directive(tokens, "bfly");
27 }
28 Mode::Idx => {
29 push_directive(tokens, "idx");
30 }
31 Mode::Up => {
32 push_directive(tokens, "up");
33 }
34 }
35 push_directive(tokens, "b32");
36 if spaced {
37 tokens.push(PtxToken::Space);
38 }
39 self.d.unparse_tokens_mode(tokens, spaced);
40 if let Some(p_0) = self.p.as_ref() {
41 tokens.push(PtxToken::Pipe);
42 p_0.unparse_tokens_mode(tokens, spaced);
43 }
44 tokens.push(PtxToken::Comma);
45 if spaced {
46 tokens.push(PtxToken::Space);
47 }
48 self.a.unparse_tokens_mode(tokens, spaced);
49 tokens.push(PtxToken::Comma);
50 if spaced {
51 tokens.push(PtxToken::Space);
52 }
53 self.b.unparse_tokens_mode(tokens, spaced);
54 tokens.push(PtxToken::Comma);
55 if spaced {
56 tokens.push(PtxToken::Space);
57 }
58 self.c.unparse_tokens_mode(tokens, spaced);
59 tokens.push(PtxToken::Semicolon);
60 if spaced {
61 tokens.push(PtxToken::Newline);
62 }
63 }
64 }
65}