Skip to main content

ptx_parser/type/instruction/
vote.rs

1//! Original PTX specification:
2//!
3//! vote.mode.pred  d, {!}a;
4//! vote.ballot.b32 d, {!}a;  // 'ballot' form, returns bitmask
5//! .mode = { .all, .any, .uni };
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 Mode {
19        All, // .all
20        Any, // .any
21        Uni, // .uni
22    }
23
24    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
25    pub struct VoteModePred {
26        pub mode: Mode,        // .mode
27        pub pred: (),          // .pred
28        pub d: GeneralOperand, // d
29        pub a_op: bool,        // {!} operator
30        pub a: GeneralOperand, // {!}a
31        pub span: Span,
32    }
33
34    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
35    pub struct VoteBallotB32 {
36        pub ballot: (),        // .ballot
37        pub b32: (),           // .b32
38        pub d: GeneralOperand, // d
39        pub a_op: bool,        // {!} operator
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::Mode as Mode0;
48pub use section_0::VoteBallotB32;
49pub use section_0::VoteModePred;