ptx_parser/parser/instruction/
fns.rs

1//! Original PTX specification:
2//!
3//! fns.b32 d, mask, base, offset;
4
5#![allow(unused)]
6
7use crate::lexer::PtxToken;
8use crate::parser::{PtxParseError, PtxParser, PtxTokenStream, Span};
9use crate::r#type::common::*;
10
11pub mod section_0 {
12    use super::*;
13    use crate::r#type::instruction::fns::section_0::*;
14
15    impl PtxParser for FnsB32 {
16        fn parse(stream: &mut PtxTokenStream) -> Result<Self, PtxParseError> {
17            stream.expect_string("fns")?;
18            stream.expect_string(".b32")?;
19            let b32 = ();
20            stream.expect_complete()?;
21            let d = GeneralOperand::parse(stream)?;
22            stream.expect_complete()?;
23            stream.expect(&PtxToken::Comma)?;
24            let mask = GeneralOperand::parse(stream)?;
25            stream.expect_complete()?;
26            stream.expect(&PtxToken::Comma)?;
27            let base = GeneralOperand::parse(stream)?;
28            stream.expect_complete()?;
29            stream.expect(&PtxToken::Comma)?;
30            let offset = GeneralOperand::parse(stream)?;
31            stream.expect_complete()?;
32            stream.expect_complete()?;
33            stream.expect(&PtxToken::Semicolon)?;
34            Ok(FnsB32 {
35                b32,
36                d,
37                mask,
38                base,
39                offset,
40            })
41        }
42    }
43
44
45}
46