Commit Graph

300 Commits

Author SHA1 Message Date
Tom Stellard 0bb381eaec libclc: implement rotate builtin
This implementation does a lot of bit shifting and masking. Suffice to say,
this is somewhat suboptimal... but it does look to produce correct results
(after the piglit tests were corrected for sign extension issues).

Someone who knows LLVM better than I could re-write this more efficiently.

Patch by: Aaron Watry

llvm-svn: 184996
2013-06-26 18:21:13 +00:00
Tom Stellard cb133c9322 libclc: Move max builtin to shared/
Max(x,y) is available for all integer/floating types.

Patch by: Aaron Watry

llvm-svn: 184995
2013-06-26 18:21:06 +00:00
Tom Stellard fe23a30ef5 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

llvm-svn: 184994
2013-06-26 18:20:56 +00:00
Tom Stellard cd88a4ebb6 libclc: Fix abs_diff builtin integer function
Patch by: Aaron Watry

llvm-svn: 184993
2013-06-26 18:20:50 +00:00
Tom Stellard ec87fb0b0c libclc: Add max() builtin function
Adds this function for both int and floating data types.

Patch by: Aaron Watry

llvm-svn: 184992
2013-06-26 18:20:46 +00:00
Tom Stellard 30f554b23d configure: Enable building separate libraries for target variants
llvm-svn: 184991
2013-06-26 18:20:38 +00:00
Tom Stellard 5668ea2d48 configure: fix out-of-source build
Patch by: Niels Ole Salscheider

llvm-svn: 184990
2013-06-26 18:20:35 +00:00
Tom Stellard 976577ecae Fix build with LLVM 3.3
Patch by: Niels Ole Salscheider

llvm-svn: 184989
2013-06-26 18:20:32 +00:00
Tom Stellard 207345820f Implement ceil() builtin
llvm-svn: 184988
2013-06-26 18:20:30 +00:00
Tom Stellard 509b3b2104 Implement fmax() and fmin() builtins
llvm-svn: 184987
2013-06-26 18:20:25 +00:00
Tom Stellard d84c7f5d0f Remove the static keyword from the _CLC_INLINE macro
static functions are not allowed in OpenCL C

llvm-svn: 184986
2013-06-26 18:20:18 +00:00
Tom Stellard 99bd71c4f5 Use brackets around include files in length.cl and normalize.cl
These functions were not being compiled

llvm-svn: 184985
2013-06-26 18:20:15 +00:00
Tom Stellard 560dbee27a Fix typo in include/clc/geometric/length.inc
llvm-svn: 184984
2013-06-26 18:20:12 +00:00
Tom Stellard 88812274dc r600: Add overrides file
llvm-svn: 184983
2013-06-26 18:20:08 +00:00
Tom Stellard d54f6ba7b8 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

llvm-svn: 184982
2013-06-26 18:20:05 +00:00
Tom Stellard 1de7761ed9 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

llvm-svn: 184981
2013-06-26 18:20:03 +00:00
Tom Stellard f2f5a86620 R600: Replace cl implementations with LLVM IR implementation
This allows libclc to be built for R600 with upstream clang and LLVM.

llvm-svn: 184980
2013-06-26 18:20:00 +00:00
Tom Stellard 10b6c22e8d PTX: move implementations of work-item and synchronisation functions
to lib, and add header files in generic.  Incorporates a patch by
Tom Stellard!

llvm-svn: 184979
2013-06-26 18:19:54 +00:00
Tom Stellard 9d804dae35 Move R600 headers into generic directory
llvm-svn: 184978
2013-06-26 18:19:50 +00:00
Tom Stellard 38f0ac9d5e r600: Add get_global_size() implementation
llvm-svn: 184977
2013-06-26 18:19:44 +00:00
Tom Stellard ac14c4e878 r600: Fix get_global_id implementation
llvm-svn: 184976
2013-06-26 18:19:39 +00:00
Tom Stellard 879327fcdc r600: Initial support
This includes a get_global_id() implementation and function stubs for
the other workitem and synchronization functions.

