Skip to main content

ptx_parser/type/instruction/
shr.rs

1//! Original PTX specification:
2//!
3//! shr.type d, a, b;
4//! .type = { .b16, .b32, .b64,
5//! .u16, .u32, .u64,
6//! .s16, .s32, .s64 };
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 Type {
20        B16, // .b16
21        B32, // .b32
22        B64, // .b64
23        U16, // .u16
24        U32, // .u32
25        U64, // .u64
26        S16, // .s16
27        S32, // .s32
28        S64, // .s64
29    }
30
31    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
32    pub struct ShrType {
33        pub type_: Type,       // .type
34        pub d: GeneralOperand, // d
35        pub a: GeneralOperand, // a
36        pub b: GeneralOperand, // b
37        pub span: Span,
38    }
39}
40
41// Re-export types with section suffixes to avoid naming conflicts
42// e.g., Type0 for section_0::Type, Type1 for section_1::Type
43pub use section_0::ShrType;
44pub use section_0::Type as Type0;