glsl: Implement usubBorrow() built-in for ARB_gpu_shader5.
authorMatt Turner <mattst88@gmail.com>
Wed, 18 Sep 2013 01:02:05 +0000 (18:02 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 7 Oct 2013 17:41:16 +0000 (10:41 -0700)
commit6f9428eb68bb0f7592f4384455fc7aab23940d92
tree4c84da7111570d6bd02b07122bda7414d8273d36
parent6c125973f31addf903921647e8244abccb944e1a
glsl: Implement usubBorrow() built-in for ARB_gpu_shader5.

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

Radeon has an SUBB_UINT instruction that only generates the borrow
bit. I've chosen to go this route and implement usubBorrow() by doing the
subtraction and the borrow operations separately.

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