Skip to main content

ptx_parser/type/instruction/
call.rs

1//! Original PTX specification:
2//!
3//! // direct call to named function, func is a symbol
4//! call{.uni} (ret-param), func, (param-list);
5//! call{.uni} func, (param-list);
6//! call{.uni} func;
7//! // indirect call via pointer, with full list of call targets
8//! call{.uni} (ret-param), fptr, (param-list), flist;
9//! call{.uni} fptr, (param-list), flist;
10//! call{.uni} fptr, flist;
11//! // indirect call via pointer, with no knowledge of call targets
12//! call{.uni} (ret-param), fptr, (param-list), fproto;
13//! call{.uni} fptr, (param-list), fproto;
14//! call{.uni} fptr, fproto;
15
16#![allow(unused)]
17use crate::r#type::common::*;
18
19pub mod section_0 {
20    use crate::Spanned;
21    use crate::parser::Span;
22    use crate::r#type::common::*;
23
24    use serde::Serialize;
25
26    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
27    pub struct CallUni {
28        pub uni: bool,                       // {.uni}
29        pub ret_param: GeneralOperand,       // (ret-param)
30        pub func: GeneralOperand,            // func
31        pub param_list: Vec<GeneralOperand>, // (param-list)
32        pub span: Span,
33    }
34
35    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
36    pub struct CallUni1 {
37        pub uni: bool,                       // {.uni}
38        pub func: GeneralOperand,            // func
39        pub param_list: Vec<GeneralOperand>, // (param-list)
40        pub span: Span,
41    }
42
43    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
44    pub struct CallUni2 {
45        pub uni: bool,            // {.uni}
46        pub func: GeneralOperand, // func
47        pub span: Span,
48    }
49
50    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
51    pub struct CallUni3 {
52        pub uni: bool,                       // {.uni}
53        pub ret_param: GeneralOperand,       // (ret-param)
54        pub fptr: GeneralOperand,            // fptr
55        pub param_list: Vec<GeneralOperand>, // (param-list)
56        pub flist: GeneralOperand,           // flist
57        pub span: Span,
58    }
59
60    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
61    pub struct CallUni4 {
62        pub uni: bool,                       // {.uni}
63        pub fptr: GeneralOperand,            // fptr
64        pub param_list: Vec<GeneralOperand>, // (param-list)
65        pub flist: GeneralOperand,           // flist
66        pub span: Span,
67    }
68
69    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
70    pub struct CallUni5 {
71        pub uni: bool,             // {.uni}
72        pub fptr: GeneralOperand,  // fptr
73        pub flist: GeneralOperand, // flist
74        pub span: Span,
75    }
76
77    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
78    pub struct CallUni6 {
79        pub uni: bool,                       // {.uni}
80        pub ret_param: GeneralOperand,       // (ret-param)
81        pub fptr: GeneralOperand,            // fptr
82        pub param_list: Vec<GeneralOperand>, // (param-list)
83        pub fproto: GeneralOperand,          // fproto
84        pub span: Span,
85    }
86
87    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
88    pub struct CallUni7 {
89        pub uni: bool,                       // {.uni}
90        pub fptr: GeneralOperand,            // fptr
91        pub param_list: Vec<GeneralOperand>, // (param-list)
92        pub fproto: GeneralOperand,          // fproto
93        pub span: Span,
94    }
95
96    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
97    pub struct CallUni8 {
98        pub uni: bool,              // {.uni}
99        pub fptr: GeneralOperand,   // fptr
100        pub fproto: GeneralOperand, // fproto
101        pub span: Span,
102    }
103}
104
105// Re-export types with section suffixes to avoid naming conflicts
106// e.g., Type0 for section_0::Type, Type1 for section_1::Type
107pub use section_0::CallUni;
108pub use section_0::CallUni1;
109pub use section_0::CallUni2;
110pub use section_0::CallUni3;
111pub use section_0::CallUni4;
112pub use section_0::CallUni5;
113pub use section_0::CallUni6;
114pub use section_0::CallUni7;
115pub use section_0::CallUni8;