i965/fs: Match destination type to size for ballot
authorMatt Turner <mattst88@gmail.com>
Fri, 30 Jun 2017 22:11:15 +0000 (15:11 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 20 Jul 2017 23:56:50 +0000 (16:56 -0700)
No use in taking a 64-bit value when we know the high 32-bits are zero.

src/intel/compiler/brw_compiler.c
src/intel/compiler/brw_fs_nir.cpp

index e86ab0fc687b7789b42cac8c5fbc2db25ed66950..27fea4c8a007a5390271fbb22366ee0733630aa7 100644 (file)
@@ -58,7 +58,7 @@ static const struct nir_shader_compiler_options scalar_nir_options = {
    .lower_unpack_unorm_2x16 = true,
    .lower_unpack_unorm_4x8 = true,
    .lower_subgroup_masks = true,
-   .max_subgroup_size = 64, /* FIXME */
+   .max_subgroup_size = 32,
    .max_unroll_iterations = 32,
 };
 
index 74f90dabeac3995f059cf75218cee6f5344a7bf8..d760946e62445f616b734e116191959c9ae329f8 100644 (file)
@@ -4189,7 +4189,11 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
       bld.exec_all().MOV(flag, brw_imm_ud(0u));
       bld.CMP(bld.null_reg_ud(), value, brw_imm_ud(0u), BRW_CONDITIONAL_NZ);
 
-      dest.type = BRW_REGISTER_TYPE_UQ;
+      if (instr->dest.ssa.bit_size > 32) {
+         dest.type = BRW_REGISTER_TYPE_UQ;
+      } else {
+         dest.type = BRW_REGISTER_TYPE_UD;
+      }
       bld.MOV(dest, flag);
       break;
    }