Mesa (master): i965 new VS: Fix copy propagation of double negatives.
Paul Berry
stereotype441 at kemper.freedesktop.org
Mon Sep 19 17:25:12 UTC 2011
Module: Mesa
Branch: master
Commit: 20da49b2677fcf6a721b8a46e037a01e842fee61
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=20da49b2677fcf6a721b8a46e037a01e842fee61
Author: Paul Berry <stereotype441 at gmail.com>
Date: Wed Sep 14 17:06:35 2011 -0700
i965 new VS: Fix copy propagation of double negatives.
When copy propagating a value into an instruction that negates its
argument, we need to invert the sense of the value's "negate" flag, so
that -(+x) becomes -x and -(-x) becomes +x.
Previously, we were always setting the value's "negate" flag to true
in this circumstance, so that both -(+x) and -(-x) turned into -x.
Fixes Piglit test vs-double-negative.shader_test.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
.../drivers/dri/i965/brw_vec4_copy_propagation.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index c46735a..e0b2d2a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -196,7 +196,7 @@ try_copy_propagation(struct intel_context *intel,
value.abs = true;
}
if (inst->src[arg].negate)
- value.negate = true;
+ value.negate = !value.negate;
/* FINISHME: We can't copy-propagate things that aren't normal
* vec8s into gen6 math instructions, because of the weird src
More information about the mesa-commit
mailing list