<div dir="ltr">Reviewed-by: Bas Nieuwenhuizen <<a href="mailto:bas@basnieuwenhuizen.nl">bas@basnieuwenhuizen.nl</a>></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 31, 2018 at 11:23 AM, Samuel Pitoiset <span dir="ltr"><<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>><br>
---<br>
 src/amd/common/ac_nir_to_llvm.<wbr>c | 23 ++++++++++++++++-------<br>
 1 file changed, 16 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/amd/common/ac_nir_to_<wbr>llvm.c b/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
index fd5989389b..04fe51935a 100644<br>
--- a/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
+++ b/src/amd/common/ac_nir_to_<wbr>llvm.c<br>
@@ -1383,15 +1383,24 @@ static LLVMValueRef emit_isign(struct ac_llvm_context *ctx,<br>
 }<br>
<br>
 static LLVMValueRef emit_ffract(struct ac_llvm_context *ctx,<br>
-                               LLVMValueRef src0)<br>
+                               LLVMValueRef src0, unsigned bitsize)<br>
 {<br>
-       const char *intr = "llvm.floor.f32";<br>
+       LLVMTypeRef type;<br>
+       char *intr;<br>
+<br>
+       if (bitsize == 32) {<br>
+               intr = "llvm.floor.f32";<br>
+               type = ctx->f32;<br>
+       } else {<br>
+               intr = "llvm.floor.f64";<br>
+               type = ctx->f64;<br>
+       }<br>
+<br>
        LLVMValueRef fsrc0 = ac_to_float(ctx, src0);<br>
        LLVMValueRef params[] = {<br>
                fsrc0,<br>
        };<br>
-       LLVMValueRef floor = ac_build_intrinsic(ctx, intr,<br>
-                                               ctx->f32, params, 1,<br>
+       LLVMValueRef floor = ac_build_intrinsic(ctx, intr, type, params, 1,<br>
                                                AC_FUNC_ATTR_READNONE);<br>
        return LLVMBuildFSub(ctx->builder, fsrc0, floor, "");<br>
 }<br>
@@ -1845,7 +1854,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)<br>
                                              ac_to_float_type(&ctx->ac, def_type),src[0]);<br>
                break;<br>
        case nir_op_ffract:<br>
-               result = emit_ffract(&ctx->ac, src[0]);<br>
+               result = emit_ffract(&ctx->ac, src[0], instr->dest.dest.ssa.bit_size)<wbr>;<br>
                break;<br>
        case nir_op_fsin:<br>
                result = emit_intrin_1f_param(&ctx->ac, "llvm.sin",<br>
@@ -4026,8 +4035,8 @@ static LLVMValueRef load_sample_pos(struct ac_nir_context *ctx)<br>
 {<br>
        LLVMValueRef values[2];<br>
<br>
-       values[0] = emit_ffract(&ctx->ac, ctx->abi->frag_pos[0]);<br>
-       values[1] = emit_ffract(&ctx->ac, ctx->abi->frag_pos[1]);<br>
+       values[0] = emit_ffract(&ctx->ac, ctx->abi->frag_pos[0], 32);<br>
+       values[1] = emit_ffract(&ctx->ac, ctx->abi->frag_pos[1], 32);<br>
        return ac_build_gather_values(&ctx-><wbr>ac, values, 2);<br>
 }<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.16.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>