ptx_parser/unparser/instruction/
dp4a.rs

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