summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-10-10 22:04:17 -0500
committerJason Ekstrand <[email protected]>2018-10-11 15:21:19 -0500
commit0e0dc596a2c008c32def103e175fcd5b7116f38f (patch)
tree770293c84ec3d3617b5690aede52624efb0408d7 /src/intel
parent497675c21ee34dfe1e8f9dfe62f6a3011f8062e5 (diff)
intel/vec4: Fix nir_op_b2[fi] with 64-bit result
This is valid NIR but you can't actually hit this case today. GLSL IR doesn't have a bool to double opcode; it does f2d(b2f(x)). In SPIR-V we don't have any to/from bool conversion opcodes at all. However, the next commit will make us start generating it so we should be ready. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/compiler/brw_vec4_nir.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_vec4_nir.cpp b/src/intel/compiler/brw_vec4_nir.cpp
index eaf1754b006..5ccfd1f8940 100644
--- a/src/intel/compiler/brw_vec4_nir.cpp
+++ b/src/intel/compiler/brw_vec4_nir.cpp
@@ -1586,7 +1586,12 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
case nir_op_b2i:
case nir_op_b2f:
- emit(MOV(dst, negate(op[0])));
+ if (nir_dest_bit_size(instr->dest.dest) > 32) {
+ assert(dst.type == BRW_REGISTER_TYPE_DF);
+ emit_conversion_to_double(dst, negate(op[0]), false);
+ } else {
+ emit(MOV(dst, negate(op[0])));
+ }
break;
case nir_op_f2b: