From 2fc6efddd120170b6098fcc5445d25a1eb4447bd Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Sun, 30 Apr 2023 12:15:31 +0200 Subject: [PATCH] nir: fix constant-folding of 64-bit fpow We need to do full pow if 64-bit, and we can do fpow() otherwise. Not the other way around. Fixes: 9076c4e289d ("nir: update opcode definitions for different bit sizes") Reviewed-by: Faith Ekstrand Part-of: (cherry picked from commit 955797d01566bac49b9f49eadcd075f3cb7c5291) --- .pick_status.json | 2 +- src/compiler/nir/nir_opcodes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5f9b45b2f63..b84cfe7c172 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7444,7 +7444,7 @@ "description": "nir: fix constant-folding of 64-bit fpow", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "9076c4e289de0debf1fb2a7237bdeb9c11002347", "notes": null diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index c8cbe0ca477..39edf2e33ba 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -907,7 +907,7 @@ binop("fmax", tfloat, _2src_commutative + associative, "fmax(src0, src1)") binop("imax", tint, _2src_commutative + associative, "src1 > src0 ? src1 : src0") binop("umax", tuint, _2src_commutative + associative, "src1 > src0 ? src1 : src0") -binop("fpow", tfloat, "", "bit_size == 64 ? powf(src0, src1) : pow(src0, src1)") +binop("fpow", tfloat, "", "bit_size == 64 ? pow(src0, src1) : powf(src0, src1)") binop_horiz("pack_half_2x16_split", 1, tuint32, 1, tfloat32, 1, tfloat32, "pack_half_1x16(src0.x) | (pack_half_1x16(src1.x) << 16)")