v3d: Fix f2b32 behavior.
authorEric Anholt <eric@anholt.net>
Wed, 13 Feb 2019 20:21:01 +0000 (12:21 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 19 Feb 2019 02:09:07 +0000 (18:09 -0800)
Now that we don't have the vir_PF() magic, it's obvious that we were doing
the wrong thing for f2b32 by allowing -0.0 to produce true instead of
false.

src/broadcom/compiler/nir_to_vir.c

index 8dee69e90dea87c3c83c600ef1d8afc2449ba338..86f4a3a12c150e1e59f318c5535e0ed0a250a582 100644 (file)
@@ -876,12 +876,17 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr)
                 result = vir_AND(c, src[0], vir_uniform_ui(c, 1));
                 break;
         case nir_op_i2b32:
-        case nir_op_f2b32:
                 vir_set_pf(vir_MOV_dest(c, vir_nop_reg(), src[0]),
                            V3D_QPU_PF_PUSHZ);
                 result = vir_MOV(c, vir_SEL(c, V3D_QPU_COND_IFNA,
                                             vir_uniform_ui(c, ~0),
                                             vir_uniform_ui(c, 0)));
+        case nir_op_f2b32:
+                vir_set_pf(vir_FMOV_dest(c, vir_nop_reg(), src[0]),
+                           V3D_QPU_PF_PUSHZ);
+                result = vir_MOV(c, vir_SEL(c, V3D_QPU_COND_IFNA,
+                                            vir_uniform_ui(c, ~0),
+                                            vir_uniform_ui(c, 0)));
                 break;
 
         case nir_op_iadd: