From 4ecdc5ec4e283b2f85562b7f9200eda7482b4a1c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 8 Oct 2020 13:17:56 +1000 Subject: [PATCH] gallivm: fix 64->16 f2f16 llvm appears to callout to a library to do 64-bit->16-bit fp trunc, just trunc to 32-bit first to avoid it. Reviewed-by: Roland Scheidegger Part-of: --- .gitlab-ci/piglit/cl.txt | 12 +++--------- src/gallium/auxiliary/gallivm/lp_bld_nir.c | 3 +++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci/piglit/cl.txt b/.gitlab-ci/piglit/cl.txt index ecd8d6e6698..8b693ca5760 100644 --- a/.gitlab-ci/piglit/cl.txt +++ b/.gitlab-ci/piglit/cl.txt @@ -194,18 +194,12 @@ program/execute/vload/vload-half-private: skip program/execute/vstore/vstore-half-global: skip program/execute/vstore/vstore-half-local: skip program/execute/vstore/vstore-half-private: skip -program/execute/vstore/vstore_half-double-global: crash -program/execute/vstore/vstore_half-double-local: crash -program/execute/vstore/vstore_half-double-private: crash -program/execute/vstore/vstorea_half-double-global: crash -program/execute/vstore/vstorea_half-double-local: crash -program/execute/vstore/vstorea_half-double-private: crash summary: name: results ---- -------- - pass: 3560 + pass: 3627 fail: 107 - crash: 18 + crash: 12 skip: 73 timeout: 4 warn: 0 @@ -215,4 +209,4 @@ summary: changes: 0 fixes: 0 regressions: 0 - total: 3762 + total: 3823 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 2805434f16a..7c4db4fcd29 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -492,6 +492,9 @@ static LLVMValueRef do_alu_action(struct lp_build_nir_context *bld_base, result = flt_to_bool32(bld_base, src_bit_size[0], src[0]); break; case nir_op_f2f16: + if (src_bit_size[0] == 64) + src[0] = LLVMBuildFPTrunc(builder, src[0], + bld_base->base.vec_type, ""); result = LLVMBuildFPTrunc(builder, src[0], LLVMVectorType(LLVMHalfTypeInContext(gallivm->context), bld_base->base.type.length), ""); break;