Mesa (master): pan/bi: Add bitwise modifiers
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 29 00:40:40 UTC 2020
Module: Mesa
Branch: master
Commit: 9b415bf6a037867432c72294f0f03917f3b06ae8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9b415bf6a037867432c72294f0f03917f3b06ae8
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Tue Apr 28 13:48:37 2020 -0400
pan/bi: Add bitwise modifiers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4790>
---
src/panfrost/bifrost/bi_print.c | 5 +++++
src/panfrost/bifrost/compiler.h | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c
index e67a1485780..1c9c8a72a31 100644
--- a/src/panfrost/bifrost/bi_print.c
+++ b/src/panfrost/bifrost/bi_print.c
@@ -206,6 +206,9 @@ bi_print_src(FILE *fp, bi_instruction *ins, unsigned s)
if (abs)
fprintf(fp, "abs(");
+ if (ins->type == BI_BITWISE && ins->bitwise.src_invert[s])
+ fprintf(fp, "~");
+
bi_print_index(fp, ins, src, s);
if (abs)
@@ -378,6 +381,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
fprintf(fp, ".loc%u", ins->blend_location);
else if (ins->type == BI_TEX)
fprintf(fp, ".%s", bi_tex_op_name(ins->op.texture));
+ else if (ins->type == BI_BITWISE)
+ fprintf(fp, ".%cshift", ins->bitwise.rshift ? 'r' : 'l');
if (ins->vector_channels)
fprintf(fp, ".v%u", ins->vector_channels);
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 4178352f3a8..0716cf342ef 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -214,6 +214,11 @@ enum bi_tex_op {
BI_TEX_DUAL
};
+struct bi_bitwise {
+ bool src_invert[2];
+ bool rshift; /* false for lshift */
+};
+
typedef struct {
struct list_head link; /* Must be first */
enum bi_class type;
@@ -290,6 +295,8 @@ typedef struct {
/* For BLEND -- the location 0-7 */
unsigned blend_location;
+
+ struct bi_bitwise bitwise;
};
} bi_instruction;
More information about the mesa-commit
mailing list