ptx_parser/unparser/instruction/
rsqrt.rs

1//! Original PTX specification:
2//!
3//! rsqrt.approx{.ftz}.f32  d, a;
4//! rsqrt.approx.f64        d, a;
5
6#![allow(unused)]
7
8use crate::lexer::PtxToken;
9use crate::unparser::{PtxUnparser, common::*};
10
11pub mod section_0 {
12    use super::*;
13    use crate::r#type::instruction::rsqrt::section_0::*;
14
15    impl PtxUnparser for RsqrtApproxFtzF32 {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            push_opcode(tokens, "rsqrt");
18            push_directive(tokens, "approx");
19            if self.ftz {
20                push_directive(tokens, "ftz");
21            }
22            push_directive(tokens, "f32");
23            self.d.unparse_tokens(tokens);
24            tokens.push(PtxToken::Comma);
25            self.a.unparse_tokens(tokens);
26            tokens.push(PtxToken::Semicolon);
27        }
28    }
29
30    impl PtxUnparser for RsqrtApproxF64 {
31        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
32            push_opcode(tokens, "rsqrt");
33            push_directive(tokens, "approx");
34            push_directive(tokens, "f64");
35            self.d.unparse_tokens(tokens);
36            tokens.push(PtxToken::Comma);
37            self.a.unparse_tokens(tokens);
38            tokens.push(PtxToken::Semicolon);
39        }
40    }
41}