Skip to main content

ptx_parser/type/instruction/
sad.rs

1//! Original PTX specification:
2//!
3//! sad.type  d, a, b, c;
4//! .type = { .u16, .u32, .u64, .s16, .s32, .s64 };
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        U16, // .u16
19        U32, // .u32
20        U64, // .u64
21        S16, // .s16
22        S32, // .s32
23        S64, // .s64
24    }
25
26    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
27    pub struct SadType {
28        pub type_: Type,       // .type
29        pub d: GeneralOperand, // d
30        pub a: GeneralOperand, // a
31        pub b: GeneralOperand, // b
32        pub c: GeneralOperand, // c
33        pub span: Span,
34    }
35}
36
37// Re-export types with section suffixes to avoid naming conflicts
38// e.g., Type0 for section_0::Type, Type1 for section_1::Type
39pub use section_0::SadType;
40pub use section_0::Type as Type0;