Skip to main content

ptx_parser/type/instruction/
stmatrix.rs

1//! Original PTX specification:
2//!
3//! stmatrix.sync.aligned.shape.num{.trans}{.ss}.type [p], r;
4//! .shape  = {.m8n8, .m16n8};
5//! .num    = {.x1, .x2, .x4};
6//! .ss     = {.shared, .shared::cta};
7//! .type   = {.b16, .b8};
8
9#![allow(unused)]
10use crate::r#type::common::*;
11
12pub mod section_0 {
13    use crate::Spanned;
14    use crate::parser::Span;
15    use crate::r#type::common::*;
16
17    use serde::Serialize;
18
19    #[derive(Debug, Clone, PartialEq, Serialize)]
20    pub enum Shape {
21        M16n8, // .m16n8
22        M8n8,  // .m8n8
23    }
24
25    #[derive(Debug, Clone, PartialEq, Serialize)]
26    pub enum Num {
27        X1, // .x1
28        X2, // .x2
29        X4, // .x4
30    }
31
32    #[derive(Debug, Clone, PartialEq, Serialize)]
33    pub enum Ss {
34        SharedCta, // .shared::cta
35        Shared,    // .shared
36    }
37
38    #[derive(Debug, Clone, PartialEq, Serialize)]
39    pub enum Type {
40        B16, // .b16
41        B8,  // .b8
42    }
43
44    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
45    pub struct StmatrixSyncAlignedShapeNumTransSsType {
46        pub sync: (),          // .sync
47        pub aligned: (),       // .aligned
48        pub shape: Shape,      // .shape
49        pub num: Num,          // .num
50        pub trans: bool,       // {.trans}
51        pub ss: Option<Ss>,    // {.ss}
52        pub type_: Type,       // .type
53        pub p: AddressOperand, // [p]
54        pub r: GeneralOperand, // r
55        pub span: Span,
56    }
57}
58
59// Re-export types with section suffixes to avoid naming conflicts
60// e.g., Type0 for section_0::Type, Type1 for section_1::Type
61pub use section_0::Num as Num0;
62pub use section_0::Shape as Shape0;
63pub use section_0::Ss as Ss0;
64pub use section_0::StmatrixSyncAlignedShapeNumTransSsType;
65pub use section_0::Type as Type0;