v3d: Translate f2i(fround_even) as FTOIN.

This appears to be just what the opcode does.  Needed for equivalence when
moving FF VPM stores into NIR.
This commit is contained in:
Eric Anholt
2019-02-23 11:21:26 -08:00
parent a4f612b4cf
commit a9dd227a47
+9 -2
View File
@@ -866,9 +866,16 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr)
result = vir_FMAX(c, src[0], src[1]);
break;
case nir_op_f2i32:
result = vir_FTOIZ(c, src[0]);
case nir_op_f2i32: {
nir_alu_instr *src0_alu = ntq_get_alu_parent(instr->src[0].src);
if (src0_alu && src0_alu->op == nir_op_fround_even) {
result = vir_FTOIN(c, ntq_get_alu_src(c, src0_alu, 0));
} else {
result = vir_FTOIZ(c, src[0]);
}
break;
}
case nir_op_f2u32:
result = vir_FTOUZ(c, src[0]);
break;