spirv: Implement IsInf using an integer comparison
Since we already do fabs on the one source, we're guaranteed to get positive infinity if we get any infinity at all. Since +inf only has one IEEE 754 representation, we can use an integer comparison and avoid all of the ordered/unordered issues. Cc: Dave Airlie <airlied@redhat.com> Reviewed-by: Elie Tournier <elie.tournier@collabora.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:

committed by
Dave Airlie

parent
e0208949d1
commit
fcca6a83cd
@@ -447,7 +447,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
|
||||
break;
|
||||
|
||||
case SpvOpIsInf:
|
||||
val->ssa->def = nir_feq(&b->nb, nir_fabs(&b->nb, src[0]),
|
||||
val->ssa->def = nir_ieq(&b->nb, nir_fabs(&b->nb, src[0]),
|
||||
nir_imm_float(&b->nb, INFINITY));
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user