nv50/ir: optimize signed integer modulo by pow-of-2
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 11 Nov 2017 02:47:59 +0000 (21:47 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 26 Nov 2017 03:48:09 +0000 (22:48 -0500)
commit3079993727ddfe6b09e1f0ec8f834691fd654b46
tree5a6505098aa3b56b7656b2d6b19f3be646f51b93
parent676761252b731a6bf408e4dca694c31d74a995fc
nv50/ir: optimize signed integer modulo by pow-of-2

It's common to use signed int modulo in GLSL. As it happens, the GLSL
specs allow the result to be undefined, but that seems fairly
surprising. It's not that much more effort to get it right, at least for
positive modulo operators.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp