aco: Implement b2b32 and b2b1
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 27 Mar 2020 16:49:14 +0000 (11:49 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 30 Mar 2020 15:46:19 +0000 (15:46 +0000)
The implementations here just clone i2b32 and i2b1.  This means that
b2b32 doesn't technically generate true NIR 0/-1 booleans but it should
be fine as it's only ever generated for shared variable writes which
will always be consumed by something which will then run it through an
i2b again.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4338>

src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_instruction_selection_setup.cpp

index fa3d38e1be7294884a8b1aebe18cf02d18ea1665..8b8f3fa8ce0ccc6357d887181ceb46a607395987 100644 (file)
@@ -2247,6 +2247,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
       }
       break;
    }
+   case nir_op_b2b32:
    case nir_op_b2i32: {
       Temp src = get_alu_src(ctx, instr->src[0]);
       assert(src.regClass() == bld.lm);
@@ -2261,6 +2262,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
       }
       break;
    }
+   case nir_op_b2b1:
    case nir_op_i2b1: {
       Temp src = get_alu_src(ctx, instr->src[0]);
       assert(dst.regClass() == bld.lm);
index 644bc151fcbe484edbf0247cec32e4ae78bd5b3f..d365f79698aa9e190c5246c270d6a985f69a3b6f 100644 (file)
@@ -323,11 +323,13 @@ void init_context(isel_context *ctx, nir_shader *shader)
                   case nir_op_ieq:
                   case nir_op_ine:
                   case nir_op_i2b1:
+                  case nir_op_b2b1:
                      size = lane_mask_size;
                      break;
                   case nir_op_f2i64:
                   case nir_op_f2u64:
                   case nir_op_b2i32:
+                  case nir_op_b2b32:
                   case nir_op_b2f32:
                   case nir_op_f2i32:
                   case nir_op_f2u32: