From f35ed83b82c830822391194024d81f4da2ba7c61 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Mon, 16 Sep 2024 20:16:24 +0200 Subject: [PATCH] nir/instr_set: fix fp_fast_math We can't just ignore the flags of the match, we need the union. Fixes: 666647acaed ("nir: track some float controls bits per instruction") Reviewed-by: Faith Ekstrand Part-of: (cherry picked from commit a3d6a770c0ca17e1d0ac69a614c945712ac8d4c1) --- .pick_status.json | 2 +- src/compiler/nir/nir_instr_set.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index b16649ca2e7..bd2c5a7d0d7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -464,7 +464,7 @@ "description": "nir/instr_set: fix fp_fast_math", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "666647acaedb1b4112f19192b992b05547975dfa", "notes": null diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c index a43efe025df..2ce6c3e7ec4 100644 --- a/src/compiler/nir/nir_instr_set.c +++ b/src/compiler/nir/nir_instr_set.c @@ -771,10 +771,10 @@ nir_instr_set_add_or_rewrite(struct set *instr_set, nir_instr *instr, * exactly identical in every other way so, once we've set the exact * bit, they are the same. */ - if (instr->type == nir_instr_type_alu && nir_instr_as_alu(instr)->exact) - nir_instr_as_alu(match)->exact = true; - if (instr->type == nir_instr_type_alu) - nir_instr_as_alu(match)->fp_fast_math = nir_instr_as_alu(instr)->fp_fast_math; + if (instr->type == nir_instr_type_alu) { + nir_instr_as_alu(match)->exact |= nir_instr_as_alu(instr)->exact; + nir_instr_as_alu(match)->fp_fast_math |= nir_instr_as_alu(instr)->fp_fast_math; + } nir_def_rewrite_uses(def, new_def);