Commit Graph

141 Commits

Author SHA1 Message Date
Jeroen Ketema d253e66ec7 Fix breakage after r211259
While we are here introduce the proper headers for the error code.

Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 211432
2014-06-21 09:20:31 +00:00
Jeroen Ketema 09516fa27d Add pown
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 211211
2014-06-18 19:42:23 +00:00
Jeroen Ketema fdee0d3efe Add missing undefs
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 211210
2014-06-18 19:37:34 +00:00
Aaron Watry d9afe9def0 Fix definition of INFINITY and add NAN/HUGE_VAL[F]
v3: change __builtin_nanf() to __builtin_nanf("")
    This doesn't work yet, but it was agreed to commit as-is with the logic
    that "broken" is better than "completely missing" and this should be
    fixed in clang.

v2: use __builtin_inff() and also add nan/huge_val definitions

Signed-off-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 211065
2014-06-16 22:32:58 +00:00
Jeroen Ketema f3bd08ae63 Add remaining float constants
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 211062
2014-06-16 22:15:50 +00:00
Aaron Watry 50f518be65 Revert "clctypes.h: Don't rely on stddef.h for size_t and ptrdiff_t"
This reverts commit 4cf021ae67b6ea8cfd42aa76ce6f5e1c329e145a.

llvm-svn: 211049
2014-06-16 20:21:19 +00:00
Aaron Watry 6af2969a61 math: Implement mix builtin
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 211047
2014-06-16 19:53:59 +00:00
Aaron Watry f7f79d2a94 relational: Add isequal(floatN) builtin
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 211046
2014-06-16 19:53:57 +00:00
Aaron Watry e167db9238 Add all(igentype) builtin
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 211045
2014-06-16 19:53:54 +00:00
Aaron Watry c164fc384b clctypes.h: Don't rely on stddef.h for size_t and ptrdiff_t
llvm-svn: 211044
2014-06-16 19:53:52 +00:00
Jan Vesely bd37b6884c Add intptr types
Based on clang's stdint.h

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 210933
2014-06-13 19:43:18 +00:00
Jeroen Ketema e2a0f050d8 Add files forgotten in the previous commit
llvm-svn: 210896
2014-06-13 12:33:40 +00:00
Jeroen Ketema 82aaa41286 Implementations for exp(float) and exp(double) v2
Use separate implementations instead of a macro
to ensure the constant multiplied with is of
higher precision.

v2: Use the correct formula, spotted by Dan Liew <daniel.liew@imperial.ac.uk>

Reviewed-by: Aaron Warty <awatry@gmail.com>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 210891
2014-06-13 09:40:09 +00:00
Tom Stellard 0ab103422d prepare-builtins: Use std:: prefix for error_code
This fixes the build with with newer LLVM.

llvm-svn: 210867
2014-06-13 01:30:14 +00:00
Jeroen Ketema a3089bd7e5 Remove unused include which breaks build after r210803
Tested with llvm 3.4 and trunk.

llvm-svn: 210825
2014-06-12 21:10:17 +00:00
Jeroen Ketema f3943efe17 Fix build broken by LLVM commit r209103
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 210111
2014-06-03 15:43:57 +00:00
Jeroen Ketema 75c1a0c6e2 Add more log related float constants
llvm-svn: 209850
2014-05-29 21:30:28 +00:00
Jeroen Ketema d1bb82a722 Fix _F definitions
The 'f' was missing and, hence, the values were
considered to be doubles instead of floats.

Reviewed by: Tom Stellard

llvm-svn: 209849
2014-05-29 21:29:34 +00:00
Jeroen Ketema a16fdbfac2 Add definition for M_PI
Reviewed by: Tom Stellard

llvm-svn: 209848
2014-05-29 21:24:57 +00:00
Tom Stellard 98dccb109b Fix build broken by LLVM commit r207593
llvm-svn: 207685
2014-04-30 18:35:20 +00:00
Tom Stellard 998602dac2 Remove clc/gentype.inc
This file duplicates clc/math/gentype.inc and is not
actually being used.

Patch by: Jeroen Ketema

llvm-svn: 207684
2014-04-30 18:35:17 +00:00
Tom Stellard f83fe5a6dc Introduce M_LOG2E_F and M_LOG2E
Patch by: Jeroen Ketema

llvm-svn: 205055
2014-03-28 21:19:03 +00:00
Tom Stellard ce43db105e Replace tabs by spaces
Patch by: Jeroen Ketema

llvm-svn: 205054
2014-03-28 21:19:00 +00:00
Tom Stellard 6378f7a5e2 Add definition for M_PI_F v3
v2:
  - Use a hexadecimal constant.

v3:
  - Use a hexadecimal constant in floating-point notation.

llvm-svn: 204666
2014-03-24 20:36:44 +00:00
Tom Stellard 3a12fc6a07 Add sincos
Patch by: Jeroen Ketema

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 204478
2014-03-21 16:22:01 +00:00
Tom Stellard 074e7a8ed0 Add cross for double3 and double4
Patch by: Jeroen Ketema

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 204477
2014-03-21 16:21:58 +00:00
Tom Stellard 7aee1cfa99 Fix build since r202052
sys::fs_F_Binary has been replaced with sys::fs_F_Text

llvm-svn: 202081
2014-02-24 21:31:56 +00:00
Tom Stellard d873c8e05a Add generic nvptx targets
These do not import the code specific to nvidiacl

