glsl: Implement uaddCarry() built-in for ARB_gpu_shader5.
authorMatt Turner <mattst88@gmail.com>
Wed, 18 Sep 2013 00:44:03 +0000 (17:44 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 7 Oct 2013 17:41:16 +0000 (10:41 -0700)
commit6c125973f31addf903921647e8244abccb944e1a
tree6ac5ede66cb84b8d064f627cbbc6ab06a5430658
parent499d7a7f6e47403a4a3da448eddaf15bdf56395c
glsl: Implement uaddCarry() built-in for ARB_gpu_shader5.

i965 implements this with a single (multiple destination) instruction,
ADDC. Emitting ADDC directly from uaddCarry() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

Radeon has an ADDC_UINT instruction that only generates the carry
bit. I've chosen to go this route and implement uaddCarry() by doing the
addition and the carry operations separately.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/builtin_functions.cpp