zink: use bitcasts instead of pack/unpack double opcodes

The pack/unpack double opcodes may flush denorms, and the nir ops are pure
bitcasts.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29125>
This commit is contained in:
Georg Lehmann 2024-05-09 18:47:33 +02:00
parent 146ac5169d
commit 925fff229f

View file

@ -1915,13 +1915,7 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
result = emit_builtin_unop(ctx, GLSLstd450PackHalf2x16, get_def_type(ctx, &alu->def, nir_type_uint), src[0]);
break;
case nir_op_unpack_64_2x32:
assert(nir_op_infos[alu->op].num_inputs == 1);
result = emit_builtin_unop(ctx, GLSLstd450UnpackDouble2x32, get_def_type(ctx, &alu->def, nir_type_uint), src[0]);
break;
BUILTIN_UNOPF(nir_op_unpack_half_2x16, GLSLstd450UnpackHalf2x16)
BUILTIN_UNOPF(nir_op_pack_64_2x32, GLSLstd450PackDouble2x32)
#undef BUILTIN_UNOP
#undef BUILTIN_UNOPF
@ -2107,9 +2101,11 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
/* those are all simple bitcasts, we could do better, but it doesn't matter */
case nir_op_pack_32_4x8:
case nir_op_pack_32_2x16:
case nir_op_pack_64_2x32:
case nir_op_pack_64_4x16:
case nir_op_unpack_32_4x8:
case nir_op_unpack_32_2x16:
case nir_op_unpack_64_2x32:
case nir_op_unpack_64_4x16: {
result = emit_bitcast(ctx, dest_type, src[0]);
break;