Module: Mesa
Branch: main
Commit: 955797d01566bac49b9f49eadcd075f3cb7c5291
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=955797d01566bac49b9f49eadcd075f3cb7c5291

Author: Erik Faye-Lund <[email protected]>
Date:   Sun Apr 30 12:15:31 2023 +0200

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22774>

---

 src/compiler/nir/nir_opcodes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index bc263806c18..c3c4ea294d3 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)")

Reply via email to