ptx_parser/unparser/instruction/shr.rs
1//! Original PTX specification:
2//!
3//! shr.type d, a, b;
4//! .type = { .b16, .b32, .b64,
5//! .u16, .u32, .u64,
6//! .s16, .s32, .s64 };
7
8#![allow(unused)]
9
10use crate::lexer::PtxToken;
11use crate::unparser::{PtxUnparser, common::*};
12
13pub mod section_0 {
14 use super::*;
15 use crate::r#type::instruction::shr::section_0::*;
16
17 impl PtxUnparser for ShrType {
18 fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
19 push_opcode(tokens, "shr");
20 match &self.type_ {
21 Type::B16 => {
22 push_directive(tokens, "b16");
23 }
24 Type::B32 => {
25 push_directive(tokens, "b32");
26 }
27 Type::B64 => {
28 push_directive(tokens, "b64");
29 }
30 Type::U16 => {
31 push_directive(tokens, "u16");
32 }
33 Type::U32 => {
34 push_directive(tokens, "u32");
35 }
36 Type::U64 => {
37 push_directive(tokens, "u64");
38 }
39 Type::S16 => {
40 push_directive(tokens, "s16");
41 }
42 Type::S32 => {
43 push_directive(tokens, "s32");
44 }
45 Type::S64 => {
46 push_directive(tokens, "s64");
47 }
48 }
49 self.d.unparse_tokens(tokens);
50 tokens.push(PtxToken::Comma);
51 self.a.unparse_tokens(tokens);
52 tokens.push(PtxToken::Comma);
53 self.b.unparse_tokens(tokens);
54 tokens.push(PtxToken::Semicolon);
55 }
56 }
57
58}
59