Skip to main content

ptx_parser/type/instruction/
alloca.rs

1//! Original PTX specification:
2//!
3//! alloca.type  ptr, size{, immAlign};
4//! .type = { .u32, .u64 };
5
6#![allow(unused)]
7use crate::r#type::common::*;
8
9pub mod section_0 {
10    use crate::Spanned;
11    use crate::parser::Span;
12    use crate::r#type::common::*;
13
14    use serde::Serialize;
15
16    #[derive(Debug, Clone, PartialEq, Serialize)]
17    pub enum Type {
18        U32, // .u32
19        U64, // .u64
20    }
21
22    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
23    pub struct AllocaType {
24        pub type_: Type,                      // .type
25        pub ptr: GeneralOperand,              // ptr
26        pub size: GeneralOperand,             // size
27        pub immalign: Option<GeneralOperand>, // {, immAlign}
28        pub span: Span,
29    }
30}
31
32// Re-export types with section suffixes to avoid naming conflicts
33// e.g., Type0 for section_0::Type, Type1 for section_1::Type
34pub use section_0::AllocaType;
35pub use section_0::Type as Type0;