Skip to main content

ptx_parser/type/instruction/
madc.rs

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