summaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/helpers.h
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2020-01-20 18:40:43 +0100
committerMarge Bot <[email protected]>2020-01-27 15:24:54 +0000
commit24360966ab31a9bedfe07356413769218fd2e0b6 (patch)
treecc24cb4c1a1ad227454e15ecee3d8ec9c9bfd708 /src/panfrost/midgard/helpers.h
parentaa973fc14e140753d3c5b47eda79e451c1dc61ed (diff)
panfrost/midgard: Prettify embedded constant prints
Until now, embedded constants were printed as all 32 bits integer or floats, but the compiler can pack constant from different types if severa instructions with different reg_mode and native type refer to the constant register. Let's implement something smarter so users don't have to do a manual conversion when looking at a trace. Note that 8-bit constants are not decoded yet, as we're not sure how the writemask is encoded in that case. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3536> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3536>
Diffstat (limited to 'src/panfrost/midgard/helpers.h')
-rw-r--r--src/panfrost/midgard/helpers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/panfrost/midgard/helpers.h b/src/panfrost/midgard/helpers.h
index 66223f3fd78..6d1031841a5 100644
--- a/src/panfrost/midgard/helpers.h
+++ b/src/panfrost/midgard/helpers.h
@@ -23,6 +23,7 @@
#define __MDG_HELPERS_H
#include "util/macros.h"
+#include <stdio.h>
#include <string.h>
#define OP_IS_LOAD_VARY_F(op) (\
@@ -344,4 +345,9 @@ midgard_is_branch_unit(unsigned unit)
return (unit == ALU_ENAB_BRANCH) || (unit == ALU_ENAB_BR_COMPACT);
}
+void
+mir_print_constant_component(FILE *fp, const midgard_constants *consts,
+ unsigned c, midgard_reg_mode reg_mode, bool half,
+ unsigned mod, midgard_alu_op op);
+
#endif