ptx_parser/type/instruction/mapa.rs
1//! Original PTX specification:
2//!
3//! mapa{.space}.type d, a, b;
4//! // Maps shared memory address in register a into CTA b.
5//! // mapa.shared::cluster.type d, a, b;
6//! // Maps shared memory variable into CTA b.
7//! // mapa.shared::cluster.type d, sh, b;
8//! // Maps shared memory variable into CTA b.
9//! // mapa.shared::cluster.type d, sh + imm, b;
10//! // Maps generic address in register a into CTA b.
11//! // mapa.type d, a, b;
12//! .space = { .shared::cluster };
13//! .type = { .u32, .u64 };
14
15#![allow(unused)]
16use crate::r#type::common::*;
17
18pub mod section_0 {
19 use crate::Spanned;
20 use crate::parser::Span;
21 use crate::r#type::common::*;
22
23 use serde::Serialize;
24
25 #[derive(Debug, Clone, PartialEq, Serialize)]
26 pub enum Space {
27 SharedCluster, // .shared::cluster
28 }
29
30 #[derive(Debug, Clone, PartialEq, Serialize)]
31 pub enum Type {
32 U32, // .u32
33 U64, // .u64
34 }
35
36 #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
37 pub struct MapaSpaceType {
38 pub space: Option<Space>, // {.space}
39 pub type_: Type, // .type
40 pub d: GeneralOperand, // d
41 pub a: GeneralOperand, // a
42 pub b: GeneralOperand, // b
43 pub span: Span,
44 }
45}
46
47// Re-export types with section suffixes to avoid naming conflicts
48// e.g., Type0 for section_0::Type, Type1 for section_1::Type
49pub use section_0::MapaSpaceType;
50pub use section_0::Space as Space0;
51pub use section_0::Type as Type0;