xref: /aosp_15_r20/external/mesa3d/src/panfrost/compiler/bi_print_common.c (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright (C) 2019 Connor Abbott <[email protected]>
3  * Copyright (C) 2019 Lyude Paul <[email protected]>
4  * Copyright (C) 2019 Ryan Houdek <[email protected]>
5  * Copyright (C) 2019-2020 Collabora, Ltd.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the next
15  * paragraph) shall be included in all copies or substantial portions of the
16  * Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24  * SOFTWARE.
25  */
26 
27 /* Prints shared with the disassembler */
28 
29 #include "bi_print_common.h"
30 
31 const char *
bi_message_type_name(enum bifrost_message_type T)32 bi_message_type_name(enum bifrost_message_type T)
33 {
34    switch (T) {
35    case BIFROST_MESSAGE_NONE:
36       return "";
37    case BIFROST_MESSAGE_VARYING:
38       return "vary";
39    case BIFROST_MESSAGE_ATTRIBUTE:
40       return "attr";
41    case BIFROST_MESSAGE_TEX:
42       return "tex";
43    case BIFROST_MESSAGE_VARTEX:
44       return "vartex";
45    case BIFROST_MESSAGE_LOAD:
46       return "load";
47    case BIFROST_MESSAGE_STORE:
48       return "store";
49    case BIFROST_MESSAGE_ATOMIC:
50       return "atomic";
51    case BIFROST_MESSAGE_BARRIER:
52       return "barrier";
53    case BIFROST_MESSAGE_BLEND:
54       return "blend";
55    case BIFROST_MESSAGE_TILE:
56       return "tile";
57    case BIFROST_MESSAGE_Z_STENCIL:
58       return "z_stencil";
59    case BIFROST_MESSAGE_ATEST:
60       return "atest";
61    case BIFROST_MESSAGE_JOB:
62       return "job";
63    case BIFROST_MESSAGE_64BIT:
64       return "64";
65    default:
66       return "XXX reserved";
67    }
68 }
69 
70 const char *
bi_flow_control_name(enum bifrost_flow mode)71 bi_flow_control_name(enum bifrost_flow mode)
72 {
73    switch (mode) {
74    case BIFROST_FLOW_END:
75       return "eos";
76    case BIFROST_FLOW_NBTB_PC:
77       return "nbb br_pc";
78    case BIFROST_FLOW_NBTB_UNCONDITIONAL:
79       return "nbb r_uncond";
80    case BIFROST_FLOW_NBTB:
81       return "nbb";
82    case BIFROST_FLOW_BTB_UNCONDITIONAL:
83       return "bb r_uncond";
84    case BIFROST_FLOW_BTB_NONE:
85       return "bb";
86    case BIFROST_FLOW_WE_UNCONDITIONAL:
87       return "we r_uncond";
88    case BIFROST_FLOW_WE:
89       return "we";
90    default:
91       return "XXX";
92    }
93 }
94