From de656a6afabb7c61a13d45d6fd2e2680dd435ecb Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Thu, 9 May 2024 18:47:33 +0200 Subject: [PATCH] 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: (cherry picked from commit 925fff229fdc963a02348c59ef30ebc3f814d59f) --- .pick_status.json | 2 +- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ec6c28f0ab8..de3f1a27048 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -384,7 +384,7 @@ "description": "zink: use bitcasts instead of pack/unpack double opcodes", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index 88ced74699f..ffcc49bbc16 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -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;