Add rhadd builtin
authorAaron Watry <awatry@gmail.com>
Thu, 15 Aug 2013 19:21:10 +0000 (19:21 +0000)
committerAaron Watry <awatry@gmail.com>
Thu, 15 Aug 2013 19:21:10 +0000 (19:21 +0000)
commit8548725f290ddae3feef2a15fc672010087c939b
tree95383b79784807889e58b6e3e453faafd9ab07ff
parent7659157f1b926321530a44ce8fc7a39a0360a08e
Add rhadd builtin

rhadd = (x+y+1)>>1

Implemented as:
(x>>1) + (y>>1) + ((x&1)|(y&1))

This prevents us having to do assembly addition and overflow detection

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188477
libclc/generic/include/clc/clc.h
libclc/generic/include/clc/integer/rhadd.h [new file with mode: 0644]
libclc/generic/include/clc/integer/rhadd.inc [new file with mode: 0644]
libclc/generic/lib/SOURCES
libclc/generic/lib/integer/rhadd.cl [new file with mode: 0644]
libclc/generic/lib/integer/rhadd.inc [new file with mode: 0644]