nir/lower_fp16_casts: Fix SSA dominance

Fixes: 01dfd65 ("nir: port fp16 casting code from dxil")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22804>
(cherry picked from commit 5503a08583)
This commit is contained in:
Konstantin Seurer 2023-05-02 19:56:44 +02:00 committed by Dylan Baker
parent 68da75ebf9
commit dbafe97b7a
2 changed files with 3 additions and 2 deletions

View file

@ -5664,7 +5664,7 @@
"description": "nir/lower_fp16_casts: Fix SSA dominance",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "01dfd65a2d407dd95ac472e7e80e736bc7a8fc57",
"notes": null

View file

@ -126,10 +126,11 @@ float_to_half_impl(nir_builder *b, nir_ssa_def *src, nir_rounding_mode mode)
nir_push_else(b, NULL);
}
nir_ssa_def *zero = nir_imm_int(b, 0);
nir_push_if(b, nir_ige(b, abs, nir_imm_int(b, 113 << 23)));
/* FP16 will be normal */
nir_ssa_def *zero = nir_imm_int(b, 0);
nir_ssa_def *value = nir_ior(b,
nir_ishl(b,
nir_isub(b,