Skip to main content

ptx_parser/type/instruction/
shf.rs

1//! Original PTX specification:
2//!
3//! shf.l.mode.b32  d, a, b, c;  // left shift
4//! shf.r.mode.b32  d, a, b, c;  // right shift
5//! .mode = { .clamp, .wrap };
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, Spanned, Serialize)]
24    pub struct ShfLModeB32 {
25        pub l: (),             // .l
26        pub mode: Mode,        // .mode
27        pub b32: (),           // .b32
28        pub d: GeneralOperand, // d
29        pub a: GeneralOperand, // a
30        pub b: GeneralOperand, // b
31        pub c: GeneralOperand, // c
32        pub span: Span,
33    }
34
35    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
36    pub struct ShfRModeB32 {
37        pub r: (),             // .r
38        pub mode: Mode,        // .mode
39        pub b32: (),           // .b32
40        pub d: GeneralOperand, // d
41        pub a: GeneralOperand, // a
42        pub b: GeneralOperand, // b
43        pub c: GeneralOperand, // c
44        pub span: Span,
45    }
46}
47
48// Re-export types with section suffixes to avoid naming conflicts
49// e.g., Type0 for section_0::Type, Type1 for section_1::Type
50pub use section_0::Mode as Mode0;
51pub use section_0::ShfLModeB32;
52pub use section_0::ShfRModeB32;