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
//! Original PTX specification:
//!
//! txq.tquery.b32 d, [a]; // texture attributes
//! txq.level.tlquery.b32 d, [a], lod; // texture attributes
//! txq.squery.b32 d, [a]; // sampler attributes
//! .tquery = { .width, .height, .depth,
//! .channel_data_type, .channel_order,
//! .normalized_coords, .array_size,
//! .num_mipmap_levels, .num_samples};
//! .tlquery = { .width, .height, .depth };
//! .squery = { .force_unnormalized_coords, .filter_mode,
//! .addr_mode_0, addr_mode_1, addr_mode_2 };
#![allow(unused)]
use crate::lexer::PtxToken;
use crate::unparser::{PtxUnparser, common::*};
pub mod section_0 {
use super::*;
use crate::r#type::instruction::txq::section_0::*;
impl PtxUnparser for TxqTqueryB32 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "txq");
match &self.tquery {
Tquery::ChannelDataType => {
push_directive(tokens, "channel_data_type");
}
Tquery::NormalizedCoords => {
push_directive(tokens, "normalized_coords");
}
Tquery::NumMipmapLevels => {
push_directive(tokens, "num_mipmap_levels");
}
Tquery::ChannelOrder => {
push_directive(tokens, "channel_order");
}
Tquery::NumSamples => {
push_directive(tokens, "num_samples");
}
Tquery::ArraySize => {
push_directive(tokens, "array_size");
}
Tquery::Height => {
push_directive(tokens, "height");
}
Tquery::Width => {
push_directive(tokens, "width");
}
Tquery::Depth => {
push_directive(tokens, "depth");
}
}
push_directive(tokens, "b32");
self.d.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for TxqLevelTlqueryB32 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "txq");
push_directive(tokens, "level");
match &self.tlquery {
Tlquery::Height => {
push_directive(tokens, "height");
}
Tlquery::Width => {
push_directive(tokens, "width");
}
Tlquery::Depth => {
push_directive(tokens, "depth");
}
}
push_directive(tokens, "b32");
self.d.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.lod.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
impl PtxUnparser for TxqSqueryB32 {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "txq");
match &self.squery {
Squery::ForceUnnormalizedCoords => {
push_directive(tokens, "force_unnormalized_coords");
}
Squery::FilterMode => {
push_directive(tokens, "filter_mode");
}
Squery::AddrMode0 => {
push_directive(tokens, "addr_mode_0");
}
Squery::AddrMode1 => {
push_token_from_str(tokens, "addr_mode_1");
}
Squery::AddrMode2 => {
push_token_from_str(tokens, "addr_mode_2");
}
}
push_directive(tokens, "b32");
self.d.unparse_tokens(tokens);
tokens.push(PtxToken::Comma);
self.a.unparse_tokens(tokens);
tokens.push(PtxToken::Semicolon);
}
}
}