Skip to main content

ptx_parser/type/instruction/
bfind.rs

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