Module: Mesa
Branch: master
Commit: 7820b2c071ec974d824c9b6dc3a0dd0ad1b77444
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7820b2c071ec974d824c9b6dc3a0dd0ad1b77444

Author: Connor Abbott <[email protected]>
Date:   Tue Aug  4 14:04:34 2015 -0700

nir: fix constant folding of bfi

Reviewed-by: Edward O'Callaghan <[email protected]>

---

 src/glsl/nir/nir_opcodes.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index 3c0f1da..729f695 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -563,7 +563,7 @@ opcode("bcsel", 0, tunsigned, [0, 0, 0],
       [tbool, tunsigned, tunsigned], "", "src0 ? src1 : src2")
 
 triop("bfi", tunsigned, """
-unsigned mask = src0, insert = src1 & mask, base = src2;
+unsigned mask = src0, insert = src1, base = src2;
 if (mask == 0) {
    dst = base;
 } else {
@@ -572,7 +572,7 @@ if (mask == 0) {
       tmp >>= 1;
       insert <<= 1;
    }
-   dst = (base & ~mask) | insert;
+   dst = (base & ~mask) | (insert & mask);
 }
 """)
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to