From 5c92b3c460b87dda5ee87a1b196466a0f42e1cf3 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Tue, 8 Dec 2020 15:15:35 +0100 Subject: [PATCH] panfrost: Assume that nir_tex_instr::dest_type is sized Get rid of some now-redundant code, and cleanup the is-float check in the bifrost compiler. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 6 ++---- src/panfrost/midgard/midgard_compile.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index f4e15dc..8073db2 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1785,10 +1785,8 @@ bi_is_simple_tex(nir_tex_instr *instr) if (instr->op != nir_texop_tex && instr->op != nir_texop_txl) return false; - nir_alu_type base = nir_alu_type_get_base_type(instr->dest_type); - unsigned sz = nir_dest_bit_size(instr->dest); - - if (!(base == nir_type_float && (sz == 16 || sz == 32))) + if (instr->dest_type != nir_type_float32 && + instr->dest_type != nir_type_float16) return false; if (instr->is_shadow || instr->is_array) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 19b5ccd..32e86fc 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2118,7 +2118,6 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr, int sampler_index = texture_index; nir_alu_type dest_base = nir_alu_type_get_base_type(instr->dest_type); - nir_alu_type dest_type = dest_base | nir_dest_bit_size(*dest); /* texture instructions support float outmods */ unsigned outmod = midgard_outmod_none; @@ -2131,7 +2130,7 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr, .mask = 0xF, .dest = nir_dest_index(dest), .src = { ~0, ~0, ~0, ~0 }, - .dest_type = dest_type, + .dest_type = instr->dest_type, .swizzle = SWIZZLE_IDENTITY_4, .outmod = outmod, .op = midgard_texop, -- 2.7.4