ptx_parser/unparser/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)]
10
11use crate::lexer::PtxToken;
12use crate::unparser::{PtxUnparser, common::*};
13
14pub mod section_0 {
15    use super::*;
16    use crate::r#type::instruction::testp::section_0::*;
17
18    impl PtxUnparser for TestpOpType {
19        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
20            push_opcode(tokens, "testp");
21            match &self.op {
22                Op::Notanumber => {
23                    push_directive(tokens, "notanumber");
24                }
25                Op::Subnormal => {
26                    push_directive(tokens, "subnormal");
27                }
28                Op::Infinite => {
29                    push_directive(tokens, "infinite");
30                }
31                Op::Finite => {
32                    push_directive(tokens, "finite");
33                }
34                Op::Number => {
35                    push_directive(tokens, "number");
36                }
37                Op::Normal => {
38                    push_directive(tokens, "normal");
39                }
40            }
41            match &self.type_ {
42                Type::F32 => {
43                    push_directive(tokens, "f32");
44                }
45                Type::F64 => {
46                    push_directive(tokens, "f64");
47                }
48            }
49            self.p.unparse_tokens(tokens);
50            tokens.push(PtxToken::Comma);
51            self.a.unparse_tokens(tokens);
52            tokens.push(PtxToken::Semicolon);
53        }
54    }
55}