[Mesa-dev] [RFC 3/5] ac: add support for unordered float comparison opcodes

Timothy Arceri tarceri at itsqueeze.com
Wed Feb 14 06:29:19 UTC 2018


---
 src/amd/common/ac_nir_to_llvm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 8d1eed241f..a0c5680205 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1803,6 +1803,18 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 	case nir_op_fge:
 		result = emit_float_cmp(&ctx->ac, LLVMRealUGE, src[0], src[1]);
 		break;
+	case nir_op_ufeq:
+		result = emit_float_cmp(&ctx->ac, LLVMRealUEQ, src[0], src[1]);
+		break;
+	case nir_op_ufne:
+		result = emit_float_cmp(&ctx->ac, LLVMRealUNE, src[0], src[1]);
+		break;
+	case nir_op_uflt:
+		result = emit_float_cmp(&ctx->ac, LLVMRealULT, src[0], src[1]);
+		break;
+	case nir_op_ufge:
+		result = emit_float_cmp(&ctx->ac, LLVMRealUGE, src[0], src[1]);
+		break;
 	case nir_op_fabs:
 		result = emit_intrin_1f_param(&ctx->ac, "llvm.fabs",
 		                              ac_to_float_type(&ctx->ac, def_type), src[0]);
-- 
2.14.3



More information about the mesa-dev mailing list