Skip to main content

ptx_parser/type/instruction/
testp.rs

1//! Original PTX specification:
2//!
3//! testp.op.type  p, a;  // result is .pred
4//! .op   = { .finite, .infinite,
5//! .number, .notanumber,
6//! .normal, .subnormal };
7//! .type = { .f32, .f64 };
8
9#![allow(unused)]
10use crate::r#type::common::*;
11
12pub mod section_0 {
13    use crate::Spanned;
14    use crate::parser::Span;
15    use crate::r#type::common::*;
16
17    use serde::Serialize;
18
19    #[derive(Debug, Clone, PartialEq, Serialize)]
20    pub enum Op {
21        Notanumber, // .notanumber
22        Subnormal,  // .subnormal
23        Infinite,   // .infinite
24        Finite,     // .finite
25        Number,     // .number
26        Normal,     // .normal
27    }
28
29    #[derive(Debug, Clone, PartialEq, Serialize)]
30    pub enum Type {
31        F32, // .f32
32        F64, // .f64
33    }
34
35    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
36    pub struct TestpOpType {
37        pub op: Op,            // .op
38        pub type_: Type,       // .type
39        pub p: GeneralOperand, // p
40        pub a: GeneralOperand, // a
41        pub span: Span,
42    }
43}
44
45// Re-export types with section suffixes to avoid naming conflicts
46// e.g., Type0 for section_0::Type, Type1 for section_1::Type
47pub use section_0::Op as Op0;
48pub use section_0::TestpOpType;
49pub use section_0::Type as Type0;