llvm-project/libclc/generic/lib
Tom Stellard d9ca1f1596 configure: Add --enable-runtime-subnormal option
This makes it possible for runtime implementations to disable
subnormal handling at runtime.

When this flag is enabled, decisions about how to handle subnormals
in the library will be controlled by an external variable called
__CLC_SUBNORMAL_DISABLE.

Function implementations should use these new helpers for querying subnormal
support:
__clc_fp16_subnormals_supported();
__clc_fp32_subnormals_supported();
__clc_fp64_subnormals_supported();

In order for the library to link correctly with this feature,
users will be required to either:

1. Insert this variable into the module (if using the LLVM/Clang C++/C APIs).

2. Pass either subnormal_disable.bc or subnormal_use_default.bc to the
linker.  These files are distributed with liblclc and installed to
$(installdir).  e.g.:

llvm-link -o kernel-out.bc kernel.bc builtins-nosubnormal.bc subnormal_disable.bc

or

llvm-link -o kernel-out.bc kernel.bc builtins-nosubnormal.bc subnormal_use_default.bc

If you do not supply the --enable-runtime-subnormal then the library
behaves the same as it did before this commit.

In addition to these changes, the patch adds helper functions that
should be used when implementing library functions that need
special handling for denormals:

__clc_fp16_subnormals_supported();
__clc_fp32_subnormals_supported();
__clc_fp64_subnormals_supported();

llvm-svn: 235329
2015-04-20 18:49:50 +00:00
..
async Implement async_work_group_copy builtin v3 2014-10-03 19:49:39 +00:00
atomic atomic: Add generic atom[ic]_cmpxchg 2014-09-16 22:34:49 +00:00
cl_khr_global_int32_base_atomics atomic: Add generic atom[ic]_cmpxchg 2014-09-16 22:34:49 +00:00
cl_khr_global_int32_extended_atomics atomic: Add generic atomic_min implementation 2014-09-16 22:34:41 +00:00
cl_khr_local_int32_base_atomics atomic: Add generic atom[ic]_cmpxchg 2014-09-16 22:34:49 +00:00
cl_khr_local_int32_extended_atomics atomic: Add generic atomic_min implementation 2014-09-16 22:34:41 +00:00
common Move mix from math to common 2015-03-03 21:25:08 +00:00
geometric Implement fast_distance builtin 2015-03-23 18:10:04 +00:00
integer Implement generic mad_sat 2014-09-02 17:55:02 +00:00
math Implement atanh builtin 2015-04-07 16:20:22 +00:00
relational Fix bitselect for float/double types v2 2015-03-05 15:31:05 +00:00
shared vload/vstore: Use casts instead of scalarizing everything in CLC version 2014-08-20 13:58:57 +00:00
workitem PTX: move implementations of work-item and synchronisation functions 2012-08-05 22:25:37 +00:00
SOURCES configure: Add --enable-runtime-subnormal option 2015-04-20 18:49:50 +00:00
clcmacro.h Implement step builtin 2015-03-02 15:29:41 +00:00
gen_convert.py Fix definition of INFINITY and add NAN/HUGE_VAL[F] 2014-06-16 22:32:58 +00:00
subnormal_config.cl configure: Add --enable-runtime-subnormal option 2015-04-20 18:49:50 +00:00
subnormal_disable.ll configure: Add --enable-runtime-subnormal option 2015-04-20 18:49:50 +00:00
subnormal_helper_func.ll configure: Add --enable-runtime-subnormal option 2015-04-20 18:49:50 +00:00
subnormal_use_default.ll configure: Add --enable-runtime-subnormal option 2015-04-20 18:49:50 +00:00