Mesa (10.1): i965/fs: Fix off-by-one in saturate propagation.

Carl Worth cworth at kemper.freedesktop.org
Wed Apr 16 00:55:46 UTC 2014


Module: Mesa
Branch: 10.1
Commit: 37c4ba3e6914ae753e2a5e5410ad2e4b933872bf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=37c4ba3e6914ae753e2a5e5410ad2e4b933872bf

Author: Matt Turner <mattst88 at gmail.com>
Date:   Thu Apr  3 10:35:09 2014 -0700

i965/fs: Fix off-by-one in saturate propagation.

ip needs to be initialized to start_ip - 1, since the first thing in the
main loop is ip++. Otherwise we would incorrectly propagate the saturate
from the mov to the mad:

   mad     a, b, c, d
   mov.sat x, a
   add     y, z, a

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit 86ae6f477d24169cbc27d53c57d5d024d73e4e4a)

---

 src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
index 189888e..eaecb45 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp
@@ -32,7 +32,7 @@ static bool
 opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
 {
    bool progress = false;
-   int ip = block->start_ip;
+   int ip = block->start_ip - 1;
 
    for (fs_inst *inst = (fs_inst *)block->start;
         inst != block->end->next;




More information about the mesa-commit mailing list