Skip to main content

ptx_parser/type/instruction/
shfl.rs

1//! Original PTX specification:
2//!
3//! shfl.mode.b32  d{|p}, a, b, c;
4//! .mode = { .up, .down, .bfly, .idx };
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 Mode {
18        Down, // .down
19        Bfly, // .bfly
20        Idx,  // .idx
21        Up,   // .up
22    }
23
24    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
25    pub struct ShflModeB32 {
26        pub mode: Mode,                // .mode
27        pub b32: (),                   // .b32
28        pub d: GeneralOperand,         // first operand of d{|p}
29        pub p: Option<GeneralOperand>, // optional second operand of d{|p}
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::Mode as Mode0;
40pub use section_0::ShflModeB32;