gallivm: fix unsigned divide and remainder opcodes
authorZack Rusin <zackr@vmware.com>
Tue, 9 Apr 2013 10:28:48 +0000 (03:28 -0700)
committerZack Rusin <zackr@vmware.com>
Wed, 10 Apr 2013 19:31:22 +0000 (12:31 -0700)
commit7466e0b6c84ce0c6029e60739daac8baeccb8b0b
treeab55213bdf4ee938bca1ac94f0bc6cfe5bbed3c3
parent1ad4a4eeb3fe83ce3ce7336250d725bf0a28de7b
gallivm: fix unsigned divide and remainder opcodes

We want to both make sure we never divide by zero to not generate
sigfpe and that divide by zero is guaranteed to return 0xffffffff.
Based on José idea.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c