gallivm: don't optimize fadd(a, 0.0) with signed zero preserve

Fixes: 540e84bedb ("gallivm: Preserve -0 and nan")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40520>
This commit is contained in:
Georg Lehmann 2026-03-19 18:33:22 +01:00 committed by Marge Bot
parent c2fe95a364
commit 284b4143f7
2 changed files with 9 additions and 4 deletions

View file

@ -413,10 +413,12 @@ lp_build_add(struct lp_build_context *bld,
assert(lp_check_value(type, a));
assert(lp_check_value(type, b));
if (a == bld->zero)
return b;
if (b == bld->zero)
return a;
if (!type.floating || !type.signed_zero_preserve) {
if (a == bld->zero)
return b;
if (b == bld->zero)
return a;
}
if (a == bld->undef || b == bld->undef)
return bld->undef;

View file

@ -33,3 +33,6 @@ dEQP-VK.mesh_shader.ext.smoke.optimized_lib.depth_only_triangles_position_compon
dEQP-VK.memory.allocation.random.66,Crash
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8b8a8_unorm.input.dont_care.store.self_dep_clear_draw,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8b8a8_unorm.input.load.store.self_dep_clear_draw,Fail
# CTS bug
dEQP-VK.spirv_assembly.instruction.graphics.float_controls2.fp32.input_args.reflect_testedWithout_NSZ_arg1_minusZero_arg2_one_res_minusZero_deco_vert,Fail