summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir/flow_test.cpp
blob: 6ebb4ad89338c557c91f44e4ead44cc862ffb1ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2021 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include <string>

#include <fmt/format.h>

#include "shader_recompiler/frontend/ir/flow_test.h"

namespace Shader::IR {

std::string NameOf(FlowTest flow_test) {
    switch (flow_test) {
    case FlowTest::F:
        return "F";
    case FlowTest::LT:
        return "LT";
    case FlowTest::EQ:
        return "EQ";
    case FlowTest::LE:
        return "LE";
    case FlowTest::GT:
        return "GT";
    case FlowTest::NE:
        return "NE";
    case FlowTest::GE:
        return "GE";
    case FlowTest::NUM:
        return "NUM";
    case FlowTest::NaN:
        return "NAN";
    case FlowTest::LTU:
        return "LTU";
    case FlowTest::EQU:
        return "EQU";
    case FlowTest::LEU:
        return "LEU";
    case FlowTest::GTU:
        return "GTU";
    case FlowTest::NEU:
        return "NEU";
    case FlowTest::GEU:
        return "GEU";
    case FlowTest::T:
        return "T";
    case FlowTest::OFF:
        return "OFF";
    case FlowTest::LO:
        return "LO";
    case FlowTest::SFF:
        return "SFF";
    case FlowTest::LS:
        return "LS";
    case FlowTest::HI:
        return "HI";
    case FlowTest::SFT:
        return "SFT";
    case FlowTest::HS:
        return "HS";
    case FlowTest::OFT:
        return "OFT";
    case FlowTest::CSM_TA:
        return "CSM_TA";
    case FlowTest::CSM_TR:
        return "CSM_TR";
    case FlowTest::CSM_MX:
        return "CSM_MX";
    case FlowTest::FCSM_TA:
        return "FCSM_TA";
    case FlowTest::FCSM_TR:
        return "FCSM_TR";
    case FlowTest::FCSM_MX:
        return "FCSM_MX";
    case FlowTest::RLE:
        return "RLE";
    case FlowTest::RGT:
        return "RGT";
    }
    return fmt::format("<invalid flow test {}>", static_cast<int>(flow_test));
}

} // namespace Shader::IR