Attached is a patch to fix constant folding in the r300 compiler implemented in commit c704933 of Nicolai's r300g-glsl branch (git://anongit.freedesktop.org/~nh/mesa). With this patch, the constant folding implementation can be cherry-picked to master without breaking any piglit tests. -Tom