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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//! Original PTX specification:
//!
//! tld4.comp.2d.v4.dtype.f32 d{|p}, [a, c] {, e} {, f};
//! tld4.comp.geom.v4.dtype.f32 d{|p}, [a, b, c] {, e} {, f}; // explicit sampler
//! .comp = { .r, .g, .b, .a };
//! .geom = { .2d, .a2d, .cube, .acube };
//! .dtype = { .u32, .s32, .f32 };
#![allow(unused)]
use crate::lexer::PtxToken;
use crate::unparser::{PtxUnparser, common::*};
pub mod section_0 {
use super::*;
use crate::r#type::instruction::tld4::section_0::*;
impl PtxUnparser for Tld4Comp2dV4DtypeF32 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "tld4");
match &self.comp {
Comp::R => {
push_directive(tokens, "r");
}
Comp::G => {
push_directive(tokens, "g");
}
Comp::B => {
push_directive(tokens, "b");
}
Comp::A => {
push_directive(tokens, "a");
}
}
push_directive(tokens, "2d");
push_directive(tokens, "v4");
match &self.dtype {
Dtype::U32 => {
push_directive(tokens, "u32");
}
Dtype::S32 => {
push_directive(tokens, "s32");
}
Dtype::F32 => {
push_directive(tokens, "f32");
}
}
push_directive(tokens, "f32");
self.d.unparse_tokens(tokens);
if let Some(p_0) = self.p.as_ref() {
tokens.push(PtxToken::Pipe);
p_0.unparse_tokens(tokens);
}
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
if self.e.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_1) = self.e.as_ref() {
opt_1.unparse_tokens(tokens);
}
if self.f.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_2) = self.f.as_ref() {
opt_2.unparse_tokens(tokens);
}
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for Tld4CompGeomV4DtypeF32 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "tld4");
match &self.comp {
Comp::R => {
push_directive(tokens, "r");
}
Comp::G => {
push_directive(tokens, "g");
}
Comp::B => {
push_directive(tokens, "b");
}
Comp::A => {
push_directive(tokens, "a");
}
}
match &self.geom {
Geom::Acube => {
push_directive(tokens, "acube");
}
Geom::Cube => {
push_directive(tokens, "cube");
}
Geom::A2d => {
push_directive(tokens, "a2d");
}
Geom::_2d => {
push_directive(tokens, "2d");
}
}
push_directive(tokens, "v4");
match &self.dtype {
Dtype::U32 => {
push_directive(tokens, "u32");
}
Dtype::S32 => {
push_directive(tokens, "s32");
}
Dtype::F32 => {
push_directive(tokens, "f32");
}
}
push_directive(tokens, "f32");
self.d.unparse_tokens(tokens);
if let Some(p_3) = self.p.as_ref() {
tokens.push(PtxToken::Pipe);
p_3.unparse_tokens(tokens);
}
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
if self.e.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_4) = self.e.as_ref() {
opt_4.unparse_tokens(tokens);
}
if self.f.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_5) = self.f.as_ref() {
opt_5.unparse_tokens(tokens);
}
tokens.push(PtxToken::Semicolon);
}
}
}