Skip to main content

ptx_parser/type/instruction/
szext.rs

1//! Original PTX specification:
2//!
3//! szext.mode.type  d, a, b;
4//! .mode = { .clamp, .wrap };
5//! .type = { .u32, .s32 };
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 Mode {
19        Clamp, // .clamp
20        Wrap,  // .wrap
21    }
22
23    #[derive(Debug, Clone, PartialEq, Serialize)]
24    pub enum Type {
25        U32, // .u32
26        S32, // .s32
27    }
28
29    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
30    pub struct SzextModeType {
31        pub mode: Mode,        // .mode
32        pub type_: Type,       // .type
33        pub d: GeneralOperand, // d
34        pub a: GeneralOperand, // a
35        pub b: GeneralOperand, // b
36        pub span: Span,
37    }
38}
39
40// Re-export types with section suffixes to avoid naming conflicts
41// e.g., Type0 for section_0::Type, Type1 for section_1::Type
42pub use section_0::Mode as Mode0;
43pub use section_0::SzextModeType;
44pub use section_0::Type as Type0;