summaryrefslogtreecommitdiffstats
path: root/libclc
Commit message (Collapse)AuthorAgeFilesLines
...
* atomic: Add generic atomic_min implementationAaron Watry2014-09-168-0/+54
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217916
* atomic: Add generic atom[ic]_xorAaron Watry2014-09-168-0/+43
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217915
* atomic: Add atom[ic]_orAaron Watry2014-09-168-0/+41
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217914
* atomics: Add generic atom[ic]_andAaron Watry2014-09-168-0/+42
| | | | | | | | Not used yet. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217913
* atomic: Add generic implementation of atom[ic]_maxAaron Watry2014-09-168-0/+58
| | | | | | | | | | Not used yet... v2: Correct int/uint behavior Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217912
* atomic: define extension functions for existing atomic implementationsAaron Watry2014-09-1610-0/+54
| | | | | | | | We were missing the local versions of the atom_* before Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217911
* math: Add tan implementationAaron Watry2014-09-106-0/+21
| | | | | | | | | | | | | | | | | Uses the algorithm: tan(x) = sin(x) / sqrt(1-sin^2(x)) An alternative is: tan(x) = sin(x) / cos(x) Which produces more verbose bitcode and longer assembly. Either way, the generated bitcode seems pretty nasty and a more optimized but still precise-enough solution is welcome. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 217511
* math: Add asin implementationAaron Watry2014-09-106-0/+16
| | | | | | | | | | | | | | asin(x) = atan2(x, sqrt( 1-x^2 )) alternatively: asin(x) = PI/2 - acos(x) Use the atan2 implementation since it produces slightly shorter bitcode and R600 machine code. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 217510
* math: Add acos implementationAaron Watry2014-09-106-0/+34
| | | | | | | | | | Passes the tests that were submitted to the piglit list Tested on R600 (Pitcairn) Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 217509
* add isordered builtinJan Vesely2014-09-054-0/+34
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217247
* add isunordered builtinJan Vesely2014-09-054-0/+33
| | | | | | | | v2: remove trailing newline Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217246
* add islessgreater builtinJan Vesely2014-09-054-0/+31
| | | | | | | | v2: remove trailing newline Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217245
* add isnormal builtinJan Vesely2014-09-054-0/+29
| | | | | | | | | v2: simplify and remove isnan leftovers remove trailing newline Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217244
* add isfinite builtinJan Vesely2014-09-054-0/+29
| | | | | | | | | v2: simplify and remove isinf leftovers remove trailing newline Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217243
* Implement isinf builtinTom Stellard2014-09-034-0/+41
| | | | llvm-svn: 217046
* Fix implementation of copysignTom Stellard2014-09-034-1/+16
| | | | | | | | | This was previously implemented with a macro and we were using __builtin_copysign(), which takes double inputs for the float version of copysign(). Reviewed-and-Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217045
* Implement generic mad_satJan Vesely2014-09-026-0/+100
| | | | | | | | | | | | v2: Fix trailing whitespace Fix signed long overflow improve comment v3: fix typo Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 216923
* configure: Add rpath to prepare-builtins utilJan Vesely2014-09-021-1/+2
| | | | | | | | v2: use space instead of '=' to make Mac happy Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Jeroen Ketema <j.ketema@imperial.ac.uk> llvm-svn: 216922
* Fix build against LLVM SVN >= r216488Michel Danzer2014-08-281-0/+5
| | | | | Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 216654
* Fix build against LLVM SVN >= r216393Michel Danzer2014-08-281-0/+13
| | | | | Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 216653
* Revert "Implement generic mad_sat"Aaron Watry2014-08-236-100/+0
| | | | | | | | This reverts commit cf62eded8b623a1c10d3692d25e5882b7939f564. I didn't mean to commit this... Jan has a v3 incoming llvm-svn: 216322
* Add int3/uint3 to integer-gentype.incAaron Watry2014-08-231-0/+8
| | | | | | | | These were missing and caused mad24/mul24 with int3/uint3 arg type to fail Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 216321
* Implement generic mad_satAaron Watry2014-08-236-0/+100
| | | | | | | | | v2: Fix trailing whitespace Fix signed long overflow improve comment Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu> llvm-svn: 216320
* Include llvm-config.h instead of config.hNiels Ole Salscheider2014-08-221-1/+1
| | | | | | Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 216296
* Add missing file from r216127Tom Stellard2014-08-201-0/+204
| | | | llvm-svn: 216128
* Implement prefetch builtinTom Stellard2014-08-206-0/+18
| | | | | | | The default implementation is a no-op. Targets should override this with their own implementations. llvm-svn: 216127
* R600: Add aliases for hainan and mullinsTom Stellard2014-08-201-1/+1
| | | | llvm-svn: 216126
* vload/vstore: Use casts instead of scalarizing everything in CLC versionAaron Watry2014-08-208-377/+21
| | | | | | | | | | | | | | | This generates bitcode which is indistinguishable from what was hand-written for int32 types in v[load|store]_impl.ll. v4: Use vec2+scalar for vec3 load/stores to prevent corruption (per Tom) v3: Also remove unused generic/lib/shared/v[load|store]_impl.ll v2: (Per Matt Arsenault) Fix alignment issues with vector load stores Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: Matt Arsenault <Matthew.Arsenault@amd.com> CC: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 216069
* relational: Add islessequal(floatN) builtinJan Vesely2014-08-014-0/+31
| | | | | | | | v2: remove the initial undef Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 214568
* relational: Add isless(floatN) builtinJan Vesely2014-08-014-0/+31
| | | | | | | | v2: remove the initial undef Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 214567
* Implement sin builtin for float typesTom Stellard2014-07-234-6/+75
| | | | | | This double version still uses @llvm.sin. llvm-svn: 213762
* Implement cos builtin for float typesTom Stellard2014-07-236-6/+406
| | | | | | The double version still uses @llvm.cos. llvm-svn: 213761
* Implement atan2 builtinTom Stellard2014-07-236-0/+132
| | | | llvm-svn: 213760
* Implement atan builtinTom Stellard2014-07-236-0/+296
| | | | llvm-svn: 213759
* Add several missing double constant definitionsAaron Watry2014-07-171-0/+11
| | | | | | | | | | | These were present in CL 1.0, just not implemented yet. v2: Use hex values and fix commit message Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jeroen Ketema <j.ketema@imperial.ac.uk> CC: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 213321
* relational: Implement isnotequalAaron Watry2014-07-174-0/+34
| | | | | | | | v2: Use relational macros instead of hand-rolled ones Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 213320
* relational: Implement isgreaterequalAaron Watry2014-07-174-0/+33
| | | | | | | | v2: Use relational macros instead of hand-rolled macros Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 213319
* relational: Implement isgreaterAaron Watry2014-07-174-0/+33
| | | | | | | | v2: Use relational macros instead of hand-rolled macros Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 213318
* relational/signbit: Refactor to use relational macrosAaron Watry2014-07-172-85/+8
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 213317
* Fix isnan definition for vector resultsAaron Watry2014-07-171-3/+3
| | | | | | | | | Vector true is -1, not 1, which means we need to use the relational unary macro instead of the normal unary builtin one. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 213316
* relational: create re-usable macros for relational declarationsAaron Watry2014-07-174-0/+200
| | | | | | | | | | | | | | | | | | relational.h includes relational macros for defining functions which need to return 1 for scalar true and -1 for vector true. I believe that this is the only place that this behavior is required, so the macro is placed at its lowest useful level (same directory as it is used in). This also creates re-usable unary/binary declaration and floatn includes which should simplify relational builtin declarations. Mostly patterned off of include/math/[binary_decl|unary_decl|floatn].inc but with required changes for relational functions. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 213315
* prepare-builtins: Fix broken build due to recent LLVM API changeTom Stellard2014-07-071-0/+7
| | | | llvm-svn: 212470
* OpenCL 1.1 does not define CL_VERSION_1_2 so use hardcoded number insteadJeroen Ketema2014-06-262-4/+4
| | | | | | | | Otherwise the test evaluates to true on OpenCL 1.1 and earlier. Since we therefore cannot use the CL_VERSION_?_? macros move them to the proper position in the top-level header. llvm-svn: 211787
* relational: Fix signbitAaron Watry2014-06-251-7/+7
| | | | | | | | | The vector components were mistakenly using () instead of {}, which caused all but the last vector component to be dropped on the floor. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jeroen Ketema <j.ketema@imperial.ac.uk> llvm-svn: 211733
* relational: Implement signbitAaron Watry2014-06-254-0/+107
| | | | | | | | | | | v2 Changes: - use __builtin_signbit instead of shifting by hand - significantly improve vector shuffling - Works correctly now for signbit(float16) on radeonsi Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 211696
* Add exp10Jeroen Ketema2014-06-256-0/+31
| | | | | Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211680
* Add half limitsJeroen Ketema2014-06-241-0/+15
| | | | | | | | | | | These are apparently only defined in OpenCL 1.2. HALF_MAX, HALF_MIN and HALF_EPSILON are currently omitted. Clang does not seem to support the ‘h’ suffix for half float constants even with the cl_khr_fp16 extension enabled. Reviewed-by: Tom Sellard <tom@stellard.net> llvm-svn: 211579
* Introduce CLC_VERSION macros v2Jeroen Ketema2014-06-242-0/+11
| | | | | | | | | Add these out-of-order in clc.h so we can use these in other headers. v2: Take into account the lack of a definition in OpenCL 1.0 Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211578
* Add MAXFLOATJeroen Ketema2014-06-241-5/+6
| | | | | | | Align definitions while we are here. Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211577
* Move clcmacro.h to avoid cluttering user namespace v2Jeroen Ketema2014-06-2411-3/+9
| | | | | | | | | v2: - use quotes instead of <> - add include to r600/lib/math/nextafter.c changed Reviewed-by: Tom Stellard <tom@stellard.net> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 211576
OpenPOWER on IntegriCloud