r600: Initial support

This includes a get_global_id() implementation and function stubs for
the other workitem and synchronization functions.

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184975 91177308-0d34-0410-b5e6-96231b3b80d8
r600: Fix get_global_id implementation

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184976 91177308-0d34-0410-b5e6-96231b3b80d8
r600: Add get_global_size() implementation

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184977 91177308-0d34-0410-b5e6-96231b3b80d8
Move R600 headers into generic directory

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184978 91177308-0d34-0410-b5e6-96231b3b80d8
PTX: move implementations of work-item and synchronisation functions
to lib, and add header files in generic.  Incorporates a patch by
Tom Stellard!

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184979 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Replace cl implementations with LLVM IR implementation

This allows libclc to be built for R600 with upstream clang and LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184980 91177308-0d34-0410-b5e6-96231b3b80d8
Make libclc more Linux FHS conform.

- First introducing a versioning scheme
- Add --libexecdir, --includedir and --pkgconfigdir and prefill them as well as --prefix
- Build all targets by default
- Create clc.pc and install it in $pkgconfigdir
- Use clang++ instead of c++
- Rename builtins.bc to built_libs/$triple.bc and install them in $libexecdir
- Includes are installed recursively to $includedir
- Finally add $(DESTDIR) for 'make install'

Patch by: Johannes Obermayr

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184981 91177308-0d34-0410-b5e6-96231b3b80d8
Allow targets to override generic implementations

Targets can override generic implementations by adding a file called
OVERRIDES in $(TARGET_DIR)/lib and listing the generic implementations
that it wants to override.  For example, to override get_group_id() and
get_global_size() you would add these lines to the OVERRIDES file:

workitem/get_group_id.cl
workitem/get_global_size.cl

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184982 91177308-0d34-0410-b5e6-96231b3b80d8
r600: Add overrides file

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184983 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo in include/clc/geometric/length.inc

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184984 91177308-0d34-0410-b5e6-96231b3b80d8
Use brackets around include files in length.cl and normalize.cl

These functions were not being compiled

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184985 91177308-0d34-0410-b5e6-96231b3b80d8
Remove the static keyword from the _CLC_INLINE macro

static functions are not allowed in OpenCL C

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184986 91177308-0d34-0410-b5e6-96231b3b80d8
Implement fmax() and fmin() builtins

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184987 91177308-0d34-0410-b5e6-96231b3b80d8
Implement ceil() builtin

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184988 91177308-0d34-0410-b5e6-96231b3b80d8
Fix build with LLVM 3.3

Patch by: Niels Ole Salscheider

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184989 91177308-0d34-0410-b5e6-96231b3b80d8
configure: fix out-of-source build

Patch by: Niels Ole Salscheider

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184990 91177308-0d34-0410-b5e6-96231b3b80d8
configure: Enable building separate libraries for target variants

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184991 91177308-0d34-0410-b5e6-96231b3b80d8
libclc: Add max() builtin function

Adds this function for both int and floating data types.

Patch by: Aaron Watry

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184992 91177308-0d34-0410-b5e6-96231b3b80d8
libclc: Fix abs_diff builtin integer function

Patch by: Aaron Watry

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184993 91177308-0d34-0410-b5e6-96231b3b80d8
libclc: Add clamp() builtin for integer/floating point

Created under a new shared/ directory for functions which are available for
both integer and floating point types.

Patch by: Aaron Watry

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184994 91177308-0d34-0410-b5e6-96231b3b80d8