Skip to main content

ptx_parser/type/instruction/
mad24.rs

1//! Original PTX specification:
2//!
3//! mad24.mode.type  d, a, b, c;
4//! mad24.hi.sat.s32 d, a, b, c;
5//! .mode = { .hi, .lo };
6//! .type = { .u32, .s32 };
7
8#![allow(unused)]
9use crate::r#type::common::*;
10
11pub mod section_0 {
12    use crate::Spanned;
13    use crate::parser::Span;
14    use crate::r#type::common::*;
15
16    use serde::Serialize;
17
18    #[derive(Debug, Clone, PartialEq, Serialize)]
19    pub enum Mode {
20        Hi, // .hi
21        Lo, // .lo
22    }
23
24    #[derive(Debug, Clone, PartialEq, Serialize)]
25    pub enum Type {
26        U32, // .u32
27        S32, // .s32
28    }
29
30    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
31    pub struct Mad24ModeType {
32        pub mode: Mode,        // .mode
33        pub type_: Type,       // .type
34        pub d: GeneralOperand, // d
35        pub a: GeneralOperand, // a
36        pub b: GeneralOperand, // b
37        pub c: GeneralOperand, // c
38        pub span: Span,
39    }
40
41    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
42    pub struct Mad24HiSatS32 {
43        pub hi: (),            // .hi
44        pub sat: (),           // .sat
45        pub s32: (),           // .s32
46        pub d: GeneralOperand, // d
47        pub a: GeneralOperand, // a
48        pub b: GeneralOperand, // b
49        pub c: GeneralOperand, // c
50        pub span: Span,
51    }
52}
53
54// Re-export types with section suffixes to avoid naming conflicts
55// e.g., Type0 for section_0::Type, Type1 for section_1::Type
56pub use section_0::Mad24HiSatS32;
57pub use section_0::Mad24ModeType;
58pub use section_0::Mode as Mode0;
59pub use section_0::Type as Type0;