diff options
author | Eric Anholt <eric@anholt.net> | 2011-10-03 15:12:10 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-10-20 09:50:49 -0700 |
commit | 73b0a28ba8b3e2ab917d4c729f34ddbde52c9e88 (patch) | |
tree | f8a61f62ec775c558e3acc2b2a081374f471a13c /src/mesa/drivers/dri/i965/brw_fs.cpp | |
parent | 55c5ad8dfa68c18589f19fba2d1bfecd425785c9 (diff) | |
download | external_mesa3d-73b0a28ba8b3e2ab917d4c729f34ddbde52c9e88.zip external_mesa3d-73b0a28ba8b3e2ab917d4c729f34ddbde52c9e88.tar.gz external_mesa3d-73b0a28ba8b3e2ab917d4c729f34ddbde52c9e88.tar.bz2 |
i965/fs: Fix comparisions with uint negation.
The condmod instruction ends up generating garbage condition codes,
because apparently the comparison happens on the accumulator value (33
bits for UD), not the truncated value that would be written.
Fixes fs-op-neg-*
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 7386106..c0d93c0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1347,6 +1347,19 @@ fs_visitor::register_coalesce() interfered = true; break; } + + /* The accumulator result appears to get used for the + * conditional modifier generation. When negating a UD + * value, there is a 33rd bit generated for the sign in the + * accumulator value, so now you can't check, for example, + * equality with a 32-bit value. See piglit fs-op-neg-uint. + */ + if (scan_inst->conditional_mod && + inst->src[0].negate && + inst->src[0].type == BRW_REGISTER_TYPE_UD) { + interfered = true; + break; + } } if (interfered) { continue; |