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 <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7309>
This commit is contained in:
Dave Airlie
2020-10-08 13:17:56 +10:00
parent 842a53913c
commit 4ecdc5ec4e
2 changed files with 6 additions and 9 deletions

View File

@@ -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

View File

@@ -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;