Mesa (master): ac: fix nir_op_f2f64

Timothy Arceri tarceri at kemper.freedesktop.org
Wed Dec 13 02:20:42 UTC 2017


Module: Mesa
Branch: master
Commit: a5f9ac29282a39bad3cf1324557b1caaff37b4fb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5f9ac29282a39bad3cf1324557b1caaff37b4fb

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Tue Dec 12 16:10:24 2017 +1100

ac: fix nir_op_f2f64

Without this we get the error "FPExt only operates on FP" when
converting the following:

   vec1 32 ssa_5 = b2f ssa_4
   vec1 64 ssa_6 = f2f64 ssa_5

Which results in:

   %44 = and i32 %43, 1065353216
   %45 = fpext i32 %44 to double

With this patch we now get:

   %44 = and i32 %43, 1065353216
   %45 = bitcast i32 %44 to float
   %46 = fpext float %45 to double

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/common/ac_nir_to_llvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 3d26dd3752..f3602a267d 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1802,6 +1802,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 		result = LLVMBuildUIToFP(ctx->ac.builder, src[0], ac_to_float_type(&ctx->ac, def_type), "");
 		break;
 	case nir_op_f2f64:
+		src[0] = ac_to_float(&ctx->ac, src[0]);
 		result = LLVMBuildFPExt(ctx->ac.builder, src[0], ac_to_float_type(&ctx->ac, def_type), "");
 		break;
 	case nir_op_f2f32:




More information about the mesa-commit mailing list