Patch by: Jeroen Ketema

llvm-svn: 201431
2014-02-14 20:33:53 +00:00
Tom Stellard 55d3746dbe Revert "Enforce python2 for systems that use python3 as their default."
This reverts commit r200413.

This was breaking the build on systems where the python 2.x executable
was called python.

llvm-svn: 201239
2014-02-12 14:54:17 +00:00
Tom Stellard 0d35ed912a Updated README.TXT with information about using DESTDIR and building with Ninja.
Patch by: Dan Liew

llvm-svn: 200416
2014-01-29 20:03:28 +00:00
Tom Stellard 8a3770ab97 Fixed rules names so they are unique when aliases are present.
This is necessary for building with Ninja because it does not allow
duplicate rule names.

Patch by: Dan Liew

llvm-svn: 200415
2014-01-29 20:03:27 +00:00
Tom Stellard 91d51db800 Fixed ninja build issues relating to use of $(DESTDIR)
We use ${DESTDIR} syntax now instead of $(DESTDIR) because that syntax
works both is the shell (at least it does for bash) and for make (at
least it does for GNU Make)

Patch By: Dan Liew

llvm-svn: 200414
2014-01-29 20:03:26 +00:00
Tom Stellard ac0fb621ce Enforce python2 for systems that use python3 as their default.
Patch by: Dan Liew

llvm-svn: 200413
2014-01-29 20:03:24 +00:00
Tom Stellard 8a63b15b3c Fix build broken by LLVM commit r199279
Patch by: Udo van den Heuvel

Tom Stellard:
  - Added ifdef and error handling

llvm-svn: 199687
2014-01-20 20:28:48 +00:00
NAKAMURA Takumi d40d387fb1 Update the copyright credits -- Happy new year 2014!
FIXME: Dragonegg may be updated at non-trivial changes.
llvm-svn: 198274
2014-01-01 08:27:31 +00:00
Aaron Watry 8ef48d07ef Pass -fno-builtin flag to clang to silence warnings
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 198168
2013-12-29 16:39:55 +00:00
Aaron Watry b38037f7b7 Fix build with LLVM 3.5
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 198167
2013-12-29 16:39:53 +00:00
Tom Stellard ce0709aa61 Add floating-point macro definitions v2
v2:
  - Fix typo.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 197784
2013-12-20 05:13:42 +00:00
Tom Stellard 1f3c9ba9f1 Implement trunc builtin.
OpenCL C lang says that trunc rounds towards zero.
llvm.trunc.* intrinsic rounds to integer not larger in magnitude.
These definitions are equivalent.

Patch by: Jan Vesely

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 197769
2013-12-20 02:08:46 +00:00
Tom Stellard 8bb6cb8009 Fix a C&P error in r195021 (65a950abab3cb8435ccb2646ac4773986c995c81)
Patch by: Kai Wasserbäch

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
llvm-svn: 195898
2013-11-28 00:17:29 +00:00
Tom Stellard eedd3064de R600: Add aliases for Sea Islands GPUs
llvm-svn: 195023
2013-11-18 18:21:30 +00:00
Tom Stellard 5abf149bf3 Implement round builtin
llvm-svn: 195022
2013-11-18 18:21:27 +00:00
Tom Stellard 457e35912e Implement builtins for cl_khr_global_int32_base_atomics extension
llvm-svn: 195021
2013-11-18 18:21:23 +00:00
Tom Stellard 3a9632d544 s/_CLC_DECL/_CLC_DEF/
Some function definitions were using _CLC_DECL, which meant that they
weren't being marked as always_inline.

Reviewed-by and Tested-by: Aaron Watry <awatry@gmail.com>

llvm-svn: 193754
2013-10-31 15:50:53 +00:00
Tom Stellard d2e83929a9 R600: Set the noduplicate attribute on barrier() intrinsics
This will prevent LLVM optimization passes from creating illegal uses
of the barrier() intrinsic (e.g. calling barrier() from a conditional
that is not executed by all threads).

llvm-svn: 193753
2013-10-31 15:50:48 +00:00
Tom Stellard 9fabcb3edb Clean-up dependency files
Patch by: Jeroen Ketema

llvm-svn: 193221
2013-10-23 02:49:33 +00:00
Tom Stellard 9f48bb3b9a Make C++ compiler configurable
The C++ compiler used to build prepare-builtins
may differ from the llvm/clang for which we are
building libclc.

Use 'clang++' as the default compiler.

Patch by: Jeroen Ketema

llvm-svn: 193220
2013-10-23 02:49:27 +00:00
Tom Stellard f21e3ea972 Port pocl's gen_convert.py script to libclc
This script generates implementations for the entire set of convert_*
functions,

llvm-svn: 192385
2013-10-10 19:09:01 +00:00
Tom Stellard 436bf70519 Implement sign() builtin
llvm-svn: 192384
2013-10-10 19:08:56 +00:00
Tom Stellard 6c7b86c106 Implement nextafter() builtin
There are two implementations of nextafter():
1. Using clang's __builtin_nextafter.  Clang replaces this builtin with
a call to nextafter which is part of libm.  Therefore, this
implementation will only work for targets with an implementation of
libm (e.g. most CPU targets).

2. The other implementation is written in OpenCL C.  This function is
known internally as __clc_nextafter and can be used by targets that
don't have access to libm.

llvm-svn: 192383
2013-10-10 19:08:51 +00:00