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 #[derive(Debug, Clone, PartialEq)]
24 pub enum Space {
25 SharedCluster, // .shared::cluster
26 }
27
28 #[derive(Debug, Clone, PartialEq)]
29 pub enum Type {
30 U32, // .u32
31 U64, // .u64
32 }
33
34 #[derive(Debug, Clone, PartialEq, Spanned)]
35 pub struct MapaSpaceType {
36 pub space: Option<Space>, // {.space}
37 pub type_: Type, // .type
38 pub d: GeneralOperand, // d
39 pub a: GeneralOperand, // a
40 pub b: GeneralOperand, // b
41 pub span: Span,
42 }
43}
44
45// Re-export types with section suffixes to avoid naming conflicts
46// e.g., Type0 for section_0::Type, Type1 for section_1::Type
47pub use section_0::MapaSpaceType;
48pub use section_0::Space as Space0;
49pub use section_0::Type as Type0;