llvm-svn: 184975
2013-06-26 18:18:59 +00:00
NAKAMURA Takumi 43632a26a5 Update the copyright coredits -- Happy new year 2013!
llvm-svn: 171342
2013-01-01 10:00:19 +00:00
Peter Collingbourne db47eac37d Fix build against recent versions of Clang. Based on patch by Alastair Donaldson!
llvm-svn: 169362
2012-12-05 07:39:02 +00:00
Peter Collingbourne bf3fd44b10 Implement any() builtin. Patch by Tom Stellard!
llvm-svn: 165386
2012-10-08 03:39:21 +00:00
Peter Collingbourne df1fd9d92a Add native_powr builtin. Patch by Tom Stellard!
llvm-svn: 165385
2012-10-08 03:39:05 +00:00
Peter Collingbourne 7b0ad09cc3 Add barrier.cl to SOURCES, spotted by Jin Wang.
llvm-svn: 163227
2012-09-05 18:13:55 +00:00
Peter Collingbourne 354686be76 Add rsqrt builtin. Based on patch by Cassie Epps!
llvm-svn: 162274
2012-08-21 10:48:35 +00:00
Peter Collingbourne e1d91f73ec Add floor builtin. Patch by Cassie Epps!
llvm-svn: 162273
2012-08-21 10:48:21 +00:00
Peter Collingbourne 3cd1bcb358 Do not use linkonce_odr linkage in .ll files. This prevented them
from being linked into the library under lazy linkage.

llvm-svn: 161314
2012-08-05 22:25:48 +00:00
Peter Collingbourne a385c53413 PTX: move implementations of work-item and synchronisation functions
to lib, and add header files in generic.  Incorporates a patch by
Tom Stellard!

llvm-svn: 161313
2012-08-05 22:25:37 +00:00
Peter Collingbourne 1e373f07af Implement sub_sat builtin. Patch by Lei Mou!
llvm-svn: 161312
2012-08-05 22:25:12 +00:00
Peter Collingbourne 49b4d8cc65 Fix declarations of __clc_add_sat_*. Patch by Lei Mou!
llvm-svn: 161311
2012-08-05 22:24:36 +00:00
Peter Collingbourne bae6833419 configure.py: Add an install rule.
llvm-svn: 157821
2012-06-01 17:29:59 +00:00
Peter Collingbourne 64fe1c559e Add pow builtin.
llvm-svn: 157629
2012-05-29 17:42:56 +00:00
Peter Collingbourne 9acfba3322 Enable cl_khr_fp64 when building the library, and fix several bugs
uncovered when doing so.

llvm-svn: 157617
2012-05-29 13:35:54 +00:00
Peter Collingbourne 0144669d99 Add missing dot.h include.
llvm-svn: 157615
2012-05-29 13:35:45 +00:00
Peter Collingbourne 8f97a4363a Define FLOAT in floatn.inc.
llvm-svn: 157614
2012-05-29 13:35:35 +00:00
Peter Collingbourne de7227e5bd Add fma, hypot builtins.
llvm-svn: 157613
2012-05-29 13:35:28 +00:00
Peter Collingbourne b7fdecd2ec Implement mad builtin.
llvm-svn: 157599
2012-05-29 00:42:38 +00:00
Peter Collingbourne d3c242ae64 Implement exp, exp2, log, log2, native_exp, native_exp2, native_log,
native_log2.  Patch by Joshua Cranmer!

llvm-svn: 157598
2012-05-29 00:42:29 +00:00
Peter Collingbourne 8b3721b01d Fix typo in double precision case.
llvm-svn: 157597
2012-05-29 00:42:21 +00:00
Peter Collingbourne 6f154f16cd Add fabs builtin.
llvm-svn: 157595
2012-05-28 22:22:13 +00:00
Peter Collingbourne 44a079aa23 Add some tests which had heretofore evaded 'git add'.
llvm-svn: 157591
2012-05-28 20:42:59 +00:00
Peter Collingbourne 3a78a47ace Explicit conversions.
llvm-svn: 157590
2012-05-28 20:42:54 +00:00
Peter Collingbourne a3fc645609 Switch to the NVPTX backend.
llvm-svn: 157589
2012-05-28 20:42:15 +00:00
Peter Collingbourne 74790d6c29 Switch to BSD/MIT dual license.
llvm-svn: 151129
2012-02-22 04:47:39 +00:00
Peter Collingbourne bcd9a7d0e0 Test web page update.
llvm-svn: 150946
2012-02-20 01:32:12 +00:00
Peter Collingbourne 0d0ef78167 Update repository paths.
llvm-svn: 147757
2012-01-08 22:31:18 +00:00
Peter Collingbourne d5395fbf03 Initial commit.
llvm-svn: 147756
2012-01-08 22:09:58 +00:00