1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! Original PTX specification:
//!
//! cvt.pack.sat.convertType.abType d, a, b;
//! .convertType = { .u16, .s16 };
//! .abType = { .s32 };
//! ----------------------------------------------------------------
//! cvt.pack.sat.convertType.abType.cType d, a, b, c;
//! .convertType = { .u2, .s2, .u4, .s4, .u8, .s8 };
//! .abType = { .s32 };
//! .cType = { .b32 };
#![allow(unused)]
use crate::lexer::PtxToken;
use crate::unparser::{PtxUnparser, common::*};
pub mod section_0 {
use super::*;
use crate::r#type::instruction::cvt_pack::section_0::*;
impl PtxUnparser for CvtPackSatConverttypeAbtype {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "cvt");
push_directive(tokens, "pack");
push_directive(tokens, "sat");
match &self.converttype {
Converttype::U16 => {
push_directive(tokens, "u16");
}
Converttype::S16 => {
push_directive(tokens, "s16");
}
}
match &self.abtype {
Abtype::S32 => {
push_directive(tokens, "s32");
}
}
self.d.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.b.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
}
pub mod section_1 {
use super::*;
use crate::r#type::instruction::cvt_pack::section_1::*;
impl PtxUnparser for CvtPackSatConverttypeAbtypeCtype {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "cvt");
push_directive(tokens, "pack");
push_directive(tokens, "sat");
match &self.converttype {
Converttype::U2 => {
push_directive(tokens, "u2");
}
Converttype::S2 => {
push_directive(tokens, "s2");
}
Converttype::U4 => {
push_directive(tokens, "u4");
}
Converttype::S4 => {
push_directive(tokens, "s4");
}
Converttype::U8 => {
push_directive(tokens, "u8");
}
Converttype::S8 => {
push_directive(tokens, "s8");
}
}
match &self.abtype {
Abtype::S32 => {
push_directive(tokens, "s32");
}
}
match &self.ctype {
Ctype::B32 => {
push_directive(tokens, "b32");
}
}
self.d.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.b.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.c.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
}