From: Jesse Natalie Date: Wed, 24 Jun 2020 17:58:36 +0000 (-0700) Subject: nir/vtn: Support OpOrdered and OpUnordered opcodes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=80163bbec3a3c0a9d566b4a562b720639fbdcf96;p=mesa.git nir/vtn: Support OpOrdered and OpUnordered opcodes Reviewed-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Reviewed-by: Karol Herbst Part-of: --- diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c index 41be1a18dc8..e92a48f24a6 100644 --- a/src/compiler/spirv/vtn_alu.c +++ b/src/compiler/spirv/vtn_alu.c @@ -516,6 +516,16 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode, dest->def = nir_fne(&b->nb, src[0], src[0]); break; + case SpvOpOrdered: + dest->def = nir_iand(&b->nb, nir_feq(&b->nb, src[0], src[0]), + nir_feq(&b->nb, src[1], src[1])); + break; + + case SpvOpUnordered: + dest->def = nir_ior(&b->nb, nir_fne(&b->nb, src[0], src[0]), + nir_fne(&b->nb, src[1], src[1])); + break; + case SpvOpIsInf: { nir_ssa_def *inf = nir_imm_floatN_t(&b->nb, INFINITY, src[0]->bit_size); dest->def = nir_ieq(&b->nb, nir_fabs(&b->nb, src[0]), inf);