Skip to main content

ptx_parser/type/instruction/
lop3.rs

1//! Original PTX specification:
2//!
3//! lop3.b32 d, a, b, c, immLut;
4//! lop3.BoolOp.b32 d|p, a, b, c, immLut, q;
5//! .BoolOp   = { .or , .and };
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 Boolop {
19        And, // .and
20        Or,  // .or
21    }
22
23    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
24    pub struct Lop3B32 {
25        pub b32: (),                // .b32
26        pub d: GeneralOperand,      // d
27        pub a: GeneralOperand,      // a
28        pub b: GeneralOperand,      // b
29        pub c: GeneralOperand,      // c
30        pub immlut: GeneralOperand, // immLut
31        pub span: Span,
32    }
33
34    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
35    pub struct Lop3BoolopB32 {
36        pub boolop: Boolop,         // .BoolOp
37        pub b32: (),                // .b32
38        pub d: GeneralOperand,      // first operand of d|p
39        pub p: GeneralOperand,      // second operand of d|p
40        pub a: GeneralOperand,      // a
41        pub b: GeneralOperand,      // b
42        pub c: GeneralOperand,      // c
43        pub immlut: GeneralOperand, // immLut
44        pub q: GeneralOperand,      // q
45        pub span: Span,
46    }
47}
48
49// Re-export types with section suffixes to avoid naming conflicts
50// e.g., Type0 for section_0::Type, Type1 for section_1::Type
51pub use section_0::Boolop as Boolop0;
52pub use section_0::Lop3B32;
53pub use section_0::Lop3BoolopB32;