summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-21 17:41:34 -0400
committerMarge Bot <[email protected]>2020-03-22 03:32:35 +0000
commitcd7fec782edd3c6d2e154994c15ceee65c3c0dc9 (patch)
tree0bf2e1b6f276e09f085a1c62b0f2bbf263c1c1ec
parent12299dead7ee589ee4a84af6058762381ef44c2c (diff)
pan/bi: Remove hacks for 1-bit booleans in IR
Now that we lower them away, a bunch of special cases disappear. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4276>
-rw-r--r--src/panfrost/bifrost/bi_print.c4
-rw-r--r--src/panfrost/bifrost/bi_ra.c6
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c2
-rw-r--r--src/panfrost/bifrost/bir.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c
index f06cff849d3..73de74381cc 100644
--- a/src/panfrost/bifrost/bi_print.c
+++ b/src/panfrost/bifrost/bi_print.c
@@ -227,7 +227,7 @@ bi_print_alu_type(nir_alu_type t, FILE *fp)
static void
bi_print_swizzle(bi_instruction *ins, unsigned src, FILE *fp)
{
- unsigned size = MAX2(nir_alu_type_get_type_size(ins->dest_type), 8);
+ unsigned size = nir_alu_type_get_type_size(ins->dest_type);
unsigned count = (size == 64) ? 1 : (32 / size);
fprintf(fp, ".");
@@ -303,7 +303,7 @@ bi_print_writemask(bi_instruction *ins, FILE *fp)
{
unsigned bits_per_comp = nir_alu_type_get_type_size(ins->dest_type);
assert(bits_per_comp);
- unsigned bytes_per_comp = MAX2(bits_per_comp / 8, 1);
+ unsigned bytes_per_comp = bits_per_comp / 8;
unsigned comps = 16 / bytes_per_comp;
unsigned smask = (1 << bytes_per_comp) - 1;
fprintf(fp, ".");
diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c
index a047932ae71..f7feec222bd 100644
--- a/src/panfrost/bifrost/bi_ra.c
+++ b/src/panfrost/bifrost/bi_ra.c
@@ -123,8 +123,8 @@ bi_adjust_src_ra(bi_instruction *ins, struct lcra_state *l, unsigned src)
/* Use the swizzle as component select */
nir_alu_type T = ins->src_types[src];
unsigned size = nir_alu_type_get_type_size(T);
- unsigned bytes = (MAX2(size, 8) / 8);
- unsigned comps_per_reg = 4 / bytes;
+ assert(size <= 32); /* TODO: 64-bit */
+ unsigned comps_per_reg = 32 / size;
unsigned components = bi_get_component_count(ins, src);
for (unsigned i = 0; i < components; ++i) {
@@ -159,7 +159,7 @@ bi_adjust_dest_ra(bi_instruction *ins, struct lcra_state *l)
unsigned tz = __builtin_ctz(ins->writemask);
- /* Recall writemask is one bit per byte, so tz is in bytes */
+ /* Recall writemask is one bit per byte, so tz is in eytes */
unsigned regs = tz / 4;
offset = regs * 4;
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 1b08e7b433c..43b44314fec 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -455,7 +455,7 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
unsigned comps = instr->dest.dest.ssa.num_components;
assert(comps == 1);
unsigned bits = bits_per_comp * comps;
- unsigned bytes = MAX2(bits / 8, 1);
+ unsigned bytes = bits / 8;
alu.writemask = (1 << bytes) - 1;
} else {
unsigned comp_mask = instr->dest.write_mask;
diff --git a/src/panfrost/bifrost/bir.c b/src/panfrost/bifrost/bir.c
index c385cfe7587..f110564aa64 100644
--- a/src/panfrost/bifrost/bir.c
+++ b/src/panfrost/bifrost/bir.c
@@ -100,7 +100,7 @@ bi_get_component_count(bi_instruction *ins, unsigned src)
} else {
/* Stores imply VECTOR */
assert(ins->dest_type);
- unsigned bytes = MAX2(nir_alu_type_get_type_size(ins->dest_type), 8);
+ unsigned bytes = nir_alu_type_get_type_size(ins->dest_type);
return 32 / bytes;
}
}
@@ -125,7 +125,7 @@ bi_bytemask_of_read_components(bi_instruction *ins, unsigned node)
unsigned component_count = bi_get_component_count(ins, s);
nir_alu_type T = ins->src_types[s];
unsigned size = nir_alu_type_get_type_size(T);
- unsigned bytes = (MAX2(size, 8) / 8);
+ unsigned bytes = size / 8;
unsigned cmask = (1 << bytes) - 1;
for (unsigned i = 0; i < component_count; ++i) {