4
0
mirror of https://github.com/revyos-package/mesa.git synced 2026-05-13 08:33:45 +00:00

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>
(cherry picked from commit 925fff229fdc963a02348c59ef30ebc3f814d59f)
This commit is contained in:
Georg Lehmann
2024-05-09 18:47:33 +02:00
committed by Eric Engestrom
parent 90012f1f66
commit 57198d2ca9
2 changed files with 3 additions and 7 deletions

View File

@@ -384,7 +384,7 @@
"description": "zink: use bitcasts instead of pack/unpack double opcodes", "description": "zink: use bitcasts instead of pack/unpack double opcodes",
"nominated": true, "nominated": true,
"nomination_type": 0, "nomination_type": 0,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null, "because_sha": null,
"notes": null "notes": null

View File

@@ -1933,13 +1933,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]); result = emit_builtin_unop(ctx, GLSLstd450PackHalf2x16, get_def_type(ctx, &alu->def, nir_type_uint), src[0]);
break; 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_unpack_half_2x16, GLSLstd450UnpackHalf2x16)
BUILTIN_UNOPF(nir_op_pack_64_2x32, GLSLstd450PackDouble2x32)
#undef BUILTIN_UNOP #undef BUILTIN_UNOP
#undef BUILTIN_UNOPF #undef BUILTIN_UNOPF
@@ -2125,9 +2119,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 */ /* 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_4x8:
case nir_op_pack_32_2x16: case nir_op_pack_32_2x16:
case nir_op_pack_64_2x32:
case nir_op_pack_64_4x16: case nir_op_pack_64_4x16:
case nir_op_unpack_32_4x8: case nir_op_unpack_32_4x8:
case nir_op_unpack_32_2x16: case nir_op_unpack_32_2x16:
case nir_op_unpack_64_2x32:
case nir_op_unpack_64_4x16: { case nir_op_unpack_64_4x16: {
result = emit_bitcast(ctx, dest_type, src[0]); result = emit_bitcast(ctx, dest_type, src[0]);
break; break;