[libclc] 21427b8 - libclc: Add clspv target to libclc

2021-03-03 Thread Jan Vesely via cfe-commits

Author: Alan Baker
Date: 2021-03-04T00:19:10-05:00
New Revision: 21427b8eb8e773789bdb4cd8911bee6631910a37

URL: 
https://github.com/llvm/llvm-project/commit/21427b8eb8e773789bdb4cd8911bee6631910a37
DIFF: 
https://github.com/llvm/llvm-project/commit/21427b8eb8e773789bdb4cd8911bee6631910a37.diff

LOG: libclc: Add clspv target to libclc

Add clspv as a new target for libclc. clspv is an open-source compiler that 
compiles OpenCL C to Vulkan SPIR-V. Compiles for the spir target.

The clspv target differs from the the spirv target in the following ways:
* fma is modified to use uint2 instead of ulong for mantissas. This results in 
lower performance fma, but provides a implementation that can be used on more 
Vulkan devices where 64-bit integer support is less common.
* Use of a software implementation of nextafter because the generic 
implementation depends on nextafter being a defined builtin function for which 
clspv has no definition.
* Full optimization of the library (-O3) and no conversion to SPIR-V

This library is close to what would be produced by running opt -O3 < 
builtins.opt.spirv-mesa3d-.bc > builtins.opt.clspv--.bc and continuing the 
build from that point.

Reviewer: jvesely

Differential Revision: https://reviews.llvm.org/D94013

Added: 
libclc/clspv/lib/SOURCES
libclc/clspv/lib/math/fma.cl
libclc/clspv/lib/math/nextafter.cl
libclc/clspv/lib/math/nextafter.inc
libclc/clspv/lib/subnormal_config.cl

Modified: 
libclc/CMakeLists.txt

Removed: 




diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index b8b5ceff086c..7f8d81e9036a 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -7,6 +7,7 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
   amdgcn/lib/SOURCES;
   amdgcn-mesa3d/lib/SOURCES;
   amdgpu/lib/SOURCES;
+  clspv/lib/SOURCES;
   generic/lib/SOURCES;
   ptx/lib/SOURCES;
   ptx-nvidiacl/lib/SOURCES;
@@ -19,6 +20,7 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
 set( LIBCLC_TARGETS_ALL
   amdgcn--
   amdgcn--amdhsa
+  clspv--
   r600--
   nvptx--
   nvptx64--
@@ -145,6 +147,7 @@ set( r600--_devices cedar cypress barts cayman )
 set( amdgcn--_devices tahiti )
 set( amdgcn-mesa-mesa3d_devices ${amdgcn--_devices} )
 set( amdgcn--amdhsa_devices none )
+set( clspv--_devices none )
 set( nvptx--_devices none )
 set( nvptx64--_devices none )
 set( nvptx--nvidiacl_devices none )
@@ -203,7 +206,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
set( dirs )
 
-   if ( NOT ${ARCH} STREQUAL spirv AND NOT ${ARCH} STREQUAL spirv64 )
+   if ( NOT ${ARCH} STREQUAL spirv AND NOT ${ARCH} STREQUAL spirv64 AND 
NOT ${ARCH} STREQUAL clspv )
LIST( APPEND dirs generic )
endif()
 
@@ -234,7 +237,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
# Add the generated convert.cl here to prevent adding
# the one listed in SOURCES
-   if( NOT ${ARCH} STREQUAL "spirv" AND NOT ${ARCH} STREQUAL "spirv64" )
+   if( NOT ${ARCH} STREQUAL "spirv" AND NOT ${ARCH} STREQUAL "spirv64" AND 
NOT ${ARCH} STREQUAL "clspv" )
set( rel_files convert.cl )
set( objects convert.cl )
if( NOT ENABLE_RUNTIME_SUBNORMAL )
@@ -284,6 +287,10 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
set( build_flags -O0 -finline-hint-functions )
set( opt_flags )
set( spvflags --spirv-max-version=1.1 )
+   elseif( ${ARCH} STREQUAL "clspv" )
+   set( t "spir--" )
+   set( build_flags )
+   set( opt_flags -O3 )
else()
set( build_flags )
set( opt_flags -O3 )

diff  --git a/libclc/clspv/lib/SOURCES b/libclc/clspv/lib/SOURCES
new file mode 100644
index ..0466345cee02
--- /dev/null
+++ b/libclc/clspv/lib/SOURCES
@@ -0,0 +1,48 @@
+subnormal_config.cl
+../../generic/lib/geometric/distance.cl
+../../generic/lib/geometric/length.cl
+math/fma.cl
+math/nextafter.cl
+../../generic/lib/math/acosh.cl
+../../generic/lib/math/asinh.cl
+../../generic/lib/math/atan.cl
+../../generic/lib/math/atan2.cl
+../../generic/lib/math/atan2pi.cl
+../../generic/lib/math/atanh.cl
+../../generic/lib/math/atanpi.cl
+../../generic/lib/math/cbrt.cl
+../../generic/lib/math/clc_fmod.cl
+../../generic/lib/math/clc_hypot.cl
+../../generic/lib/math/clc_ldexp.cl
+../../generic/lib/math/clc_nextafter.cl
+../../generic/lib/math/clc_remainder.cl
+../../generic/lib/math/clc_remquo.cl
+../../generic/lib/math/clc_rootn.cl
+../../generic/lib/math/clc_sqrt.cl
+../../generic/lib/math/clc_tan.cl
+../../generic/lib/math/erf.cl
+../../generic/lib/math/erfc.cl
+../../generic/lib/math/fmod.cl
+../../generic/lib/math/fract.cl
+../../generic/lib/math/frexp.cl
+../../generic/lib/math/half_divide.cl
+../../generic/lib/math/half_recip.cl

[libclc] 291bfff - libclc: Add a __builtin to let SPIRV targets select between SW and HW FMA

2020-09-15 Thread Jan Vesely via cfe-commits

Author: Daniel Stone
Date: 2020-09-16T01:37:22-04:00
New Revision: 291bfff5dbb70360730e91b4019f8080e4e3d7f5

URL: 
https://github.com/llvm/llvm-project/commit/291bfff5dbb70360730e91b4019f8080e4e3d7f5
DIFF: 
https://github.com/llvm/llvm-project/commit/291bfff5dbb70360730e91b4019f8080e4e3d7f5.diff

LOG: libclc: Add a __builtin to let SPIRV targets select between SW and HW FMA

Reviewer: jenatali jvesely
Differential Revision: https://reviews.llvm.org/D85910

Added: 


Modified: 
libclc/generic/lib/math/math.h
libclc/spirv/lib/math/fma.cl
libclc/spirv64/lib/math/fma.cl

Removed: 




diff  --git a/libclc/generic/lib/math/math.h b/libclc/generic/lib/math/math.h
index c931d19a380c..351e37dc3f12 100644
--- a/libclc/generic/lib/math/math.h
+++ b/libclc/generic/lib/math/math.h
@@ -40,6 +40,9 @@
 
 #if (defined __AMDGCN__ || defined __R600__) && !defined __HAS_FMAF__
 #define HAVE_HW_FMA32() (0)
+#elif defined CLC_SPIRV || defined CLC_SPIRV64
+bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);
+#define HAVE_HW_FMA32() __clc_runtime_has_hw_fma32()
 #else
 #define HAVE_HW_FMA32() (1)
 #endif

diff  --git a/libclc/spirv/lib/math/fma.cl b/libclc/spirv/lib/math/fma.cl
index 982ddc4374f3..79142425e52d 100644
--- a/libclc/spirv/lib/math/fma.cl
+++ b/libclc/spirv/lib/math/fma.cl
@@ -4,3 +4,8 @@
 #define __CLC_BODY 
 #define __FLOAT_ONLY
 #include 
+
+bool __clc_runtime_has_hw_fma32()
+{
+return false;
+}

diff  --git a/libclc/spirv64/lib/math/fma.cl b/libclc/spirv64/lib/math/fma.cl
index 982ddc4374f3..79142425e52d 100644
--- a/libclc/spirv64/lib/math/fma.cl
+++ b/libclc/spirv64/lib/math/fma.cl
@@ -4,3 +4,8 @@
 #define __CLC_BODY 
 #define __FLOAT_ONLY
 #include 
+
+bool __clc_runtime_has_hw_fma32()
+{
+return false;
+}



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 16ba78e - libclc/spirv: Add missing files from D85911

2020-09-10 Thread Jan Vesely via cfe-commits

Author: Jan Vesely
Date: 2020-09-10T23:41:38-04:00
New Revision: 16ba78ee627c3fe66906349e8c90ee8cc1224298

URL: 
https://github.com/llvm/llvm-project/commit/16ba78ee627c3fe66906349e8c90ee8cc1224298
DIFF: 
https://github.com/llvm/llvm-project/commit/16ba78ee627c3fe66906349e8c90ee8cc1224298.diff

LOG: libclc/spirv: Add missing files from D85911

Fixes: 060c8e083dd637866854acb6a0823c45b2ef68ef
Signed-off-by: Jan Vesely 

Added: 
libclc/spirv/lib/math/fma.cl
libclc/spirv/lib/math/fma.inc
libclc/spirv64/lib/math/fma.cl
libclc/spirv64/lib/math/fma.inc

Modified: 


Removed: 




diff  --git a/libclc/spirv/lib/math/fma.cl b/libclc/spirv/lib/math/fma.cl
new file mode 100644
index ..982ddc4374f3
--- /dev/null
+++ b/libclc/spirv/lib/math/fma.cl
@@ -0,0 +1,6 @@
+#include 
+#include 
+
+#define __CLC_BODY 
+#define __FLOAT_ONLY
+#include 

diff  --git a/libclc/spirv/lib/math/fma.inc b/libclc/spirv/lib/math/fma.inc
new file mode 100644
index ..0f12c565758f
--- /dev/null
+++ b/libclc/spirv/lib/math/fma.inc
@@ -0,0 +1,3 @@
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE fma(__CLC_GENTYPE a, __CLC_GENTYPE b, 
__CLC_GENTYPE c) {
+   return __clc_sw_fma(a, b, c);
+}

diff  --git a/libclc/spirv64/lib/math/fma.cl b/libclc/spirv64/lib/math/fma.cl
new file mode 100644
index ..982ddc4374f3
--- /dev/null
+++ b/libclc/spirv64/lib/math/fma.cl
@@ -0,0 +1,6 @@
+#include 
+#include 
+
+#define __CLC_BODY 
+#define __FLOAT_ONLY
+#include 

diff  --git a/libclc/spirv64/lib/math/fma.inc b/libclc/spirv64/lib/math/fma.inc
new file mode 100644
index ..0f12c565758f
--- /dev/null
+++ b/libclc/spirv64/lib/math/fma.inc
@@ -0,0 +1,3 @@
+_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE fma(__CLC_GENTYPE a, __CLC_GENTYPE b, 
__CLC_GENTYPE c) {
+   return __clc_sw_fma(a, b, c);
+}



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 060c8e0 - libclc/spirv: Add various functions

2020-09-10 Thread Jan Vesely via cfe-commits

Author: Daniel Stone
Date: 2020-09-10T01:59:10-04:00
New Revision: 060c8e083dd637866854acb6a0823c45b2ef68ef

URL: 
https://github.com/llvm/llvm-project/commit/060c8e083dd637866854acb6a0823c45b2ef68ef
DIFF: 
https://github.com/llvm/llvm-project/commit/060c8e083dd637866854acb6a0823c45b2ef68ef.diff

LOG: libclc/spirv: Add various functions

Adds fma,fmod,ldexp.

Reviewer: jenatali jvesely

Differential Revision: https://reviews.llvm.org/D85911

Added: 


Modified: 
libclc/spirv/lib/SOURCES
libclc/spirv64/lib/SOURCES

Removed: 




diff  --git a/libclc/spirv/lib/SOURCES b/libclc/spirv/lib/SOURCES
index f594fa7e85d4..854cba614c8b 100644
--- a/libclc/spirv/lib/SOURCES
+++ b/libclc/spirv/lib/SOURCES
@@ -41,6 +41,10 @@ subnormal_config.cl
 ../../generic/lib/math/exp2.cl
 ../../generic/lib/math/clc_exp10.cl
 ../../generic/lib/math/exp10.cl
+../../generic/lib/math/clc_fma.cl
+math/fma.cl
+../../generic/lib/math/clc_fmod.cl
+../../generic/lib/math/fmod.cl
 ../../generic/lib/math/fract.cl
 ../../generic/lib/math/frexp.cl
 ../../generic/lib/math/half_rsqrt.cl
@@ -48,6 +52,8 @@ subnormal_config.cl
 ../../generic/lib/math/clc_hypot.cl
 ../../generic/lib/math/hypot.cl
 ../../generic/lib/math/ilogb.cl
+../../generic/lib/math/clc_ldexp.cl
+../../generic/lib/math/ldexp.cl
 ../../generic/lib/math/lgamma.cl
 ../../generic/lib/math/lgamma_r.cl
 ../../generic/lib/math/log.cl

diff  --git a/libclc/spirv64/lib/SOURCES b/libclc/spirv64/lib/SOURCES
index f594fa7e85d4..854cba614c8b 100644
--- a/libclc/spirv64/lib/SOURCES
+++ b/libclc/spirv64/lib/SOURCES
@@ -41,6 +41,10 @@ subnormal_config.cl
 ../../generic/lib/math/exp2.cl
 ../../generic/lib/math/clc_exp10.cl
 ../../generic/lib/math/exp10.cl
+../../generic/lib/math/clc_fma.cl
+math/fma.cl
+../../generic/lib/math/clc_fmod.cl
+../../generic/lib/math/fmod.cl
 ../../generic/lib/math/fract.cl
 ../../generic/lib/math/frexp.cl
 ../../generic/lib/math/half_rsqrt.cl
@@ -48,6 +52,8 @@ subnormal_config.cl
 ../../generic/lib/math/clc_hypot.cl
 ../../generic/lib/math/hypot.cl
 ../../generic/lib/math/ilogb.cl
+../../generic/lib/math/clc_ldexp.cl
+../../generic/lib/math/ldexp.cl
 ../../generic/lib/math/lgamma.cl
 ../../generic/lib/math/lgamma_r.cl
 ../../generic/lib/math/log.cl



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] e6bb1d6 - libclc: Fix LLVM library linking on Windows

2020-04-14 Thread Jan Vesely via cfe-commits

Author: Daniel Stone
Date: 2020-04-14T10:03:27-04:00
New Revision: e6bb1d69eccc612e54fd1a0b63ca3dcc84c3a6fa

URL: 
https://github.com/llvm/llvm-project/commit/e6bb1d69eccc612e54fd1a0b63ca3dcc84c3a6fa
DIFF: 
https://github.com/llvm/llvm-project/commit/e6bb1d69eccc612e54fd1a0b63ca3dcc84c3a6fa.diff

LOG: libclc: Fix LLVM library linking on Windows

CMake requires library lists on Windows to be split by semi-colons,
rather than the spaces we get from llvm-config. Fix this by a
substitution on Windows.

reviewer: jvesely
Differential Revision: https://reviews.llvm.org/D77162

Added: 


Modified: 
libclc/CMakeLists.txt

Removed: 




diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 4afed0d8f994..7274f02f666b 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -58,9 +58,11 @@ list( SORT LIBCLC_TARGETS_TO_BUILD )
 execute_process( COMMAND ${LLVM_CONFIG} "--system-libs"
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE )
+separate_arguments( LLVM_SYSTEM_LIBS )
 execute_process( COMMAND ${LLVM_CONFIG} "--libs" "core" "bitreader" "bitwriter"
OUTPUT_VARIABLE LLVM_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE )
+separate_arguments( LLVM_LIBS )
 execute_process( COMMAND ${LLVM_CONFIG} "--libdir"
OUTPUT_VARIABLE LLVM_LIBDIR
OUTPUT_STRIP_TRAILING_WHITESPACE )
@@ -76,7 +78,7 @@ execute_process( COMMAND ${LLVM_CONFIG} "--bindir"
OUTPUT_STRIP_TRAILING_WHITESPACE )
 
 # These were not properly reported in early LLVM and we don't need them
-set( LLVM_CXX_FLAGS ${LLVM_CXX_FLAGS} -fno-rtti -fno-exceptions )
+list( APPEND LLVM_CXX_FLAGS -fno-rtti -fno-exceptions )
 
 # Print LLVM variables
 message( "LLVM system libs: ${LLVM_SYSTEM_LIBS}" )



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 24fad72 - libclc: Use temporary files rather than a pipe

2020-04-14 Thread Jan Vesely via cfe-commits

Author: Daniel Stone
Date: 2020-04-14T10:03:27-04:00
New Revision: 24fad7278a391c6f8af664f4ac691c1719008a09

URL: 
https://github.com/llvm/llvm-project/commit/24fad7278a391c6f8af664f4ac691c1719008a09
DIFF: 
https://github.com/llvm/llvm-project/commit/24fad7278a391c6f8af664f4ac691c1719008a09.diff

LOG: libclc: Use temporary files rather than a pipe

This is required for using the Ninja backend on Windows, as it passes
commands directly to CreateProcess, and does not allow the shell to
interpret them: https://ninja-build.org/manual.html#ref_rule_command

Using the Visual Studio backend is not possible as attempting to create
a static library target comprised entirely of novel languages not known
to the Visual Studio backend built in to CMake's C++ source will
generate nothing at all.

reviewer: jvesely
Differential Revision: https://reviews.llvm.org/D77165

Added: 


Modified: 
libclc/cmake/CMakeLLAsmInformation.cmake

Removed: 




diff  --git a/libclc/cmake/CMakeLLAsmInformation.cmake 
b/libclc/cmake/CMakeLLAsmInformation.cmake
index 73fb28e13135..218e20a52fe8 100644
--- a/libclc/cmake/CMakeLLAsmInformation.cmake
+++ b/libclc/cmake/CMakeLLAsmInformation.cmake
@@ -1,6 +1,7 @@
 if(NOT CMAKE_LLAsm_COMPILE_OBJECT)
   set(CMAKE_LLAsm_COMPILE_OBJECT
- "${CMAKE_LLAsm_PREPROCESSOR} -E -P -x 
cl   -o - |  -o  ")
+ "${CMAKE_LLAsm_PREPROCESSOR} -E -P -x 
cl  -o .temp"
+ " -o  .temp")
 endif()
 
 if(NOT CMAKE_LLAsm_CREATE_STATIC_LIBRARY)



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] acf0790 - libclc: Use echo rather than true for try_compile

2020-04-14 Thread Jan Vesely via cfe-commits

Author: Daniel Stone
Date: 2020-04-14T10:03:27-04:00
New Revision: acf079006e6dbdd23300e9289cc8d8197aab5fb5

URL: 
https://github.com/llvm/llvm-project/commit/acf079006e6dbdd23300e9289cc8d8197aab5fb5
DIFF: 
https://github.com/llvm/llvm-project/commit/acf079006e6dbdd23300e9289cc8d8197aab5fb5.diff

LOG: libclc: Use echo rather than true for try_compile

When providing a fake compiler, libclc currently uses 'true' which does
not exist on Windows. Use echo instead as the no-op.

reviewer: jvesely
Differential Revision: https://reviews.llvm.org/D77163

Added: 


Modified: 
libclc/cmake/CMakeTestCLCCompiler.cmake
libclc/cmake/CMakeTestLLAsmCompiler.cmake

Removed: 




diff  --git a/libclc/cmake/CMakeTestCLCCompiler.cmake 
b/libclc/cmake/CMakeTestCLCCompiler.cmake
index fae660fbcadc..869fcc3d01ab 100644
--- a/libclc/cmake/CMakeTestCLCCompiler.cmake
+++ b/libclc/cmake/CMakeTestCLCCompiler.cmake
@@ -24,7 +24,7 @@ if(NOT CMAKE_CLC_COMPILER_WORKS)
   try_compile(CMAKE_CLC_COMPILER_WORKS ${CMAKE_BINARY_DIR}
 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCLCCompiler.cl
 # We never generate executable so bypass the link step
-CMAKE_FLAGS -DCMAKE_CLC_LINK_EXECUTABLE='true'
+CMAKE_FLAGS -DCMAKE_CLC_LINK_EXECUTABLE='echo'
 OUTPUT_VARIABLE __CMAKE_CLC_COMPILER_OUTPUT)
   # Move result from cache to normal variable.
   set(CMAKE_CLC_COMPILER_WORKS ${CMAKE_CLC_COMPILER_WORKS})

diff  --git a/libclc/cmake/CMakeTestLLAsmCompiler.cmake 
b/libclc/cmake/CMakeTestLLAsmCompiler.cmake
index 1a87457c2cde..35948ee07a94 100644
--- a/libclc/cmake/CMakeTestLLAsmCompiler.cmake
+++ b/libclc/cmake/CMakeTestLLAsmCompiler.cmake
@@ -24,7 +24,7 @@ if(NOT CMAKE_LLAsm_COMPILER_WORKS)
   try_compile(CMAKE_LLAsm_COMPILER_WORKS ${CMAKE_BINARY_DIR}
 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testLLAsmCompiler.ll
 # We never generate executable so bypass the link step
-CMAKE_FLAGS -DCMAKE_LLAsm_LINK_EXECUTABLE='true'
+CMAKE_FLAGS -DCMAKE_LLAsm_LINK_EXECUTABLE='echo'
 OUTPUT_VARIABLE __CMAKE_LLAsm_COMPILER_OUTPUT)
   # Move result from cache to normal variable.
   set(CMAKE_LLAsm_COMPILER_WORKS ${CMAKE_LLAsm_COMPILER_WORKS})



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] cccdd05 - libclc: Don't pass linker flags to CLC/LLAsm

2020-04-14 Thread Jan Vesely via cfe-commits

Author: Daniel Stone
Date: 2020-04-14T10:03:27-04:00
New Revision: cccdd0579b5027d0a21fd2dbc0a6a50330134976

URL: 
https://github.com/llvm/llvm-project/commit/cccdd0579b5027d0a21fd2dbc0a6a50330134976
DIFF: 
https://github.com/llvm/llvm-project/commit/cccdd0579b5027d0a21fd2dbc0a6a50330134976.diff

LOG: libclc: Don't pass linker flags to CLC/LLAsm

We don't want the regular linker flags for these invocations, since
we're not compiling to the target machine anyway. This fixes things like
'/machine:x64' being unknown when invoked under Windows.

reviewer: jvesely
Differential Revision: https://reviews.llvm.org/D77164

Added: 


Modified: 
libclc/cmake/CMakeCLCInformation.cmake
libclc/cmake/CMakeLLAsmInformation.cmake

Removed: 




diff  --git a/libclc/cmake/CMakeCLCInformation.cmake 
b/libclc/cmake/CMakeCLCInformation.cmake
index dfbdda9941a7..6eecf4edf0e7 100644
--- a/libclc/cmake/CMakeCLCInformation.cmake
+++ b/libclc/cmake/CMakeCLCInformation.cmake
@@ -5,7 +5,7 @@ endif()
 
 if(NOT CMAKE_CLC_CREATE_STATIC_LIBRARY)
   set(CMAKE_CLC_CREATE_STATIC_LIBRARY
-"  -o  ")
+" -o  ")
 endif()
 
 set(CMAKE_INCLUDE_FLAG_CLC "-I")

diff  --git a/libclc/cmake/CMakeLLAsmInformation.cmake 
b/libclc/cmake/CMakeLLAsmInformation.cmake
index f1d013b02887..73fb28e13135 100644
--- a/libclc/cmake/CMakeLLAsmInformation.cmake
+++ b/libclc/cmake/CMakeLLAsmInformation.cmake
@@ -5,7 +5,7 @@ endif()
 
 if(NOT CMAKE_LLAsm_CREATE_STATIC_LIBRARY)
   set(CMAKE_LLAsm_CREATE_STATIC_LIBRARY
-"  -o  ")
+" -o  ")
 endif()
 
 set(CMAKE_INCLUDE_FLAG_LLAsm "-I")



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 814fb65 - libclc: cmake configure should depend on file list

2020-02-25 Thread Jan Vesely via cfe-commits

Author: Jan Vesely
Date: 2020-02-25T04:43:14-05:00
New Revision: 814fb658ca262f5c2df47f11d47f91fac188e0d6

URL: 
https://github.com/llvm/llvm-project/commit/814fb658ca262f5c2df47f11d47f91fac188e0d6
DIFF: 
https://github.com/llvm/llvm-project/commit/814fb658ca262f5c2df47f11d47f91fac188e0d6.diff

LOG: libclc: cmake configure should depend on file list

This makes sure targets are rebuilt if a file is added or removed.
Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D74662

Added: 


Modified: 
libclc/CMakeLists.txt

Removed: 




diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 440eab076509..4afed0d8f994 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -2,6 +2,16 @@ cmake_minimum_required( VERSION 3.9.2 )
 
 project( libclc VERSION 0.2.0 LANGUAGES CXX )
 include( GNUInstallDirs )
+set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
+  amdgcn-amdhsa/lib/SOURCES;
+  amdgcn/lib/SOURCES;
+  amdgcn-mesa3d/lib/SOURCES;
+  amdgpu/lib/SOURCES;
+  generic/lib/SOURCES;
+  ptx/lib/SOURCES;
+  ptx-nvidiacl/lib/SOURCES;
+  r600/lib/SOURCES
+)
 
 # List of all targets
 set( LIBCLC_TARGETS_ALL



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] efeafa1 - libclc: Use acos implementation from amd_builtins

2020-02-20 Thread Jan Vesely via cfe-commits

Author: Jan Vesely
Date: 2020-02-20T23:36:14-05:00
New Revision: efeafa1bdaa715733fc100bcd9d21f93c7272368

URL: 
https://github.com/llvm/llvm-project/commit/efeafa1bdaa715733fc100bcd9d21f93c7272368
DIFF: 
https://github.com/llvm/llvm-project/commit/efeafa1bdaa715733fc100bcd9d21f93c7272368.diff

LOG: libclc: Use acos implementation from amd_builtins

Fixes acos CTS (1 thread, scalar) on AMD Turks.
Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D74011

Added: 


Modified: 
libclc/generic/lib/math/acos.cl

Removed: 
libclc/generic/lib/math/acos.inc



diff  --git a/libclc/generic/lib/math/acos.cl b/libclc/generic/lib/math/acos.cl
index f6e2ab597305..87db01416c86 100644
--- a/libclc/generic/lib/math/acos.cl
+++ b/libclc/generic/lib/math/acos.cl
@@ -1,4 +1,173 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
 #include 
 
-#define __CLC_BODY 
-#include 
+#include "math.h"
+#include "../clcmacro.h"
+
+_CLC_OVERLOAD _CLC_DEF float acos(float x) {
+// Computes arccos(x).
+// The argument is first reduced by noting that arccos(x)
+// is invalid for abs(x) > 1. For denormal and small
+// arguments arccos(x) = pi/2 to machine accuracy.
+// Remaining argument ranges are handled as follows.
+// For abs(x) <= 0.5 use
+// arccos(x) = pi/2 - arcsin(x)
+// = pi/2 - (x + x^3*R(x^2))
+// where R(x^2) is a rational minimax approximation to
+// (arcsin(x) - x)/x^3.
+// For abs(x) > 0.5 exploit the identity:
+// arccos(x) = pi - 2*arcsin(sqrt(1-x)/2)
+// together with the above rational approximation, and
+// reconstruct the terms carefully.
+
+
+// Some constants and split constants.
+const float piby2 = 1.5707963705e+00F;
+const float pi = 3.1415926535897933e+00F;
+const float piby2_head = 1.5707963267948965580e+00F;
+const float piby2_tail = 6.12323399573676603587e-17F;
+
+uint ux = as_uint(x);
+uint aux = ux & ~SIGNBIT_SP32;
+int xneg = ux != aux;
+int xexp = (int)(aux >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32;
+float y = as_float(aux);
+
+// transform if |x| >= 0.5
+int transform = xexp >= -1;
+
+float y2 = y * y;
+float yt = 0.5f * (1.0f - y);
+float r = transform ? yt : y2;
+
+// Use a rational approximation for [0.0, 0.5]
+float a = mad(r,
+  mad(r,
+  mad(r, -0.00396137437848476485201154797087F, 
-0.0133819288943925804214011424456F),
+  -0.0565298683201845211985026327361F),
+  0.184161606965100694821398249421F);
+
+float b = mad(r, -0.836411276854206731913362287293F, 
1.10496961524520294485512696706F);
+float u = r * MATH_DIVIDE(a, b);
+
+float s = MATH_SQRT(r);
+y = s;
+float s1 = as_float(as_uint(s) & 0x);
+float c = MATH_DIVIDE(mad(s1, -s1, r), s + s1);
+float rettn = mad(s + mad(y, u, -piby2_tail), -2.0f, pi);
+float rettp = 2.0F * (s1 + mad(y, u, c));
+float rett = xneg ? rettn : rettp;
+float ret = piby2_head - (x - mad(x, -u, piby2_tail));
+
+ret = transform ? rett : ret;
+ret = aux > 0x3f80U ? as_float(QNANBITPATT_SP32) : ret;
+ret = ux == 0x3f80U ? 0.0f : ret;
+ret = ux == 0xbf80U ? pi : ret;
+ret = xexp < -26 ? piby2 : ret;
+return ret;
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, acos, float);
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_OVERLOAD _CLC_DEF double acos(double x) {
+// Computes arccos(x).
+// The argument is first reduced by noting that arccos(x)
+// is invalid for abs(x) > 1. For denormal and small
+// arguments arccos(x) = pi/2 to machine accuracy.
+// Remaining argument ranges are handled as follows.
+// For abs(x) <= 0.5 use
+// arccos(x) = pi/2 - 

[libclc] 4b23a2e - libclc: Move rsqrt implementation to a .cl file

2020-02-09 Thread Jan Vesely via cfe-commits

Author: Jan Vesely
Date: 2020-02-09T14:42:09-05:00
New Revision: 4b23a2e8e971876d075d3ae322754dbc0495413d

URL: 
https://github.com/llvm/llvm-project/commit/4b23a2e8e971876d075d3ae322754dbc0495413d
DIFF: 
https://github.com/llvm/llvm-project/commit/4b23a2e8e971876d075d3ae322754dbc0495413d.diff

LOG: libclc: Move rsqrt implementation to a .cl file

Reviewer: awatry
Differential Revision: https://reviews.llvm.org/D74013

Added: 
libclc/generic/lib/math/rsqrt.cl

Modified: 
libclc/generic/include/clc/math/rsqrt.h
libclc/generic/lib/SOURCES

Removed: 




diff  --git a/libclc/generic/include/clc/math/rsqrt.h 
b/libclc/generic/include/clc/math/rsqrt.h
index 9d49ee652262..41b9fd7572b9 100644
--- a/libclc/generic/include/clc/math/rsqrt.h
+++ b/libclc/generic/include/clc/math/rsqrt.h
@@ -1 +1,7 @@
-#define rsqrt(x) (1.f/sqrt(x))
+#define __CLC_BODY 
+#define __CLC_FUNCTION rsqrt
+
+#include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

diff  --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES
index df7f68f040f3..ee2736b5fbc5 100644
--- a/libclc/generic/lib/SOURCES
+++ b/libclc/generic/lib/SOURCES
@@ -176,6 +176,7 @@ math/rint.cl
 math/clc_rootn.cl
 math/rootn.cl
 math/round.cl
+math/rsqrt.cl
 math/sin.cl
 math/sincos.cl
 math/sincos_helpers.cl

diff  --git a/libclc/generic/lib/math/rsqrt.cl 
b/libclc/generic/lib/math/rsqrt.cl
new file mode 100644
index ..131ffc194a90
--- /dev/null
+++ b/libclc/generic/lib/math/rsqrt.cl
@@ -0,0 +1,23 @@
+#include 
+
+#include "../clcmacro.h"
+
+_CLC_OVERLOAD _CLC_DEF float rsqrt(float x)
+{
+return 1.0f / sqrt(x);
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, rsqrt, float);
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_OVERLOAD _CLC_DEF double rsqrt(double x)
+{
+return 1.0 / sqrt(x);
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, rsqrt, double);
+
+#endif



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 85e2fa4 - libclc/r600: Use target specific builtins to implement rsqrt and native_rsqrt

2020-02-09 Thread Jan Vesely via cfe-commits

Author: Jan Vesely
Date: 2020-02-09T14:42:15-05:00
New Revision: 85e2fa44c64e1edd2f675c990ecc60f5fadb4686

URL: 
https://github.com/llvm/llvm-project/commit/85e2fa44c64e1edd2f675c990ecc60f5fadb4686
DIFF: 
https://github.com/llvm/llvm-project/commit/85e2fa44c64e1edd2f675c990ecc60f5fadb4686.diff

LOG: libclc/r600: Use target specific builtins to implement rsqrt and 
native_rsqrt

Fixes OCL CTS rsqrt and half_rsqrt (1 thread, scalaer) tests on AMD Turks.

Reviewer: awatry
Differential Revision: https://reviews.llvm.org/D74016

Added: 
libclc/r600/lib/math/native_rsqrt.cl
libclc/r600/lib/math/rsqrt.cl

Modified: 
libclc/r600/lib/SOURCES

Removed: 




diff  --git a/libclc/r600/lib/SOURCES b/libclc/r600/lib/SOURCES
index 4342ac38201c..6e01bbb2b8b9 100644
--- a/libclc/r600/lib/SOURCES
+++ b/libclc/r600/lib/SOURCES
@@ -1,5 +1,7 @@
 math/fmax.cl
 math/fmin.cl
+math/native_rsqrt.cl
+math/rsqrt.cl
 synchronization/barrier.cl
 workitem/get_global_offset.cl
 workitem/get_group_id.cl

diff  --git a/libclc/r600/lib/math/native_rsqrt.cl 
b/libclc/r600/lib/math/native_rsqrt.cl
new file mode 100644
index ..edf473e8409c
--- /dev/null
+++ b/libclc/r600/lib/math/native_rsqrt.cl
@@ -0,0 +1,10 @@
+#include 
+
+#include "../../../generic/lib/clcmacro.h"
+
+_CLC_OVERLOAD _CLC_DEF float native_rsqrt(float x)
+{
+return __builtin_r600_recipsqrt_ieeef(x);
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, native_rsqrt, float);

diff  --git a/libclc/r600/lib/math/rsqrt.cl b/libclc/r600/lib/math/rsqrt.cl
new file mode 100644
index ..37a8037902c2
--- /dev/null
+++ b/libclc/r600/lib/math/rsqrt.cl
@@ -0,0 +1,23 @@
+#include 
+
+#include "../../../generic/lib/clcmacro.h"
+
+_CLC_OVERLOAD _CLC_DEF float rsqrt(float x)
+{
+return __builtin_r600_recipsqrt_ieeef(x);
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, rsqrt, float);
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_OVERLOAD _CLC_DEF double rsqrt(double x)
+{
+return __builtin_r600_recipsqrt_ieee(x);
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, rsqrt, double);
+
+#endif



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] 64a8e1b - libclc/asin: Switch to amd builtins version of asin

2020-02-04 Thread Jan Vesely via cfe-commits

Author: Aaron Watry
Date: 2020-02-04T14:29:20-05:00
New Revision: 64a8e1b83e14836f97dab4d28dae498e897804e6

URL: 
https://github.com/llvm/llvm-project/commit/64a8e1b83e14836f97dab4d28dae498e897804e6
DIFF: 
https://github.com/llvm/llvm-project/commit/64a8e1b83e14836f97dab4d28dae498e897804e6.diff

LOG: libclc/asin: Switch to amd builtins version of asin

Fixes a wimpy-mode CTS failure for asin(float).

Passes non-wimpy for both float/double on RX580.

Signed-off-by: Aaron Watry 
Tested-by: Jan Vesely 
Reviewed-by: Jan Vesely 

Added: 


Modified: 
libclc/generic/lib/math/asin.cl

Removed: 
libclc/generic/lib/math/asin.inc



diff  --git a/libclc/generic/lib/math/asin.cl b/libclc/generic/lib/math/asin.cl
index 7581a5040936..43ce9055564c 100644
--- a/libclc/generic/lib/math/asin.cl
+++ b/libclc/generic/lib/math/asin.cl
@@ -1,4 +1,167 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
 #include 
 
-#define __CLC_BODY 
-#include 
+#include "math.h"
+#include "../clcmacro.h"
+
+_CLC_OVERLOAD _CLC_DEF float asin(float x) {
+// Computes arcsin(x).
+// The argument is first reduced by noting that arcsin(x)
+// is invalid for abs(x) > 1 and arcsin(-x) = -arcsin(x).
+// For denormal and small arguments arcsin(x) = x to machine
+// accuracy. Remaining argument ranges are handled as follows.
+// For abs(x) <= 0.5 use
+// arcsin(x) = x + x^3*R(x^2)
+// where R(x^2) is a rational minimax approximation to
+// (arcsin(x) - x)/x^3.
+// For abs(x) > 0.5 exploit the identity:
+// arcsin(x) = pi/2 - 2*arcsin(sqrt(1-x)/2)
+// together with the above rational approximation, and
+// reconstruct the terms carefully.
+
+const float piby2_tail = 7.5497894159e-08F;   /* 0x33a22168 */
+const float hpiby2_head = 7.8539812565e-01F;  /* 0x3f490fda */
+const float piby2 = 1.5707963705e+00F;/* 0x3fc90fdb */
+
+uint ux = as_uint(x);
+uint aux = ux & EXSIGNBIT_SP32;
+uint xs = ux ^ aux;
+float spiby2 = as_float(xs | as_uint(piby2));
+int xexp = (int)(aux >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32;
+float y = as_float(aux);
+
+// abs(x) >= 0.5
+int transform = xexp >= -1;
+
+float y2 = y * y;
+float rt = 0.5f * (1.0f - y);
+float r = transform ? rt : y2;
+
+// Use a rational approximation for [0.0, 0.5]
+float a = mad(r,
+  mad(r,
+  mad(r, -0.00396137437848476485201154797087F, 
-0.0133819288943925804214011424456F),
+  -0.0565298683201845211985026327361F),
+  0.184161606965100694821398249421F);
+
+float b = mad(r, -0.836411276854206731913362287293F, 
1.10496961524520294485512696706F);
+float u = r * MATH_DIVIDE(a, b);
+
+float s = MATH_SQRT(r);
+float s1 = as_float(as_uint(s) & 0x);
+float c = MATH_DIVIDE(mad(-s1, s1, r), s + s1);
+float p = mad(2.0f*s, u, -mad(c, -2.0f, piby2_tail));
+float q = mad(s1, -2.0f, hpiby2_head);
+float vt = hpiby2_head - (p - q);
+float v = mad(y, u, y);
+v = transform ? vt : v;
+
+float ret = as_float(xs | as_uint(v));
+ret = aux > 0x3f80U ? as_float(QNANBITPATT_SP32) : ret;
+ret = aux == 0x3f80U ? spiby2 : ret;
+ret = xexp < -14 ? x : ret;
+
+return ret;
+}
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, asin, float);
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_OVERLOAD _CLC_DEF double asin(double x) {
+// Computes arcsin(x).
+// The argument is first reduced by noting that arcsin(x)
+// is invalid for abs(x) > 1 and arcsin(-x) = -arcsin(x).
+// For denormal and small arguments arcsin(x) = x to machine
+// accuracy. Remaining argument ranges are handled as follows.
+// For abs(x) <= 0.5 use
+// 

[libclc] 00eca0b - libclc: Drop travis

2019-11-08 Thread Jan Vesely via cfe-commits

Author: Jan Vesely
Date: 2019-11-08T09:58:27-05:00
New Revision: 00eca0bf0bd9a70735a4d6d39ab3776c858d915c

URL: 
https://github.com/llvm/llvm-project/commit/00eca0bf0bd9a70735a4d6d39ab3776c858d915c
DIFF: 
https://github.com/llvm/llvm-project/commit/00eca0bf0bd9a70735a4d6d39ab3776c858d915c.diff

LOG: libclc: Drop travis

It only works for standalone repos.

Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D69965

Added: 


Modified: 


Removed: 
libclc/.travis.yml



diff  --git a/libclc/.travis.yml b/libclc/.travis.yml
deleted file mode 100644
index e8a41d98d83a..
--- a/libclc/.travis.yml
+++ /dev/null
@@ -1,200 +0,0 @@
-language: cpp
-
-dist: xenial
-
-matrix:
-  include:
-- env:
-- LABEL="make gcc LLVM-3.9"
-- LLVM_VERSION=3.9
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
-  addons:
-apt:
-  packages:
-- llvm-3.9-dev
-- clang-3.9
-- env:
-- LABEL="make gcc LLVM-4.0"
-- LLVM_VERSION=4.0
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-  addons:
-apt:
-  packages:
-- llvm-4.0-dev
-- clang-4.0
-- env:
-- LABEL="make gcc LLVM-5.0"
-- LLVM_VERSION=5.0
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-  addons:
-apt:
-  packages:
-- llvm-5.0-dev
-- clang-5.0
-- env:
-- LABEL="make gcc LLVM-6.0"
-- LLVM_VERSION=6.0
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-  addons:
-apt:
-  packages:
-- llvm-6.0-dev
-- clang-6.0
-- env:
-- LABEL="make gcc LLVM-7"
-- LLVM_VERSION=7
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-# llvm passes -Werror=date-time which is only supported in gcc-4.9+
-- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
-  addons:
-apt:
-  sources:
-- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-7 main'
-  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
-- ubuntu-toolchain-r-test
-  packages:
-- libedit-dev
-- g++-6
-# From sources above
-- llvm-7-dev
-- clang-7
-- env:
-- LABEL="make gcc LLVM-8"
-- LLVM_VERSION=8
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-# llvm passes -Werror=date-time which is only supported in gcc-4.9+
-- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
-  addons:
-apt:
-  sources:
-- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-8 main'
-  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
-- ubuntu-toolchain-r-test
-  packages:
-- libedit-dev
-- g++-6
-# From sources above
-- llvm-8-dev
-- clang-8
-- env:
-- LABEL="make gcc LLVM-9"
-- LLVM_VERSION=9
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
-  addons:
-apt:
-  sources:
-- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-9 main'
-  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
-- ubuntu-toolchain-r-test
-  packages:
-- libedit-dev
-- g++-6
-# From sources above
-- llvm-9-dev
-- clang-9
-- env:
-- LABEL="cmake gcc LLVM-3.9"
-- LLVM_VERSION=3.9
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
-  addons:
-apt:
-  packages:
-- llvm-3.9-dev
-- clang-3.9
-- env:
-- LABEL="cmake gcc 

[libclc] r373046 - travis: Switch to Ubuntu 16.04 (xenial)

2019-09-26 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Sep 26 22:57:38 2019
New Revision: 373046

URL: http://llvm.org/viewvc/llvm-project?rev=373046=rev
Log:
travis: Switch to Ubuntu 16.04 (xenial)

Use native packages up to llvm-6.

Reviewer: tstellar
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=373046=373045=373046=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Thu Sep 26 22:57:38 2019
@@ -1,11 +1,6 @@
 language: cpp
 
-sudo: false
-dist: trusty
-
-cache:
-  apt: true
-
+dist: xenial
 
 matrix:
   include:
@@ -15,12 +10,7 @@ matrix:
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
   addons:
 apt:
-  sources:
-- llvm-toolchain-trusty-3.9
   packages:
-- libedit-dev
-- g++-4.8
-# From sources above
 - llvm-3.9-dev
 - clang-3.9
 - env:
@@ -29,12 +19,7 @@ matrix:
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
-  sources:
-- llvm-toolchain-trusty-4.0
   packages:
-- libedit-dev
-- g++-4.8
-# From sources above
 - llvm-4.0-dev
 - clang-4.0
 - env:
@@ -43,41 +28,28 @@ matrix:
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
-  sources:
-- llvm-toolchain-trusty-5.0
   packages:
-- libedit-dev
-- g++-4.8
-# From sources above
 - llvm-5.0-dev
 - clang-5.0
 - env:
 - LABEL="make gcc LLVM-6.0"
 - LLVM_VERSION=6.0
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-# llvm passes -Werror=date-time which is only supported in gcc-4.9+
-- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
   addons:
 apt:
-  sources:
-- llvm-toolchain-trusty-6.0
-- ubuntu-toolchain-r-test
   packages:
-- libedit-dev
-# LLVM-6 needs libstdc++4.9
-- g++-4.9
-# From sources above
 - llvm-6.0-dev
 - clang-6.0
 - env:
 - LABEL="make gcc LLVM-7"
 - LLVM_VERSION=7
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+# llvm passes -Werror=date-time which is only supported in gcc-4.9+
 - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
   addons:
 apt:
   sources:
-- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-7 main'
+- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-7 main'
   key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
 - ubuntu-toolchain-r-test
   packages:
@@ -90,11 +62,12 @@ matrix:
 - LABEL="make gcc LLVM-8"
 - LLVM_VERSION=8
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+# llvm passes -Werror=date-time which is only supported in gcc-4.9+
 - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
   addons:
 apt:
   sources:
-- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-8 main'
+- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-8 main'
   key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
 - ubuntu-toolchain-r-test
   packages:
@@ -109,12 +82,7 @@ matrix:
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
   addons:
 apt:
-  sources:
-- llvm-toolchain-trusty-3.9
   packages:
-- libedit-dev
-- g++-4.8
-# From sources above
 - llvm-3.9-dev
 - clang-3.9
 - env:
@@ -123,12 +91,7 @@ matrix:
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc 

[libclc] r373047 - travis: Add LLVM 9 build

2019-09-26 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Sep 26 22:58:15 2019
New Revision: 373047

URL: http://llvm.org/viewvc/llvm-project?rev=373047=rev
Log:
travis: Add LLVM 9 build

Reviewer: tstellar
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=373047=373046=373047=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Thu Sep 26 22:58:15 2019
@@ -77,6 +77,23 @@ matrix:
 - llvm-8-dev
 - clang-8
 - env:
+- LABEL="make gcc LLVM-9"
+- LLVM_VERSION=9
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-9 main'
+  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+- g++-6
+# From sources above
+- llvm-9-dev
+- clang-9
+- env:
 - LABEL="cmake gcc LLVM-3.9"
 - LLVM_VERSION=3.9
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
@@ -148,6 +165,23 @@ matrix:
 # From sources above
 - llvm-8-dev
 - clang-8
+- env:
+- LABEL="cmake gcc LLVM-9"
+- LLVM_VERSION=9
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-9 main'
+  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+- g++-6
+# From sources above
+- llvm-9-dev
+- clang-9
 
 before_install:
 - eval "${MATRIX_EVAL}"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libclc] r367800 - Rename F_{None, Text, Append} to OF_{None, Text, Append}. NFC

2019-08-05 Thread Jan Vesely via cfe-commits
I've reverted this change.
It breaks libclc build using older LLVM version (which is still supported)
and it was committed without review on phabricator or libclc mailing list.
Please don't do that.

Jan

On Mon, Aug 5, 2019 at 1:43 AM Fangrui Song via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: maskray
> Date: Sun Aug  4 22:43:48 2019
> New Revision: 367800
>
> URL: http://llvm.org/viewvc/llvm-project?rev=367800=rev
> Log:
> Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC
>
> F_{None,Text,Append} are kept for compatibility since r334221.
>
> Modified:
> libclc/trunk/utils/prepare-builtins.cpp
>
> Modified: libclc/trunk/utils/prepare-builtins.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/libclc/trunk/utils/prepare-builtins.cpp?rev=367800=367799=367800=diff
>
> ==
> --- libclc/trunk/utils/prepare-builtins.cpp (original)
> +++ libclc/trunk/utils/prepare-builtins.cpp Sun Aug  4 22:43:48 2019
> @@ -95,10 +95,10 @@ int main(int argc, char **argv) {
>std::error_code EC;
>  #if HAVE_LLVM >= 0x0600
>std::unique_ptr Out(
> -  new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
> +  new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None));
>  #else
>std::unique_ptr Out(
> -  new tool_output_file(OutputFilename, EC, sys::fs::F_None));
> +  new tool_output_file(OutputFilename, EC, sys::fs::OF_None));
>  #endif
>if (EC) {
>  errs() << EC.message() << '\n';
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r367893 - Revert "Rename F_{None, Text, Append} to OF_{None, Text, Append}. NFC"

2019-08-05 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon Aug  5 10:23:23 2019
New Revision: 367893

URL: http://llvm.org/viewvc/llvm-project?rev=367893=rev
Log:
Revert "Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC"

This reverts commit 58c814614d2ac69bcf79b09543505fac80ada4e6.
Fixes build breakage using LLVM<7.

Modified:
libclc/trunk/utils/prepare-builtins.cpp

Modified: libclc/trunk/utils/prepare-builtins.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/utils/prepare-builtins.cpp?rev=367893=367892=367893=diff
==
--- libclc/trunk/utils/prepare-builtins.cpp (original)
+++ libclc/trunk/utils/prepare-builtins.cpp Mon Aug  5 10:23:23 2019
@@ -95,10 +95,10 @@ int main(int argc, char **argv) {
   std::error_code EC;
 #if HAVE_LLVM >= 0x0600
   std::unique_ptr Out(
-  new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None));
+  new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
 #else
   std::unique_ptr Out(
-  new tool_output_file(OutputFilename, EC, sys::fs::OF_None));
+  new tool_output_file(OutputFilename, EC, sys::fs::F_None));
 #endif
   if (EC) {
 errs() << EC.message() << '\n';


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r357125 - travis: Add LLVM-8 build

2019-03-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 27 14:28:31 2019
New Revision: 357125

URL: http://llvm.org/viewvc/llvm-project?rev=357125=rev
Log:
travis: Add LLVM-8 build

Reviewer: Tom Stellard
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=357125=357124=357125=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Wed Mar 27 14:28:31 2019
@@ -87,6 +87,23 @@ matrix:
 - llvm-7-dev
 - clang-7
 - env:
+- LABEL="make gcc LLVM-8"
+- LLVM_VERSION=8
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-8 main'
+  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+- g++-6
+# From sources above
+- llvm-8-dev
+- clang-8
+- env:
 - LABEL="cmake gcc LLVM-3.9"
 - LLVM_VERSION=3.9
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
@@ -163,6 +180,23 @@ matrix:
 # From sources above
 - llvm-7-dev
 - clang-7
+- env:
+- LABEL="cmake gcc LLVM-8"
+- LLVM_VERSION=8
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-8 main'
+  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+- g++-6
+# From sources above
+- llvm-8-dev
+- clang-8
 
 before_install:
 - eval "${MATRIX_EVAL}"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356028 - sincos: Simplify declaration headers.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:34 2019
New Revision: 356028

URL: http://llvm.org/viewvc/llvm-project?rev=356028=rev
Log:
sincos: Simplify declaration headers.

This follows the same pattern as modf and fract.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/generic/include/clc/math/sincos.inc

Modified: libclc/trunk/generic/include/clc/math/sincos.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sincos.inc?rev=356028=356027=356028=diff
==
--- libclc/trunk/generic/include/clc/math/sincos.inc (original)
+++ libclc/trunk/generic/include/clc/math/sincos.inc Wed Mar 13 00:13:34 2019
@@ -1,8 +1,3 @@
-#define __CLC_DECLARE_SINCOS(ADDRSPACE, TYPE) \
-  _CLC_OVERLOAD _CLC_DECL TYPE sincos (TYPE x, ADDRSPACE TYPE * cosval);
-
-__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE)
-__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE)
-__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE)
-
-#undef __CLC_DECLARE_SINCOS
+ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, global 
__CLC_GENTYPE * cosval);
+ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, local 
__CLC_GENTYPE * cosval);
+ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sincos (__CLC_GENTYPE x, private 
__CLC_GENTYPE * cosval);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356023 - atan2: Use binary_decl_tt.inc instead of custom inc file.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:24 2019
New Revision: 356023

URL: http://llvm.org/viewvc/llvm-project?rev=356023=rev
Log:
atan2: Use binary_decl_tt.inc instead of custom inc file.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/atan2.inc
Modified:
libclc/trunk/generic/include/clc/math/atan2.h

Modified: libclc/trunk/generic/include/clc/math/atan2.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atan2.h?rev=356023=356022=356023=diff
==
--- libclc/trunk/generic/include/clc/math/atan2.h (original)
+++ libclc/trunk/generic/include/clc/math/atan2.h Wed Mar 13 00:13:24 2019
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_FUNCTION atan2
+#define __CLC_BODY 
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/atan2.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atan2.inc?rev=356022=auto
==
--- libclc/trunk/generic/include/clc/math/atan2.inc (original)
+++ libclc/trunk/generic/include/clc/math/atan2.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atan2(__CLC_GENTYPE a, __CLC_GENTYPE b);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356024 - atan2pi: Use binary_decl_tt.inc instead of custom inc file.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:26 2019
New Revision: 356024

URL: http://llvm.org/viewvc/llvm-project?rev=356024=rev
Log:
atan2pi: Use binary_decl_tt.inc instead of custom inc file.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/atan2pi.inc
Modified:
libclc/trunk/generic/include/clc/math/atan2pi.h

Modified: libclc/trunk/generic/include/clc/math/atan2pi.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atan2pi.h?rev=356024=356023=356024=diff
==
--- libclc/trunk/generic/include/clc/math/atan2pi.h (original)
+++ libclc/trunk/generic/include/clc/math/atan2pi.h Wed Mar 13 00:13:26 2019
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_FUNCTION atan2pi
+#define __CLC_BODY 
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/atan2pi.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atan2pi.inc?rev=356023=auto
==
--- libclc/trunk/generic/include/clc/math/atan2pi.inc (original)
+++ libclc/trunk/generic/include/clc/math/atan2pi.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atan2pi(__CLC_GENTYPE x, __CLC_GENTYPE 
y);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356027 - fdim: Use binary_decl_tt.inc instead of custom inc file.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:32 2019
New Revision: 356027

URL: http://llvm.org/viewvc/llvm-project?rev=356027=rev
Log:
fdim: Use binary_decl_tt.inc instead of custom inc file.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/fdim.inc
Modified:
libclc/trunk/generic/include/clc/math/fdim.h

Modified: libclc/trunk/generic/include/clc/math/fdim.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fdim.h?rev=356027=356026=356027=diff
==
--- libclc/trunk/generic/include/clc/math/fdim.h (original)
+++ libclc/trunk/generic/include/clc/math/fdim.h Wed Mar 13 00:13:32 2019
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_FUNCTION fdim
+#define __CLC_BODY 
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/fdim.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fdim.inc?rev=356026=auto
==
--- libclc/trunk/generic/include/clc/math/fdim.inc (original)
+++ libclc/trunk/generic/include/clc/math/fdim.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fdim(__CLC_GENTYPE a, __CLC_GENTYPE b);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356025 - copysign: Use binary_decl_tt.inc instead of custom inc file.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:28 2019
New Revision: 356025

URL: http://llvm.org/viewvc/llvm-project?rev=356025=rev
Log:
copysign: Use binary_decl_tt.inc instead of custom inc file.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/copysign.inc
Modified:
libclc/trunk/generic/include/clc/math/copysign.h

Modified: libclc/trunk/generic/include/clc/math/copysign.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/copysign.h?rev=356025=356024=356025=diff
==
--- libclc/trunk/generic/include/clc/math/copysign.h (original)
+++ libclc/trunk/generic/include/clc/math/copysign.h Wed Mar 13 00:13:28 2019
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_FUNCTION copysign
+#define __CLC_BODY 
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/copysign.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/copysign.inc?rev=356024=auto
==
--- libclc/trunk/generic/include/clc/math/copysign.inc (original)
+++ libclc/trunk/generic/include/clc/math/copysign.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE copysign(__CLC_GENTYPE a, __CLC_GENTYPE 
b);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356022 - hypot: Use binary_decl_tt.inc instead of custom inc file

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:22 2019
New Revision: 356022

URL: http://llvm.org/viewvc/llvm-project?rev=356022=rev
Log:
hypot: Use binary_decl_tt.inc instead of custom inc file

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/hypot.inc
Modified:
libclc/trunk/generic/include/clc/math/hypot.h

Modified: libclc/trunk/generic/include/clc/math/hypot.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/hypot.h?rev=356022=356021=356022=diff
==
--- libclc/trunk/generic/include/clc/math/hypot.h (original)
+++ libclc/trunk/generic/include/clc/math/hypot.h Wed Mar 13 00:13:22 2019
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_FUNCTION hypot
+#define __CLC_BODY 
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/hypot.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/hypot.inc?rev=356021=auto
==
--- libclc/trunk/generic/include/clc/math/hypot.inc (original)
+++ libclc/trunk/generic/include/clc/math/hypot.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE hypot(__CLC_GENTYPE x, __CLC_GENTYPE y);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356026 - nextafter: Use binary_decl_tt.inc instead of custom inc file.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:13:30 2019
New Revision: 356026

URL: http://llvm.org/viewvc/llvm-project?rev=356026=rev
Log:
nextafter: Use binary_decl_tt.inc instead of custom inc file.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/nextafter.inc
Modified:
libclc/trunk/generic/include/clc/math/nextafter.h

Modified: libclc/trunk/generic/include/clc/math/nextafter.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/nextafter.h?rev=356026=356025=356026=diff
==
--- libclc/trunk/generic/include/clc/math/nextafter.h (original)
+++ libclc/trunk/generic/include/clc/math/nextafter.h Wed Mar 13 00:13:30 2019
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_FUNCTION nextafter
+#define __CLC_BODY 
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/nextafter.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/nextafter.inc?rev=356025=auto
==
--- libclc/trunk/generic/include/clc/math/nextafter.inc (original)
+++ libclc/trunk/generic/include/clc/math/nextafter.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE nextafter(__CLC_GENTYPE a, __CLC_GENTYPE 
b);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356020 - Move binary_intrinsic.h to private headers.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:15 2019
New Revision: 356020

URL: http://llvm.org/viewvc/llvm-project?rev=356020=rev
Log:
Move binary_intrinsic.h to private headers.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/math/binary_intrin.inc
  - copied, changed from r356019, 
libclc/trunk/generic/include/clc/math/binary_intrin.inc
Removed:
libclc/trunk/generic/include/clc/math/binary_intrin.inc

Removed: libclc/trunk/generic/include/clc/math/binary_intrin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/binary_intrin.inc?rev=356019=auto
==
--- libclc/trunk/generic/include/clc/math/binary_intrin.inc (original)
+++ libclc/trunk/generic/include/clc/math/binary_intrin.inc (removed)
@@ -1,29 +0,0 @@
-_CLC_OVERLOAD float __CLC_FUNCTION(float, float) __asm(__CLC_INTRINSIC ".f32");
-_CLC_OVERLOAD float2 __CLC_FUNCTION(float2, float2) __asm(__CLC_INTRINSIC 
".v2f32");
-_CLC_OVERLOAD float3 __CLC_FUNCTION(float3, float3) __asm(__CLC_INTRINSIC 
".v3f32");
-_CLC_OVERLOAD float4 __CLC_FUNCTION(float4, float4) __asm(__CLC_INTRINSIC 
".v4f32");
-_CLC_OVERLOAD float8 __CLC_FUNCTION(float8, float8) __asm(__CLC_INTRINSIC 
".v8f32");
-_CLC_OVERLOAD float16 __CLC_FUNCTION(float16, float16) __asm(__CLC_INTRINSIC 
".v16f32");
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-_CLC_OVERLOAD double __CLC_FUNCTION(double, double) __asm(__CLC_INTRINSIC 
".f64");
-_CLC_OVERLOAD double2 __CLC_FUNCTION(double2, double2) __asm(__CLC_INTRINSIC 
".v2f64");
-_CLC_OVERLOAD double3 __CLC_FUNCTION(double3, double3) __asm(__CLC_INTRINSIC 
".v3f64");
-_CLC_OVERLOAD double4 __CLC_FUNCTION(double4, double4) __asm(__CLC_INTRINSIC 
".v4f64");
-_CLC_OVERLOAD double8 __CLC_FUNCTION(double8, double8) __asm(__CLC_INTRINSIC 
".v8f64");
-_CLC_OVERLOAD double16 __CLC_FUNCTION(double16, double16) 
__asm(__CLC_INTRINSIC ".v16f64");
-#endif
-
-#ifdef cl_khr_fp16
-#pragma OPENCL EXTENSION cl_khr_fp16 : enable
-_CLC_OVERLOAD half __CLC_FUNCTION(half, half) __asm(__CLC_INTRINSIC ".f16");
-_CLC_OVERLOAD half2 __CLC_FUNCTION(half2, half2) __asm(__CLC_INTRINSIC 
".v2f16");
-_CLC_OVERLOAD half3 __CLC_FUNCTION(half3, half3) __asm(__CLC_INTRINSIC 
".v3f16");
-_CLC_OVERLOAD half4 __CLC_FUNCTION(half4, half4) __asm(__CLC_INTRINSIC 
".v4f16");
-_CLC_OVERLOAD half8 __CLC_FUNCTION(half8, half8) __asm(__CLC_INTRINSIC 
".v8f16");
-_CLC_OVERLOAD half16 __CLC_FUNCTION(half16, half16) __asm(__CLC_INTRINSIC 
".v16f16");
-#endif
-
-#undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC

Copied: libclc/trunk/generic/include/math/binary_intrin.inc (from r356019, 
libclc/trunk/generic/include/clc/math/binary_intrin.inc)
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/binary_intrin.inc?p2=libclc/trunk/generic/include/math/binary_intrin.inc=libclc/trunk/generic/include/clc/math/binary_intrin.inc=356019=356020=356020=diff
==
(empty)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356016 - rint: Remove llvm intrinsic from the header.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:06 2019
New Revision: 356016

URL: http://llvm.org/viewvc/llvm-project?rev=356016=rev
Log:
rint: Remove llvm intrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/rint.cl
Modified:
libclc/trunk/generic/include/clc/math/rint.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/rint.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/rint.h?rev=356016=356015=356016=diff
==
--- libclc/trunk/generic/include/clc/math/rint.h (original)
+++ libclc/trunk/generic/include/clc/math/rint.h Wed Mar 13 00:06:06 2019
@@ -1,6 +1,7 @@
-#undef rint
-#define rint __clc_rint
+#define __CLC_BODY 
+#define __CLC_FUNCTION rint
 
-#define __CLC_FUNCTION __clc_rint
-#define __CLC_INTRINSIC "llvm.rint"
-#include 
+#include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=356016=356015=356016=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Mar 13 00:06:06 2019
@@ -172,6 +172,7 @@ math/clc_remainder.cl
 math/remainder.cl
 math/clc_remquo.cl
 math/remquo.cl
+math/rint.cl
 math/clc_rootn.cl
 math/rootn.cl
 math/sin.cl

Added: libclc/trunk/generic/lib/math/rint.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/rint.cl?rev=356016=auto
==
--- libclc/trunk/generic/lib/math/rint.cl (added)
+++ libclc/trunk/generic/lib/math/rint.cl Wed Mar 13 00:06:06 2019
@@ -0,0 +1,10 @@
+#include 
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_rint
+#define __CLC_INTRINSIC "llvm.rint"
+#include 
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION rint
+#include "unary_builtin.inc"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356018 - trunc: Remove llvm intrinsic from the header.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:10 2019
New Revision: 356018

URL: http://llvm.org/viewvc/llvm-project?rev=356018=rev
Log:
trunc: Remove llvm intrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/trunc.cl
  - copied, changed from r356017, 
libclc/trunk/generic/include/clc/math/trunc.h
Modified:
libclc/trunk/generic/include/clc/math/trunc.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/trunc.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/trunc.h?rev=356018=356017=356018=diff
==
--- libclc/trunk/generic/include/clc/math/trunc.h (original)
+++ libclc/trunk/generic/include/clc/math/trunc.h Wed Mar 13 00:06:10 2019
@@ -1,9 +1,7 @@
-#undef trunc
-#define trunc __clc_trunc
+#define __CLC_BODY 
+#define __CLC_FUNCTION trunc
 
-#define __CLC_FUNCTION __clc_trunc
-#define __CLC_INTRINSIC "llvm.trunc"
-#include 
+#include 
 
+#undef __CLC_BODY
 #undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=356018=356017=356018=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Mar 13 00:06:10 2019
@@ -189,6 +189,7 @@ math/tanh.cl
 math/clc_tanpi.cl
 math/tanpi.cl
 math/tgamma.cl
+math/trunc.cl
 misc/shuffle.cl
 misc/shuffle2.cl
 relational/all.cl

Copied: libclc/trunk/generic/lib/math/trunc.cl (from r356017, 
libclc/trunk/generic/include/clc/math/trunc.h)
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/trunc.cl?p2=libclc/trunk/generic/lib/math/trunc.cl=libclc/trunk/generic/include/clc/math/trunc.h=356017=356018=356018=diff
==
--- libclc/trunk/generic/include/clc/math/trunc.h (original)
+++ libclc/trunk/generic/lib/math/trunc.cl Wed Mar 13 00:06:10 2019
@@ -1,9 +1,10 @@
-#undef trunc
-#define trunc __clc_trunc
+#include 
 
+// Map the llvm intrinsic to an OpenCL function.
 #define __CLC_FUNCTION __clc_trunc
 #define __CLC_INTRINSIC "llvm.trunc"
 #include 
 
 #undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC
+#define __CLC_FUNCTION trunc
+#include "unary_builtin.inc"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356021 - Move unary_instrinsic.inc to private headers.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:19 2019
New Revision: 356021

URL: http://llvm.org/viewvc/llvm-project?rev=356021=rev
Log:
Move unary_instrinsic.inc to private headers.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/math/unary_intrin.inc
  - copied, changed from r356020, 
libclc/trunk/generic/include/clc/math/unary_intrin.inc
Removed:
libclc/trunk/generic/include/clc/math/unary_intrin.inc
Modified:
libclc/trunk/generic/lib/math/ceil.cl
libclc/trunk/generic/lib/math/clc_sqrt.cl
libclc/trunk/generic/lib/math/fabs.cl
libclc/trunk/generic/lib/math/floor.cl
libclc/trunk/generic/lib/math/native_unary_intrinsic.inc
libclc/trunk/generic/lib/math/rint.cl
libclc/trunk/generic/lib/math/round.cl
libclc/trunk/generic/lib/math/trunc.cl

Removed: libclc/trunk/generic/include/clc/math/unary_intrin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/unary_intrin.inc?rev=356020=auto
==
--- libclc/trunk/generic/include/clc/math/unary_intrin.inc (original)
+++ libclc/trunk/generic/include/clc/math/unary_intrin.inc (removed)
@@ -1,29 +0,0 @@
-_CLC_OVERLOAD float __CLC_FUNCTION(float f) __asm(__CLC_INTRINSIC ".f32");
-_CLC_OVERLOAD float2 __CLC_FUNCTION(float2 f) __asm(__CLC_INTRINSIC ".v2f32");
-_CLC_OVERLOAD float3 __CLC_FUNCTION(float3 f) __asm(__CLC_INTRINSIC ".v3f32");
-_CLC_OVERLOAD float4 __CLC_FUNCTION(float4 f) __asm(__CLC_INTRINSIC ".v4f32");
-_CLC_OVERLOAD float8 __CLC_FUNCTION(float8 f) __asm(__CLC_INTRINSIC ".v8f32");
-_CLC_OVERLOAD float16 __CLC_FUNCTION(float16 f) __asm(__CLC_INTRINSIC 
".v16f32");
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-_CLC_OVERLOAD double __CLC_FUNCTION(double d) __asm(__CLC_INTRINSIC ".f64");
-_CLC_OVERLOAD double2 __CLC_FUNCTION(double2 d) __asm(__CLC_INTRINSIC 
".v2f64");
-_CLC_OVERLOAD double3 __CLC_FUNCTION(double3 d) __asm(__CLC_INTRINSIC 
".v3f64");
-_CLC_OVERLOAD double4 __CLC_FUNCTION(double4 d) __asm(__CLC_INTRINSIC 
".v4f64");
-_CLC_OVERLOAD double8 __CLC_FUNCTION(double8 d) __asm(__CLC_INTRINSIC 
".v8f64");
-_CLC_OVERLOAD double16 __CLC_FUNCTION(double16 d) __asm(__CLC_INTRINSIC 
".v16f64");
-#endif
-
-#ifdef cl_khr_fp16
-#pragma OPENCL EXTENSION cl_khr_fp16: enable
-_CLC_OVERLOAD half __CLC_FUNCTION(half d) __asm(__CLC_INTRINSIC ".f16");
-_CLC_OVERLOAD half2 __CLC_FUNCTION(half2 d) __asm(__CLC_INTRINSIC ".v2f16");
-_CLC_OVERLOAD half3 __CLC_FUNCTION(half3 d) __asm(__CLC_INTRINSIC ".v3f16");
-_CLC_OVERLOAD half4 __CLC_FUNCTION(half4 d) __asm(__CLC_INTRINSIC ".v4f16");
-_CLC_OVERLOAD half8 __CLC_FUNCTION(half8 d) __asm(__CLC_INTRINSIC ".v8f16");
-_CLC_OVERLOAD half16 __CLC_FUNCTION(half16 d) __asm(__CLC_INTRINSIC ".v16f16");
-#endif
-
-#undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC

Copied: libclc/trunk/generic/include/math/unary_intrin.inc (from r356020, 
libclc/trunk/generic/include/clc/math/unary_intrin.inc)
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/unary_intrin.inc?p2=libclc/trunk/generic/include/math/unary_intrin.inc=libclc/trunk/generic/include/clc/math/unary_intrin.inc=356020=356021=356021=diff
==
(empty)

Modified: libclc/trunk/generic/lib/math/ceil.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/ceil.cl?rev=356021=356020=356021=diff
==
--- libclc/trunk/generic/lib/math/ceil.cl (original)
+++ libclc/trunk/generic/lib/math/ceil.cl Wed Mar 13 00:06:19 2019
@@ -4,7 +4,7 @@
 // Map the llvm intrinsic to an OpenCL function.
 #define __CLC_FUNCTION __clc_ceil
 #define __CLC_INTRINSIC "llvm.ceil"
-#include 
+#include "math/unary_intrin.inc"
 
 #undef __CLC_FUNCTION
 #define __CLC_FUNCTION ceil

Modified: libclc/trunk/generic/lib/math/clc_sqrt.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_sqrt.cl?rev=356021=356020=356021=diff
==
--- libclc/trunk/generic/lib/math/clc_sqrt.cl (original)
+++ libclc/trunk/generic/lib/math/clc_sqrt.cl Wed Mar 13 00:06:19 2019
@@ -25,7 +25,7 @@
 // Map the llvm sqrt intrinsic to an OpenCL function.
 #define __CLC_FUNCTION __clc_llvm_intr_sqrt
 #define __CLC_INTRINSIC "llvm.sqrt"
-#include 
+#include 
 #undef __CLC_FUNCTION
 #undef __CLC_INTRINSIC
 

Modified: libclc/trunk/generic/lib/math/fabs.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/fabs.cl?rev=356021=356020=356021=diff
==
--- libclc/trunk/generic/lib/math/fabs.cl (original)
+++ libclc/trunk/generic/lib/math/fabs.cl Wed Mar 13 00:06:19 2019
@@ -4,7 +4,7 @@
 // Map the llvm intrinsic to an OpenCL function.
 #define __CLC_FUNCTION __clc_fabs
 #define 

[libclc] r356019 - Move ternary_intrinsic.h to private headers.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:13 2019
New Revision: 356019

URL: http://llvm.org/viewvc/llvm-project?rev=356019=rev
Log:
Move ternary_intrinsic.h to private headers.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/math/ternary_intrin.inc
  - copied, changed from r356018, 
libclc/trunk/generic/include/clc/math/ternary_intrin.inc
Removed:
libclc/trunk/generic/include/clc/math/ternary_intrin.inc
Modified:
libclc/trunk/generic/include/math/clc_fma.h

Removed: libclc/trunk/generic/include/clc/math/ternary_intrin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/ternary_intrin.inc?rev=356018=auto
==
--- libclc/trunk/generic/include/clc/math/ternary_intrin.inc (original)
+++ libclc/trunk/generic/include/clc/math/ternary_intrin.inc (removed)
@@ -1,30 +0,0 @@
-_CLC_OVERLOAD float __CLC_FUNCTION(float, float, float) __asm(__CLC_INTRINSIC 
".f32");
-_CLC_OVERLOAD float2 __CLC_FUNCTION(float2, float2, float2) 
__asm(__CLC_INTRINSIC ".v2f32");
-_CLC_OVERLOAD float3 __CLC_FUNCTION(float3, float3, float3) 
__asm(__CLC_INTRINSIC ".v3f32");
-_CLC_OVERLOAD float4 __CLC_FUNCTION(float4, float4, float4) 
__asm(__CLC_INTRINSIC ".v4f32");
-_CLC_OVERLOAD float8 __CLC_FUNCTION(float8, float8, float8) 
__asm(__CLC_INTRINSIC ".v8f32");
-_CLC_OVERLOAD float16 __CLC_FUNCTION(float16, float16, float16) 
__asm(__CLC_INTRINSIC ".v16f32");
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-_CLC_OVERLOAD double __CLC_FUNCTION(double, double, double) 
__asm(__CLC_INTRINSIC ".f64");
-_CLC_OVERLOAD double2 __CLC_FUNCTION(double2, double2, double2) 
__asm(__CLC_INTRINSIC ".v2f64");
-_CLC_OVERLOAD double3 __CLC_FUNCTION(double3, double3, double3) 
__asm(__CLC_INTRINSIC ".v3f64");
-_CLC_OVERLOAD double4 __CLC_FUNCTION(double4, double4, double4) 
__asm(__CLC_INTRINSIC ".v4f64");
-_CLC_OVERLOAD double8 __CLC_FUNCTION(double8, double8, double8) 
__asm(__CLC_INTRINSIC ".v8f64");
-_CLC_OVERLOAD double16 __CLC_FUNCTION(double16, double16, double16) 
__asm(__CLC_INTRINSIC ".v16f64");
-#endif
-
-#ifdef cl_khr_fp16
-#pragma OPENCL EXTENSION cl_khr_fp16: enable
-_CLC_OVERLOAD half __CLC_FUNCTION(half, half, half) __asm(__CLC_INTRINSIC 
".f16");
-_CLC_OVERLOAD half2 __CLC_FUNCTION(half2, half2, half2) __asm(__CLC_INTRINSIC 
".v2f16");
-_CLC_OVERLOAD half3 __CLC_FUNCTION(half3, half3, half3) __asm(__CLC_INTRINSIC 
".v3f16");
-_CLC_OVERLOAD half4 __CLC_FUNCTION(half4, half4, half4) __asm(__CLC_INTRINSIC 
".v4f16");
-_CLC_OVERLOAD half8 __CLC_FUNCTION(half8, half8, half8) __asm(__CLC_INTRINSIC 
".v8f16");
-_CLC_OVERLOAD half16 __CLC_FUNCTION(half16, half16, half16) 
__asm(__CLC_INTRINSIC ".v16f16");
-#endif
-
-
-#undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC

Modified: libclc/trunk/generic/include/math/clc_fma.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_fma.h?rev=356019=356018=356019=diff
==
--- libclc/trunk/generic/include/math/clc_fma.h (original)
+++ libclc/trunk/generic/include/math/clc_fma.h Wed Mar 13 00:06:13 2019
@@ -1,6 +1,6 @@
 #define __CLC_FUNCTION __clc_fma
 #define __CLC_INTRINSIC "llvm.fma"
-#include 
+#include "math/ternary_intrin.inc"
 
 #define __FLOAT_ONLY
 #define __CLC_FUNCTION __clc_sw_fma

Copied: libclc/trunk/generic/include/math/ternary_intrin.inc (from r356018, 
libclc/trunk/generic/include/clc/math/ternary_intrin.inc)
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/ternary_intrin.inc?p2=libclc/trunk/generic/include/math/ternary_intrin.inc=libclc/trunk/generic/include/clc/math/ternary_intrin.inc=356018=356019=356019=diff
==
(empty)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356015 - floor: Remove llvm isntrinsic from the header.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:03 2019
New Revision: 356015

URL: http://llvm.org/viewvc/llvm-project?rev=356015=rev
Log:
floor: Remove llvm isntrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/floor.cl
Modified:
libclc/trunk/generic/include/clc/math/floor.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/floor.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/floor.h?rev=356015=356014=356015=diff
==
--- libclc/trunk/generic/include/clc/math/floor.h (original)
+++ libclc/trunk/generic/include/clc/math/floor.h Wed Mar 13 00:06:03 2019
@@ -1,6 +1,7 @@
-#undef floor
-#define floor __clc_floor
+#define __CLC_BODY 
+#define __CLC_FUNCTION floor
 
-#define __CLC_FUNCTION __clc_floor
-#define __CLC_INTRINSIC "llvm.floor"
-#include 
+#include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=356015=356014=356015=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Mar 13 00:06:03 2019
@@ -105,6 +105,7 @@ math/clc_exp10.cl
 math/exp10.cl
 math/fabs.cl
 math/fdim.cl
+math/floor.cl
 math/clc_fma.cl
 math/fma.cl
 math/fmax.cl

Added: libclc/trunk/generic/lib/math/floor.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/floor.cl?rev=356015=auto
==
--- libclc/trunk/generic/lib/math/floor.cl (added)
+++ libclc/trunk/generic/lib/math/floor.cl Wed Mar 13 00:06:03 2019
@@ -0,0 +1,11 @@
+#include 
+#include "../clcmacro.h"
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_floor
+#define __CLC_INTRINSIC "llvm.floor"
+#include 
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION floor
+#include "unary_builtin.inc"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356017 - round: Remove llvm intrinsic from the header

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:08 2019
New Revision: 356017

URL: http://llvm.org/viewvc/llvm-project?rev=356017=rev
Log:
round: Remove llvm intrinsic from the header

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/round.cl
  - copied, changed from r356016, 
libclc/trunk/generic/include/clc/math/round.h
Modified:
libclc/trunk/generic/include/clc/math/round.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/round.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/round.h?rev=356017=356016=356017=diff
==
--- libclc/trunk/generic/include/clc/math/round.h (original)
+++ libclc/trunk/generic/include/clc/math/round.h Wed Mar 13 00:06:08 2019
@@ -1,9 +1,7 @@
-#undef round
-#define round __clc_round
+#define __CLC_BODY 
+#define __CLC_FUNCTION round
 
-#define __CLC_FUNCTION __clc_round
-#define __CLC_INTRINSIC "llvm.round"
-#include 
+#include 
 
+#undef __CLC_BODY
 #undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=356017=356016=356017=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Mar 13 00:06:08 2019
@@ -175,6 +175,7 @@ math/remquo.cl
 math/rint.cl
 math/clc_rootn.cl
 math/rootn.cl
+math/round.cl
 math/sin.cl
 math/sincos.cl
 math/sincos_helpers.cl

Copied: libclc/trunk/generic/lib/math/round.cl (from r356016, 
libclc/trunk/generic/include/clc/math/round.h)
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/round.cl?p2=libclc/trunk/generic/lib/math/round.cl=libclc/trunk/generic/include/clc/math/round.h=356016=356017=356017=diff
==
--- libclc/trunk/generic/include/clc/math/round.h (original)
+++ libclc/trunk/generic/lib/math/round.cl Wed Mar 13 00:06:08 2019
@@ -1,9 +1,10 @@
-#undef round
-#define round __clc_round
+#include 
 
+// Map the llvm intrinsic to an OpenCL function.
 #define __CLC_FUNCTION __clc_round
 #define __CLC_INTRINSIC "llvm.round"
 #include 
 
 #undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC
+#define __CLC_FUNCTION round
+#include "unary_builtin.inc"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356014 - fabs: Remove llvm intrinsic from the header.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:06:00 2019
New Revision: 356014

URL: http://llvm.org/viewvc/llvm-project?rev=356014=rev
Log:
fabs: Remove llvm intrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/fabs.cl
Modified:
libclc/trunk/generic/include/clc/math/fabs.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/fabs.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fabs.h?rev=356014=356013=356014=diff
==
--- libclc/trunk/generic/include/clc/math/fabs.h (original)
+++ libclc/trunk/generic/include/clc/math/fabs.h Wed Mar 13 00:06:00 2019
@@ -1,6 +1,7 @@
-#undef fabs
-#define fabs __clc_fabs
+#define __CLC_BODY 
+#define __CLC_FUNCTION fabs
 
-#define __CLC_FUNCTION __clc_fabs
-#define __CLC_INTRINSIC "llvm.fabs"
-#include 
+#include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=356014=356013=356014=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Mar 13 00:06:00 2019
@@ -103,6 +103,7 @@ math/expm1.cl
 math/exp2.cl
 math/clc_exp10.cl
 math/exp10.cl
+math/fabs.cl
 math/fdim.cl
 math/clc_fma.cl
 math/fma.cl

Added: libclc/trunk/generic/lib/math/fabs.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/fabs.cl?rev=356014=auto
==
--- libclc/trunk/generic/lib/math/fabs.cl (added)
+++ libclc/trunk/generic/lib/math/fabs.cl Wed Mar 13 00:06:00 2019
@@ -0,0 +1,11 @@
+#include 
+#include "../clcmacro.h"
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_fabs
+#define __CLC_INTRINSIC "llvm.fabs"
+#include 
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION fabs
+#include "unary_builtin.inc"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356013 - ceil: Remove llvm intrinsic from the header.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:05:58 2019
New Revision: 356013

URL: http://llvm.org/viewvc/llvm-project?rev=356013=rev
Log:
ceil: Remove llvm intrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/ceil.cl
Modified:
libclc/trunk/generic/include/clc/math/ceil.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/ceil.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/ceil.h?rev=356013=356012=356013=diff
==
--- libclc/trunk/generic/include/clc/math/ceil.h (original)
+++ libclc/trunk/generic/include/clc/math/ceil.h Wed Mar 13 00:05:58 2019
@@ -1,6 +1,7 @@
-#undef ceil
-#define ceil __clc_ceil
+#define __CLC_BODY 
+#define __CLC_FUNCTION ceil
 
-#define __CLC_FUNCTION __clc_ceil
-#define __CLC_INTRINSIC "llvm.ceil"
-#include 
+#include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=356013=356012=356013=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Mar 13 00:05:58 2019
@@ -89,6 +89,7 @@ math/atan2pi.cl
 math/atanh.cl
 math/atanpi.cl
 math/cbrt.cl
+math/ceil.cl
 math/copysign.cl
 math/cos.cl
 math/cosh.cl

Added: libclc/trunk/generic/lib/math/ceil.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/ceil.cl?rev=356013=auto
==
--- libclc/trunk/generic/lib/math/ceil.cl (added)
+++ libclc/trunk/generic/lib/math/ceil.cl Wed Mar 13 00:05:58 2019
@@ -0,0 +1,11 @@
+#include 
+#include "../clcmacro.h"
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_ceil
+#define __CLC_INTRINSIC "llvm.ceil"
+#include 
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION ceil
+#include "unary_builtin.inc"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356012 - sqrt: Split function generation to a shared inc file.

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:05:56 2019
New Revision: 356012

URL: http://llvm.org/viewvc/llvm-project?rev=356012=rev
Log:
sqrt: Split function generation to a shared inc file.

This will be reused by other unary functions.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/math/unary_builtin.inc
Modified:
libclc/trunk/generic/lib/math/sqrt.cl

Modified: libclc/trunk/generic/lib/math/sqrt.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/sqrt.cl?rev=356012=356011=356012=diff
==
--- libclc/trunk/generic/lib/math/sqrt.cl (original)
+++ libclc/trunk/generic/lib/math/sqrt.cl Wed Mar 13 00:05:56 2019
@@ -21,23 +21,7 @@
  */
 
 #include 
-#include "../clcmacro.h"
 #include "math/clc_sqrt.h"
 
-_CLC_DEFINE_UNARY_BUILTIN(float, sqrt, __clc_sqrt, float)
-
-#ifdef cl_khr_fp64
-
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-
-_CLC_DEFINE_UNARY_BUILTIN(double, sqrt, __clc_sqrt, double)
-
-#endif
-
-#ifdef cl_khr_fp16
-
-#pragma OPENCL EXTENSION cl_khr_fp16 : enable
-
-_CLC_DEFINE_UNARY_BUILTIN(half, sqrt, __clc_sqrt, half)
-
-#endif
+#define __CLC_FUNCTION sqrt
+#include "unary_builtin.inc"

Added: libclc/trunk/generic/lib/math/unary_builtin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/unary_builtin.inc?rev=356012=auto
==
--- libclc/trunk/generic/lib/math/unary_builtin.inc (added)
+++ libclc/trunk/generic/lib/math/unary_builtin.inc Wed Mar 13 00:05:56 2019
@@ -0,0 +1,24 @@
+#include "../clcmacro.h"
+#include "utils.h"
+
+#ifndef __CLC_BUILTIN
+#define __CLC_BUILTIN __CLC_XCONCAT(__clc_, __CLC_FUNCTION)
+#endif
+
+_CLC_DEFINE_UNARY_BUILTIN(float, __CLC_FUNCTION, __CLC_BUILTIN, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_DEFINE_UNARY_BUILTIN(double, __CLC_FUNCTION, __CLC_BUILTIN, double)
+
+#endif
+
+#ifdef cl_khr_fp16
+
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+_CLC_DEFINE_UNARY_BUILTIN(half, __CLC_FUNCTION, __CLC_BUILTIN, half)
+
+#endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356011 - mad: Convert to standard ternary header

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Mar 13 00:05:53 2019
New Revision: 356011

URL: http://llvm.org/viewvc/llvm-project?rev=356011=rev
Log:
mad: Convert to standard ternary header

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely 

Removed:
libclc/trunk/generic/include/clc/math/mad.inc
Modified:
libclc/trunk/generic/include/clc/math/mad.h

Modified: libclc/trunk/generic/include/clc/math/mad.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/mad.h?rev=356011=356010=356011=diff
==
--- libclc/trunk/generic/include/clc/math/mad.h (original)
+++ libclc/trunk/generic/include/clc/math/mad.h Wed Mar 13 00:05:53 2019
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION mad
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/mad.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/mad.inc?rev=356010=auto
==
--- libclc/trunk/generic/include/clc/math/mad.inc (original)
+++ libclc/trunk/generic/include/clc/math/mad.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad(__CLC_GENTYPE a, __CLC_GENTYPE b, 
__CLC_GENTYPE c);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r356010 - travis: Deduplicate LLVM_CONFIG variable

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Mar 12 23:58:53 2019
New Revision: 356010

URL: http://llvm.org/viewvc/llvm-project?rev=356010=rev
Log:
travis: Deduplicate LLVM_CONFIG variable

Reviewers: Aaron Watry, Tom Stellard
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=356010=356009=356010=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Tue Mar 12 23:58:53 2019
@@ -12,7 +12,6 @@ matrix:
 - env:
 - LABEL="make gcc LLVM-3.9"
 - LLVM_VERSION=3.9
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
   addons:
 apt:
@@ -27,7 +26,6 @@ matrix:
 - env:
 - LABEL="make gcc LLVM-4.0"
 - LLVM_VERSION=4.0
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
@@ -42,7 +40,6 @@ matrix:
 - env:
 - LABEL="make gcc LLVM-5.0"
 - LLVM_VERSION=5.0
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
@@ -57,7 +54,6 @@ matrix:
 - env:
 - LABEL="make gcc LLVM-6.0"
 - LLVM_VERSION=6.0
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
 # llvm passes -Werror=date-time which is only supported in gcc-4.9+
 - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
@@ -76,7 +72,6 @@ matrix:
 - env:
 - LABEL="make gcc LLVM-7"
 - LLVM_VERSION=7
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
 - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
   addons:
@@ -94,7 +89,6 @@ matrix:
 - env:
 - LABEL="cmake gcc LLVM-3.9"
 - LLVM_VERSION=3.9
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
   addons:
 apt:
@@ -109,7 +103,6 @@ matrix:
 - env:
 - LABEL="cmake gcc LLVM-4.0"
 - LLVM_VERSION=4.0
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
@@ -124,7 +117,6 @@ matrix:
 - env:
 - LABEL="cmake gcc LLVM-5.0"
 - LLVM_VERSION=5.0
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
@@ -139,7 +131,6 @@ matrix:
 - env:
 - LABEL="cmake gcc LLVM-6.0"
 - LLVM_VERSION=6.0
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
 # llvm passes -Werror=date-time which is only supported in gcc-4.9+
 - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
@@ -158,7 +149,6 @@ matrix:
 - env:
 - LABEL="cmake gcc LLVM-7"
 - LLVM_VERSION=7
-- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
 - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
   addons:
@@ -176,6 +166,7 @@ matrix:
 
 before_install:
 - eval "${MATRIX_EVAL}"
+- export LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 
 script:
   - if $(echo $LABEL | grep cmake > /dev/null) ; then


___
cfe-commits mailing list
cfe-commits@lists.llvm.org

[libclc] r356009 - travis: Use gcc-6 for llvm-7 build

2019-03-13 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Mar 12 23:58:51 2019
New Revision: 356009

URL: http://llvm.org/viewvc/llvm-project?rev=356009=rev
Log:
travis: Use gcc-6 for llvm-7 build

llvm does not expose -std=c++11 in cxx flags.
gcc-6 switched default from c++98 to c++14

Reviewers: Aaron Watry, Tom Stellard
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=356009=356008=356009=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Tue Mar 12 23:58:51 2019
@@ -78,8 +78,7 @@ matrix:
 - LLVM_VERSION=7
 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-# llvm passes -Werror=date-time which is only supported in gcc-4.9+
-- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
   addons:
 apt:
   sources:
@@ -88,8 +87,7 @@ matrix:
 - ubuntu-toolchain-r-test
   packages:
 - libedit-dev
-# LLVM-7 needs libstdc++4.9
-- g++-4.9
+- g++-6
 # From sources above
 - llvm-7-dev
 - clang-7
@@ -162,8 +160,7 @@ matrix:
 - LLVM_VERSION=7
 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
 - CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
-# llvm passes -Werror=date-time which is only supported in gcc-4.9+
-- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
   addons:
 apt:
   sources:
@@ -172,8 +169,7 @@ matrix:
 - ubuntu-toolchain-r-test
   packages:
 - libedit-dev
-# LLVM-7 needs libstdc++4.9
-- g++-4.9
+- g++-6
 # From sources above
 - llvm-7-dev
 - clang-7


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r350565 - cmake: Install libraries to DATADIR from GNUInstallDirs

2019-01-07 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon Jan  7 12:20:37 2019
New Revision: 350565

URL: http://llvm.org/viewvc/llvm-project?rev=350565=rev
Log:
cmake: Install libraries to DATADIR from GNUInstallDirs

This moves default installation location to /usr/share to match libclc.pc.
Signed-off-by: Jan Vesely 
Reviewer: Tom Stellard

Modified:
libclc/trunk/CMakeLists.txt
libclc/trunk/libclc.pc.in

Modified: libclc/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/CMakeLists.txt?rev=350565=350564=350565=diff
==
--- libclc/trunk/CMakeLists.txt (original)
+++ libclc/trunk/CMakeLists.txt Mon Jan  7 12:20:37 2019
@@ -1,6 +1,7 @@
 cmake_minimum_required( VERSION 3.9.2 )
 
 project( libclc VERSION 0.2.0 LANGUAGES CXX )
+include( GNUInstallDirs )
 
 # List of all targets
 set( LIBCLC_TARGETS_ALL
@@ -145,8 +146,8 @@ endif()
 
 # pkg-config file
 configure_file( libclc.pc.in libclc.pc @ONLY )
-install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION 
share/pkgconfig )
-install( DIRECTORY generic/include/clc DESTINATION include )
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION 
${CMAKE_INSTALL_DATADIR}/pkgconfig )
+install( DIRECTORY generic/include/clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 
)
 
 if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_use_default STATIC
@@ -154,7 +155,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_disable STATIC
generic/lib/subnormal_disable.ll )
install( TARGETS subnormal_use_default subnormal_disable ARCHIVE
-   DESTINATION lib/clc )
+   DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
 endif()
 
 find_program( PYTHON python )
@@ -274,7 +275,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
prepare_builtins )
add_custom_target( "prepare-${obj_suffix}" ALL
   DEPENDS "${obj_suffix}" )
-   install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} 
DESTINATION lib/clc )
+   install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} 
DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
# nvptx-- targets don't include workitem builtins
if( NOT ${t} MATCHES ".*ptx.*--$" )
add_test( NAME external-calls-${obj_suffix}
@@ -292,7 +293,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
   create_symlink ${obj_suffix}
   ${alias_suffix}
   DEPENDS "prepare-${obj_suffix}" )
-   install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION lib/clc )
+   install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION 
${CMAKE_INSTALL_DATADIR}/clc )
endforeach( a )
endforeach( d )
 endforeach( t )

Modified: libclc/trunk/libclc.pc.in
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/libclc.pc.in?rev=350565=350564=350565=diff
==
--- libclc/trunk/libclc.pc.in (original)
+++ libclc/trunk/libclc.pc.in Mon Jan  7 12:20:37 2019
@@ -1,5 +1,5 @@
-includedir=@CMAKE_INSTALL_PREFIX@/include
-libexecdir=@CMAKE_INSTALL_PREFIX@/lib/clc
+includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
+libexecdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/clc
 
 Name: libclc
 Description: Library requirements of the OpenCL C programming language


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r347668 - travis: Add cmake build

2018-11-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Nov 27 08:07:21 2018
New Revision: 347668

URL: http://llvm.org/viewvc/llvm-project?rev=347668=rev
Log:
travis: Add cmake build

Reviewer: Aaron Watry

Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=347668=347667=347668=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Tue Nov 27 08:07:21 2018
@@ -93,12 +93,100 @@ matrix:
 # From sources above
 - llvm-7-dev
 - clang-7
+- env:
+- LABEL="cmake gcc LLVM-3.9"
+- LLVM_VERSION=3.9
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+  addons:
+apt:
+  sources:
+- llvm-toolchain-trusty-3.9
+  packages:
+- libedit-dev
+- g++-4.8
+# From sources above
+- llvm-3.9-dev
+- clang-3.9
+- env:
+- LABEL="cmake gcc LLVM-4.0"
+- LLVM_VERSION=4.0
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+  addons:
+apt:
+  sources:
+- llvm-toolchain-trusty-4.0
+  packages:
+- libedit-dev
+- g++-4.8
+# From sources above
+- llvm-4.0-dev
+- clang-4.0
+- env:
+- LABEL="cmake gcc LLVM-5.0"
+- LLVM_VERSION=5.0
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+  addons:
+apt:
+  sources:
+- llvm-toolchain-trusty-5.0
+  packages:
+- libedit-dev
+- g++-4.8
+# From sources above
+- llvm-5.0-dev
+- clang-5.0
+- env:
+- LABEL="cmake gcc LLVM-6.0"
+- LLVM_VERSION=6.0
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+# llvm passes -Werror=date-time which is only supported in gcc-4.9+
+- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+  addons:
+apt:
+  sources:
+- llvm-toolchain-trusty-6.0
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+# LLVM-6 needs libstdc++4.9
+- g++-4.9
+# From sources above
+- llvm-6.0-dev
+- clang-6.0
+- env:
+- LABEL="cmake gcc LLVM-7"
+- LLVM_VERSION=7
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
+# llvm passes -Werror=date-time which is only supported in gcc-4.9+
+- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-7 main'
+  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+# LLVM-7 needs libstdc++4.9
+- g++-4.9
+# From sources above
+- llvm-7-dev
+- clang-7
 
 before_install:
 - eval "${MATRIX_EVAL}"
 
 script:
-  - $PYTHON ./configure.py --with-llvm-config=$LLVM_CONFIG 
--with-cxx-compiler=$CXX && make -j4
+  - if $(echo $LABEL | grep cmake > /dev/null) ; then
+mkdir built_libs && cd built_libs && cmake .. 
-DLLVM_CONFIG=$LLVM_CONFIG && make -j4 && cd .. ;
+else
+$PYTHON ./configure.py --with-llvm-config=$LLVM_CONFIG 
--with-cxx-compiler=$CXX && make -j4;
+fi
   - ret=0;
 for f in $CHECK_FILES; do
 ./check_external_calls.sh built_libs/$f || ret=1;


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r347667 - Add cmake build system

2018-11-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Nov 27 08:07:19 2018
New Revision: 347667

URL: http://llvm.org/viewvc/llvm-project?rev=347667=rev
Log:
Add cmake build system

Add cmake support for CLC and ll asm language,
the latter includes clang preprocessing stage.
Add ctests to check for external function calls.

v2: fix typos, style

Signed-off-by: Jan Vesely 
Acked-by: Aaron Watry 
Tested-by: Aaron Watry 
Acked-by: Vedran Miletić 

Added:
libclc/trunk/CMakeLists.txt
libclc/trunk/cmake/
libclc/trunk/cmake/CMakeCLCCompiler.cmake.in
libclc/trunk/cmake/CMakeCLCInformation.cmake
libclc/trunk/cmake/CMakeDetermineCLCCompiler.cmake
libclc/trunk/cmake/CMakeDetermineLLAsmCompiler.cmake
libclc/trunk/cmake/CMakeLLAsmCompiler.cmake.in
libclc/trunk/cmake/CMakeLLAsmInformation.cmake
libclc/trunk/cmake/CMakeTestCLCCompiler.cmake
libclc/trunk/cmake/CMakeTestLLAsmCompiler.cmake
libclc/trunk/libclc.pc.in

Added: libclc/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/CMakeLists.txt?rev=347667=auto
==
--- libclc/trunk/CMakeLists.txt (added)
+++ libclc/trunk/CMakeLists.txt Tue Nov 27 08:07:19 2018
@@ -0,0 +1,298 @@
+cmake_minimum_required( VERSION 3.9.2 )
+
+project( libclc VERSION 0.2.0 LANGUAGES CXX )
+
+# List of all targets
+set( LIBCLC_TARGETS_ALL
+  amdgcn--
+  amdgcn--amdhsa
+  r600--
+  nvptx--
+  nvptx64--
+  nvptx--nvidiacl
+  nvptx64--nvidiacl
+)
+
+set( LIBCLC_MIN_LLVM "3.9.0" )
+
+set( LIBCLC_TARGETS_TO_BUILD "all"
+CACHE STRING "Semicolon-separated list of targets to build, or 'all'." )
+
+option( ENABLE_RUNTIME_SUBNORMAL "Enable runtime linking of subnormal support."
+OFF )
+
+if( NOT LLVM_CONFIG )
+   find_program( LLVM_CONFIG llvm-config )
+endif()
+execute_process( COMMAND ${LLVM_CONFIG} "--version"
+OUTPUT_VARIABLE LLVM_VERSION
+OUTPUT_STRIP_TRAILING_WHITESPACE )
+message( "LLVM version: ${LLVM_VERSION}" )
+
+if( ${LLVM_VERSION} VERSION_LESS ${LIBCLC_MIN_LLVM} )
+   message( FATAL_ERROR "libclc needs at least LLVM ${LIBCLC_MIN_LLVM}" )
+endif()
+
+# mesa3d environment is only available since LLVM 4.0
+if( ${LLVM_VERSION} VERSION_GREATER "3.9.0" )
+   set( LIBCLC_TARGETS_ALL ${LIBCLC_TARGETS_ALL} amdgcn-mesa-mesa3d )
+endif()
+
+if( LIBCLC_TARGETS_TO_BUILD STREQUAL "all" )
+   set( LIBCLC_TARGETS_TO_BUILD ${LIBCLC_TARGETS_ALL} )
+endif()
+
+list( SORT LIBCLC_TARGETS_TO_BUILD )
+
+execute_process( COMMAND ${LLVM_CONFIG} "--system-libs"
+   OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
+   OUTPUT_STRIP_TRAILING_WHITESPACE )
+execute_process( COMMAND ${LLVM_CONFIG} "--libs" "core" "bitreader" "bitwriter"
+   OUTPUT_VARIABLE LLVM_LIBS
+   OUTPUT_STRIP_TRAILING_WHITESPACE )
+execute_process( COMMAND ${LLVM_CONFIG} "--libdir"
+   OUTPUT_VARIABLE LLVM_LIBDIR
+   OUTPUT_STRIP_TRAILING_WHITESPACE )
+execute_process( COMMAND ${LLVM_CONFIG} "--ldflags"
+   OUTPUT_VARIABLE LLVM_LD_FLAGS
+   OUTPUT_STRIP_TRAILING_WHITESPACE )
+execute_process( COMMAND ${LLVM_CONFIG} "--cxxflags"
+   OUTPUT_VARIABLE LLVM_CXX_FLAGS
+   OUTPUT_STRIP_TRAILING_WHITESPACE )
+separate_arguments( LLVM_CXX_FLAGS )
+execute_process( COMMAND ${LLVM_CONFIG} "--bindir"
+   OUTPUT_VARIABLE LLVM_BINDIR
+   OUTPUT_STRIP_TRAILING_WHITESPACE )
+
+# These were not properly reported in early LLVM and we don't need them
+set( LLVM_CXX_FLAGS ${LLVM_CXX_FLAGS} -fno-rtti -fno-exceptions )
+
+# Print LLVM variables
+message( "LLVM system libs: ${LLVM_SYSTEM_LIBS}" )
+message( "LLVM libs: ${LLVM_LIBS}" )
+message( "LLVM libdir: ${LLVM_LIBDIR}" )
+message( "LLVM bindir: ${LLVM_BINDIR}" )
+message( "LLVM ld flags: ${LLVM_LD_FLAGS}" )
+message( "LLVM cxx flags: ${LLVM_CXX_FLAGS}" )
+message( "" )
+
+find_program( LLVM_CLANG clang PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
+find_program( LLVM_AS llvm-as PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
+find_program( LLVM_LINK llvm-link PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
+find_program( LLVM_OPT opt PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH )
+
+# Print toolchain
+message( "clang: ${LLVM_CLANG}" )
+message( "llvm-as: ${LLVM_AS}" )
+message( "llvm-link: ${LLVM_LINK}" )
+message( "opt: ${LLVM_OPT}" )
+message( "" )
+if( NOT LLVM_CLANG OR NOT LLVM_OPT OR NOT LLVM_AS OR NOT LLVM_LINK )
+   message( FATAL_ERROR "toolchain incomplete!" )
+endif()
+
+set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
+set( CMAKE_CLC_COMPILER ${LLVM_CLANG} )
+set( CMAKE_CLC_ARCHIVE ${LLVM_LINK} )
+set( CMAKE_LLAsm_PREPROCESSOR ${LLVM_CLANG} )
+set( CMAKE_LLAsm_COMPILER ${LLVM_AS} )
+set( CMAKE_LLAsm_ARCHIVE ${LLVM_LINK} )
+enable_language( CLC LLAsm )
+
+# Construct LLVM version define
+string( REPLACE "." ";" LLVM_VERSION_LIST ${LLVM_VERSION} )
+list( GET LLVM_VERSION_LIST 0 LLVM_MAJOR )
+list( GET LLVM_VERSION_LIST 1 LLVM_MINOR )
+set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_MAJOR}0${LLVM_MINOR}" )
+
+# This needs to be set before any 

[libclc] r347666 - r600: Remove empty OVERRIDES file

2018-11-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Nov 27 08:01:16 2018
New Revision: 347666

URL: http://llvm.org/viewvc/llvm-project?rev=347666=rev
Log:
r600: Remove empty OVERRIDES file

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Removed:
libclc/trunk/r600/lib/OVERRIDES

Removed: libclc/trunk/r600/lib/OVERRIDES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES?rev=347665=auto
==
(empty)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r347663 - configure: provide llvm_as helper variable

2018-11-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Nov 27 08:01:01 2018
New Revision: 347663

URL: http://llvm.org/viewvc/llvm-project?rev=347663=rev
Log:
configure: provide llvm_as helper variable

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Modified:
libclc/trunk/configure.py

Modified: libclc/trunk/configure.py
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=347663=347662=347663=diff
==
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Tue Nov 27 08:01:01 2018
@@ -86,6 +86,7 @@ llvm_cxxflags = llvm_config(['--cxxflags
 llvm_libdir = llvm_config(['--libdir'])
 
 llvm_clang = os.path.join(llvm_bindir, 'clang')
+llvm_as = os.path.join(llvm_bindir, 'llvm-as')
 llvm_link = os.path.join(llvm_bindir, 'llvm-link')
 llvm_opt = os.path.join(llvm_bindir, 'opt')
 
@@ -133,8 +134,7 @@ if not targets:
 
 b = metabuild.from_name(options.g)
 
-b.rule("LLVM_AS", "%s -o $out $in" % os.path.join(llvm_bindir, "llvm-as"),
-   'LLVM-AS $out')
+b.rule("LLVM_AS", "%s -o $out $in" % llvm_as, 'LLVM-AS $out')
 b.rule("LLVM_LINK", command = llvm_link + " -o $out $in",
description = 'LLVM-LINK $out')
 b.rule("OPT", command = llvm_opt + " -O3 -o $out $in",


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r347664 - configure: Add target specific asm rule.

2018-11-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Nov 27 08:01:10 2018
New Revision: 347664

URL: http://llvm.org/viewvc/llvm-project?rev=347664=rev
Log:
configure: Add target specific asm rule.

Run the file through target specific preprocessing stage.
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Modified:
libclc/trunk/configure.py

Modified: libclc/trunk/configure.py
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=347664=347663=347664=diff
==
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Tue Nov 27 08:01:10 2018
@@ -213,6 +213,8 @@ for target in targets:
   clang_bc_flags += ' -mcpu=' + device['gpu']
 clang_bc_rule = "CLANG_CL_BC_" + target + "_" + device['gpu']
 c_compiler_rule(b, clang_bc_rule, "LLVM-CC", llvm_clang, clang_bc_flags)
+as_bc_rule = "LLVM_AS_BC_" + target + "_" + device['gpu']
+b.rule(as_bc_rule, "%s -E -P %s -x cl $in -o - | %s -o $out" % 
(llvm_clang, clang_bc_flags, llvm_as), 'LLVM-AS $out')
 
 objects = []
 sources_seen = set()
@@ -265,7 +267,7 @@ for target in targets:
   src_file = os.path.join(src_path, src)
   ext = os.path.splitext(src)[1]
   if ext == '.ll':
-b.build(obj, 'LLVM_AS', src_file)
+b.build(obj, as_bc_rule, src_file)
   else:
 b.build(obj, clang_bc_rule, src_file)
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r347665 - amdgcn: Consolidate atomic minmax helpers

2018-11-27 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Nov 27 08:01:13 2018
New Revision: 347665

URL: http://llvm.org/viewvc/llvm-project?rev=347665=rev
Log:
amdgcn: Consolidate atomic minmax helpers

Removes most overrides
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Removed:
libclc/trunk/amdgcn/lib/OVERRIDES
libclc/trunk/amdgcn/lib/OVERRIDES_3.9
libclc/trunk/amdgcn/lib/OVERRIDES_4.0
libclc/trunk/amdgcn/lib/OVERRIDES_5.0
libclc/trunk/amdgcn/lib/OVERRIDES_6.0
libclc/trunk/amdgcn/lib/SOURCES_3.9
libclc/trunk/amdgcn/lib/SOURCES_4.0
libclc/trunk/amdgcn/lib/SOURCES_5.0
libclc/trunk/amdgcn/lib/SOURCES_6.0
libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.39.ll
Modified:
libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll

Removed: libclc/trunk/amdgcn/lib/OVERRIDES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES?rev=347664=auto
==
(empty)

Removed: libclc/trunk/amdgcn/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_3.9?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_3.9 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.ll

Removed: libclc/trunk/amdgcn/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_4.0?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_4.0 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.ll

Removed: libclc/trunk/amdgcn/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_5.0?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_5.0 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.ll

Removed: libclc/trunk/amdgcn/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_6.0?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_6.0 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.ll

Removed: libclc/trunk/amdgcn/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_3.9?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/SOURCES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_3.9 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.39.ll

Removed: libclc/trunk/amdgcn/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_4.0?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/SOURCES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_4.0 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.39.ll

Removed: libclc/trunk/amdgcn/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_5.0?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/SOURCES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_5.0 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.39.ll

Removed: libclc/trunk/amdgcn/lib/SOURCES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_6.0?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/SOURCES_6.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_6.0 (removed)
@@ -1 +0,0 @@
-cl_khr_int64_extended_atomics/minmax_helpers.39.ll

Removed: 
libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.39.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.39.ll?rev=347664=auto
==
--- libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.39.ll 
(original)
+++ libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.39.ll 
(removed)
@@ -1,49 +0,0 @@
-target datalayout = 
"e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
-
-define i64 @__clc__sync_fetch_and_min_global_8(i64 addrspace(1)* nocapture 
%ptr, i64 %value) nounwind alwaysinline {
-entry:
-  %0 = atomicrmw volatile min i64 addrspace(1)* %ptr, i64 %value seq_cst

[libclc] r346086 - Remove redundant OVERRRIDES file

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:54:46 2018
New Revision: 346086

URL: http://llvm.org/viewvc/llvm-project?rev=346086=rev
Log:
Remove redundant OVERRRIDES file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/amdgpu/lib/OVERRIDES

Removed: libclc/trunk/amdgpu/lib/OVERRIDES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/OVERRIDES?rev=346085=auto
==
--- libclc/trunk/amdgpu/lib/OVERRIDES (original)
+++ libclc/trunk/amdgpu/lib/OVERRIDES (removed)
@@ -1,2 +0,0 @@
-workitem/get_group_id.cl
-workitem/get_global_size.cl


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r346085 - configure: Provide symlink for amdgcn-mesa3d instead of configure hack

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:54:45 2018
New Revision: 346085

URL: http://llvm.org/viewvc/llvm-project?rev=346085=rev
Log:
configure: Provide symlink for amdgcn-mesa3d instead of configure hack

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Added:
libclc/trunk/amdgcn-mesa3d   (with props)
Modified:
libclc/trunk/configure.py

Added: libclc/trunk/amdgcn-mesa3d
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-mesa3d?rev=346085=auto
==
--- libclc/trunk/amdgcn-mesa3d (added)
+++ libclc/trunk/amdgcn-mesa3d Sat Nov  3 17:54:45 2018
@@ -0,0 +1 @@
+link amdgcn-amdhsa
\ No newline at end of file

Propchange: libclc/trunk/amdgcn-mesa3d
--
svn:special = *

Modified: libclc/trunk/configure.py
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=346085=346084=346085=diff
==
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Sat Nov  3 17:54:45 2018
@@ -187,8 +187,6 @@ for target in targets:
   for arch in archs:
 subdirs.append("%s-%s-%s" % (arch, t_vendor, t_os))
 subdirs.append("%s-%s" % (arch, t_os))
-if t_os == 'mesa3d':
-subdirs.append('amdgcn-amdhsa')
 subdirs.append(arch)
 if arch == 'amdgcn' or arch == 'r600':
 subdirs.append('amdgpu')


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r346084 - travis: Check tahiti-amdgcn-mesa-mesa3d.bc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:54:43 2018
New Revision: 346084

URL: http://llvm.org/viewvc/llvm-project?rev=346084=rev
Log:
travis: Check tahiti-amdgcn-mesa-mesa3d.bc

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=346084=346083=346084=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Sat Nov  3 17:54:43 2018
@@ -28,7 +28,7 @@ matrix:
 - LABEL="make gcc LLVM-4.0"
 - LLVM_VERSION=4.0
 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
   sources:
@@ -43,7 +43,7 @@ matrix:
 - LABEL="make gcc LLVM-5.0"
 - LLVM_VERSION=5.0
 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
   addons:
 apt:
   sources:
@@ -58,7 +58,7 @@ matrix:
 - LABEL="make gcc LLVM-6.0"
 - LLVM_VERSION=6.0
 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
 # llvm passes -Werror=date-time which is only supported in gcc-4.9+
 - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
   addons:
@@ -77,7 +77,7 @@ matrix:
 - LABEL="make gcc LLVM-7"
 - LLVM_VERSION=7
 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
-- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc 
tahiti-amdgcn-mesa-mesa3d.bc nvptx--nvidiacl.bc nvptx64--nvidiacl.bc"
 # llvm passes -Werror=date-time which is only supported in gcc-4.9+
 - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
   addons:


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r346082 - amdgcn: Move __clc_amdgcn_s_waitcnt definition to clc file

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:39:27 2018
New Revision: 346082

URL: http://llvm.org/viewvc/llvm-project?rev=346082=rev
Log:
amdgcn: Move __clc_amdgcn_s_waitcnt definition to clc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/amdgcn/lib/mem_fence/waitcnt.ll
Modified:
libclc/trunk/amdgcn/lib/SOURCES_3.9
libclc/trunk/amdgcn/lib/SOURCES_4.0
libclc/trunk/amdgcn/lib/mem_fence/fence.cl

Modified: libclc/trunk/amdgcn/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_3.9?rev=346082=346081=346082=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_3.9 Sat Nov  3 17:39:27 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
-mem_fence/waitcnt.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_4.0?rev=346082=346081=346082=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_4.0 Sat Nov  3 17:39:27 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
-mem_fence/waitcnt.ll

Modified: libclc/trunk/amdgcn/lib/mem_fence/fence.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/mem_fence/fence.cl?rev=346082=346081=346082=diff
==
--- libclc/trunk/amdgcn/lib/mem_fence/fence.cl (original)
+++ libclc/trunk/amdgcn/lib/mem_fence/fence.cl Sat Nov  3 17:39:27 2018
@@ -14,6 +14,7 @@ void __clc_amdgcn_s_waitcnt(unsigned fla
 #  define __waitcnt(x) __builtin_amdgcn_s_waitcnt(x)
 #else
 #  define __waitcnt(x) __clc_amdgcn_s_waitcnt(x)
+_CLC_DEF void __clc_amdgcn_s_waitcnt(unsigned)  __asm("llvm.amdgcn.s.waitcnt");
 #endif
 
 _CLC_DEF void mem_fence(cl_mem_fence_flags flags)

Removed: libclc/trunk/amdgcn/lib/mem_fence/waitcnt.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/mem_fence/waitcnt.ll?rev=346081=auto
==
--- libclc/trunk/amdgcn/lib/mem_fence/waitcnt.ll (original)
+++ libclc/trunk/amdgcn/lib/mem_fence/waitcnt.ll (removed)
@@ -1,13 +0,0 @@
-declare void @llvm.amdgcn.s.waitcnt(i32) #0
-
-target datalayout = 
"e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
-
-; Export waitcnt intrinsic for clang < 5
-define void @__clc_amdgcn_s_waitcnt(i32 %flags) #1 {
-entry:
-  tail call void @llvm.amdgcn.s.waitcnt(i32 %flags)
-  ret void
-}
-
-attributes #0 = { nounwind }
-attributes #1 = { nounwind alwaysinline }


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r346083 - amdgcn-amdhsa: Convert get_{global, local}_size to clc for all llvm versions

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:39:30 2018
New Revision: 346083

URL: http://llvm.org/viewvc/llvm-project?rev=346083=rev
Log:
amdgcn-amdhsa: Convert get_{global,local}_size to clc for all llvm versions

Signed-off-by: Jan Vesely 
Acked-By: Aaron Watry 

Removed:
libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES
libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_3.9
libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_4.0
libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_5.0
libclc/trunk/amdgcn-amdhsa/lib/SOURCES_3.9
libclc/trunk/amdgcn-amdhsa/lib/SOURCES_4.0
libclc/trunk/amdgcn-amdhsa/lib/SOURCES_5.0
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.39.ll
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.50.ll
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.39.ll
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.50.ll
Modified:
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.cl
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.cl

Removed: libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES (removed)
@@ -1,6 +0,0 @@
-workitem/get_num_groups.ll
-workitem/get_global_size.ll
-workitem/get_local_size.ll
-workitem/get_num_groups.40.ll
-workitem/get_global_size.40.ll
-workitem/get_local_size.40.ll

Removed: libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_3.9?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_3.9 (removed)
@@ -1,3 +0,0 @@
-workitem/get_global_size.cl
-workitem/get_local_size.cl
-workitem/get_num_groups.39.ll

Removed: libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_4.0?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_4.0 (removed)
@@ -1,2 +0,0 @@
-workitem/get_global_size.cl
-workitem/get_local_size.cl

Removed: libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_5.0?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/OVERRIDES_5.0 (removed)
@@ -1,2 +0,0 @@
-workitem/get_global_size.cl
-workitem/get_local_size.cl

Removed: libclc/trunk/amdgcn-amdhsa/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/SOURCES_3.9?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/SOURCES_3.9 (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/SOURCES_3.9 (removed)
@@ -1,2 +0,0 @@
-workitem/get_global_size.39.ll
-workitem/get_local_size.39.ll

Removed: libclc/trunk/amdgcn-amdhsa/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/SOURCES_4.0?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/SOURCES_4.0 (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/SOURCES_4.0 (removed)
@@ -1,2 +0,0 @@
-workitem/get_global_size.50.ll
-workitem/get_local_size.50.ll

Removed: libclc/trunk/amdgcn-amdhsa/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/SOURCES_5.0?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/SOURCES_5.0 (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/SOURCES_5.0 (removed)
@@ -1,2 +0,0 @@
-workitem/get_global_size.50.ll
-workitem/get_local_size.50.ll

Removed: libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.39.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.39.ll?rev=346082=auto
==
--- libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.39.ll (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.39.ll (removed)
@@ -1,36 +0,0 @@
-declare i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
-
-define i32 @get_global_size(i32 %dim) #1 {
-  %dispatch_ptr = call noalias nonnull dereferenceable(64) i8 addrspace(2)* 
@llvm.amdgcn.dispatch.ptr()
-  switch i32 %dim, label %default [
-i32 0, label %x
-i32 1, label %y
-i32 2, label %z
-  ]
-
-x:
-  %ptr_x = getelementptr inbounds i8, i8 addrspace(2)* %dispatch_ptr, i32 12
-  %ptr_x32 = bitcast i8 

[libclc] r346081 - amdgcn: Convert get_num_groups to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:39:25 2018
New Revision: 346081

URL: http://llvm.org/viewvc/llvm-project?rev=346081=rev
Log:
amdgcn: Convert get_num_groups to clc

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Added:
libclc/trunk/amdgcn/lib/workitem/get_num_groups.cl
Removed:
libclc/trunk/amdgcn/lib/workitem/get_num_groups.39.ll
libclc/trunk/amdgcn/lib/workitem/get_num_groups.40.ll
libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll
Modified:
libclc/trunk/amdgcn/lib/OVERRIDES_3.9
libclc/trunk/amdgcn/lib/OVERRIDES_4.0
libclc/trunk/amdgcn/lib/OVERRIDES_5.0
libclc/trunk/amdgcn/lib/OVERRIDES_6.0
libclc/trunk/amdgcn/lib/SOURCES
libclc/trunk/amdgcn/lib/SOURCES_3.9
libclc/trunk/amdgcn/lib/SOURCES_4.0
libclc/trunk/amdgcn/lib/SOURCES_5.0
libclc/trunk/amdgcn/lib/SOURCES_6.0

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_3.9?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_3.9 Sat Nov  3 17:39:25 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_4.0?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_4.0 Sat Nov  3 17:39:25 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_5.0?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_5.0 Sat Nov  3 17:39:25 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_6.0?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_6.0 Sat Nov  3 17:39:25 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Sat Nov  3 17:39:25 2018
@@ -10,5 +10,5 @@ workitem/get_group_id.cl
 workitem/get_global_size.cl
 workitem/get_local_id.cl
 workitem/get_local_size.cl
-workitem/get_num_groups.ll
+workitem/get_num_groups.cl
 workitem/get_work_dim.cl

Modified: libclc/trunk/amdgcn/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_3.9?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_3.9 Sat Nov  3 17:39:25 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 mem_fence/waitcnt.ll
-workitem/get_num_groups.39.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_4.0?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_4.0 Sat Nov  3 17:39:25 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 mem_fence/waitcnt.ll
-workitem/get_num_groups.40.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_5.0?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_5.0 Sat Nov  3 17:39:25 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
-workitem/get_num_groups.40.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_6.0?rev=346081=346080=346081=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_6.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_6.0 Sat Nov  3 17:39:25 2018
@@ -1,2 +1 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll

[libclc] r346080 - amdgcn: Convert get_global_size to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:39:20 2018
New Revision: 346080

URL: http://llvm.org/viewvc/llvm-project?rev=346080=rev
Log:
amdgcn: Convert get_global_size to clc

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Added:
libclc/trunk/amdgcn/lib/workitem/get_global_size.cl
Removed:
libclc/trunk/amdgcn/lib/workitem/get_global_size.39.ll
libclc/trunk/amdgcn/lib/workitem/get_global_size.40.ll
libclc/trunk/amdgcn/lib/workitem/get_global_size.ll
Modified:
libclc/trunk/amdgcn/lib/OVERRIDES_3.9
libclc/trunk/amdgcn/lib/OVERRIDES_4.0
libclc/trunk/amdgcn/lib/OVERRIDES_5.0
libclc/trunk/amdgcn/lib/OVERRIDES_6.0
libclc/trunk/amdgcn/lib/SOURCES
libclc/trunk/amdgcn/lib/SOURCES_3.9
libclc/trunk/amdgcn/lib/SOURCES_4.0
libclc/trunk/amdgcn/lib/SOURCES_5.0
libclc/trunk/amdgcn/lib/SOURCES_6.0

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_3.9?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_3.9 Sat Nov  3 17:39:20 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_4.0?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_4.0 Sat Nov  3 17:39:20 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_5.0?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_5.0 Sat Nov  3 17:39:20 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_6.0?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_6.0 Sat Nov  3 17:39:20 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Sat Nov  3 17:39:20 2018
@@ -7,7 +7,7 @@ mem_fence/fence.cl
 synchronization/barrier.cl
 workitem/get_global_offset.cl
 workitem/get_group_id.cl
-workitem/get_global_size.ll
+workitem/get_global_size.cl
 workitem/get_local_id.cl
 workitem/get_local_size.cl
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_3.9?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_3.9 Sat Nov  3 17:39:20 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 mem_fence/waitcnt.ll
-workitem/get_global_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_4.0?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_4.0 Sat Nov  3 17:39:20 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 mem_fence/waitcnt.ll
-workitem/get_global_size.40.ll
 workitem/get_num_groups.40.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_5.0?rev=346080=346079=346080=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_5.0 Sat Nov  3 17:39:20 2018
@@ -1,3 +1,2 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
-workitem/get_global_size.40.ll
 workitem/get_num_groups.40.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_6.0
URL: 

[libclc] r346079 - amdgcn: Convert get_local_size to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:39:16 2018
New Revision: 346079

URL: http://llvm.org/viewvc/llvm-project?rev=346079=rev
Log:
amdgcn: Convert get_local_size to clc

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Added:
libclc/trunk/amdgcn/lib/workitem/get_local_size.cl
Removed:
libclc/trunk/amdgcn/lib/workitem/get_local_size.39.ll
libclc/trunk/amdgcn/lib/workitem/get_local_size.40.ll
libclc/trunk/amdgcn/lib/workitem/get_local_size.ll
Modified:
libclc/trunk/amdgcn/lib/OVERRIDES_3.9
libclc/trunk/amdgcn/lib/OVERRIDES_4.0
libclc/trunk/amdgcn/lib/OVERRIDES_5.0
libclc/trunk/amdgcn/lib/OVERRIDES_6.0
libclc/trunk/amdgcn/lib/SOURCES
libclc/trunk/amdgcn/lib/SOURCES_3.9
libclc/trunk/amdgcn/lib/SOURCES_4.0
libclc/trunk/amdgcn/lib/SOURCES_5.0
libclc/trunk/amdgcn/lib/SOURCES_6.0

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_3.9?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_3.9 Sat Nov  3 17:39:16 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_4.0?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_4.0 Sat Nov  3 17:39:16 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_5.0?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_5.0 Sat Nov  3 17:39:16 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/OVERRIDES_6.0?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/amdgcn/lib/OVERRIDES_6.0 Sat Nov  3 17:39:16 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Sat Nov  3 17:39:16 2018
@@ -9,6 +9,6 @@ workitem/get_global_offset.cl
 workitem/get_group_id.cl
 workitem/get_global_size.ll
 workitem/get_local_id.cl
-workitem/get_local_size.ll
+workitem/get_local_size.cl
 workitem/get_num_groups.ll
 workitem/get_work_dim.cl

Modified: libclc/trunk/amdgcn/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_3.9?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_3.9 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_3.9 Sat Nov  3 17:39:16 2018
@@ -1,5 +1,4 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 mem_fence/waitcnt.ll
 workitem/get_global_size.39.ll
-workitem/get_local_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_4.0?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_4.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_4.0 Sat Nov  3 17:39:16 2018
@@ -1,5 +1,4 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 mem_fence/waitcnt.ll
 workitem/get_global_size.40.ll
-workitem/get_local_size.40.ll
 workitem/get_num_groups.40.ll

Modified: libclc/trunk/amdgcn/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES_5.0?rev=346079=346078=346079=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES_5.0 (original)
+++ libclc/trunk/amdgcn/lib/SOURCES_5.0 Sat Nov  3 17:39:16 2018
@@ -1,4 +1,3 @@
 cl_khr_int64_extended_atomics/minmax_helpers.39.ll
 workitem/get_global_size.40.ll
-workitem/get_local_size.40.ll
 

[libclc] r346075 - r600: Convert get_local_size to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:35:03 2018
New Revision: 346075

URL: http://llvm.org/viewvc/llvm-project?rev=346075=rev
Log:
r600: Convert get_local_size to clc

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Added:
libclc/trunk/r600/lib/workitem/get_local_size.cl
Removed:
libclc/trunk/r600/lib/workitem/get_local_size.39.ll
libclc/trunk/r600/lib/workitem/get_local_size.ll
Modified:
libclc/trunk/r600/lib/OVERRIDES_3.9
libclc/trunk/r600/lib/OVERRIDES_4.0
libclc/trunk/r600/lib/OVERRIDES_5.0
libclc/trunk/r600/lib/OVERRIDES_6.0
libclc/trunk/r600/lib/SOURCES
libclc/trunk/r600/lib/SOURCES_3.9
libclc/trunk/r600/lib/SOURCES_4.0
libclc/trunk/r600/lib/SOURCES_5.0
libclc/trunk/r600/lib/SOURCES_6.0

Modified: libclc/trunk/r600/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_3.9?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_3.9 Sat Nov  3 17:35:03 2018
@@ -1,4 +1,3 @@
 synchronization/barrier_impl.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_4.0?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_4.0 Sat Nov  3 17:35:03 2018
@@ -1,4 +1,3 @@
 synchronization/barrier_impl.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_5.0?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_5.0 Sat Nov  3 17:35:03 2018
@@ -1,4 +1,3 @@
 synchronization/barrier_impl.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_6.0?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_6.0 Sat Nov  3 17:35:03 2018
@@ -1,4 +1,3 @@
 synchronization/barrier_impl.ll
 workitem/get_global_size.ll
-workitem/get_local_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Sat Nov  3 17:35:03 2018
@@ -5,6 +5,6 @@ workitem/get_global_offset.cl
 workitem/get_group_id.cl
 workitem/get_global_size.ll
 workitem/get_local_id.cl
-workitem/get_local_size.ll
+workitem/get_local_size.cl
 workitem/get_num_groups.ll
 workitem/get_work_dim.cl

Modified: libclc/trunk/r600/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_3.9?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/SOURCES_3.9 (original)
+++ libclc/trunk/r600/lib/SOURCES_3.9 Sat Nov  3 17:35:03 2018
@@ -15,5 +15,4 @@ image/write_imageui.cl
 image/write_image_impl.ll
 synchronization/barrier_impl.39.ll
 workitem/get_global_size.39.ll
-workitem/get_local_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_4.0?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/SOURCES_4.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_4.0 Sat Nov  3 17:35:03 2018
@@ -1,4 +1,3 @@
 synchronization/barrier_impl.39.ll
 workitem/get_global_size.39.ll
-workitem/get_local_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_5.0?rev=346075=346074=346075=diff
==
--- libclc/trunk/r600/lib/SOURCES_5.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_5.0 Sat Nov  3 17:35:03 2018
@@ -1,4 +1,3 @@
 synchronization/barrier_impl.39.ll
 workitem/get_global_size.39.ll
-workitem/get_local_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_6.0?rev=346075=346074=346075=diff
==

[libclc] r346078 - r600: Convert barrier to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:35:15 2018
New Revision: 346078

URL: http://llvm.org/viewvc/llvm-project?rev=346078=rev
Log:
r600: Convert barrier to clc

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Added:
libclc/trunk/r600/lib/synchronization/barrier.cl
Removed:
libclc/trunk/r600/lib/OVERRIDES_3.9
libclc/trunk/r600/lib/OVERRIDES_4.0
libclc/trunk/r600/lib/OVERRIDES_5.0
libclc/trunk/r600/lib/OVERRIDES_6.0
libclc/trunk/r600/lib/SOURCES_4.0
libclc/trunk/r600/lib/SOURCES_5.0
libclc/trunk/r600/lib/SOURCES_6.0
libclc/trunk/r600/lib/synchronization/barrier_impl.39.ll
libclc/trunk/r600/lib/synchronization/barrier_impl.ll
Modified:
libclc/trunk/r600/lib/SOURCES
libclc/trunk/r600/lib/SOURCES_3.9

Removed: libclc/trunk/r600/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_3.9?rev=346077=auto
==
--- libclc/trunk/r600/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_3.9 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.ll

Removed: libclc/trunk/r600/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_4.0?rev=346077=auto
==
--- libclc/trunk/r600/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_4.0 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.ll

Removed: libclc/trunk/r600/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_5.0?rev=346077=auto
==
--- libclc/trunk/r600/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_5.0 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.ll

Removed: libclc/trunk/r600/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_6.0?rev=346077=auto
==
--- libclc/trunk/r600/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_6.0 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.ll

Modified: libclc/trunk/r600/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=346078=346077=346078=diff
==
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Sat Nov  3 17:35:15 2018
@@ -1,6 +1,6 @@
 math/fmax.cl
 math/fmin.cl
-synchronization/barrier_impl.ll
+synchronization/barrier.cl
 workitem/get_global_offset.cl
 workitem/get_group_id.cl
 workitem/get_global_size.cl

Modified: libclc/trunk/r600/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_3.9?rev=346078=346077=346078=diff
==
--- libclc/trunk/r600/lib/SOURCES_3.9 (original)
+++ libclc/trunk/r600/lib/SOURCES_3.9 Sat Nov  3 17:35:15 2018
@@ -13,4 +13,3 @@ image/write_imagef.cl
 image/write_imagei.cl
 image/write_imageui.cl
 image/write_image_impl.ll
-synchronization/barrier_impl.39.ll

Removed: libclc/trunk/r600/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_4.0?rev=346077=auto
==
--- libclc/trunk/r600/lib/SOURCES_4.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_4.0 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.39.ll

Removed: libclc/trunk/r600/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_5.0?rev=346077=auto
==
--- libclc/trunk/r600/lib/SOURCES_5.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_5.0 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.39.ll

Removed: libclc/trunk/r600/lib/SOURCES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_6.0?rev=346077=auto
==
--- libclc/trunk/r600/lib/SOURCES_6.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_6.0 (removed)
@@ -1 +0,0 @@
-synchronization/barrier_impl.39.ll

Added: libclc/trunk/r600/lib/synchronization/barrier.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/synchronization/barrier.cl?rev=346078=auto
==
--- libclc/trunk/r600/lib/synchronization/barrier.cl (added)
+++ libclc/trunk/r600/lib/synchronization/barrier.cl Sat Nov  3 17:35:15 2018
@@ -0,0 +1,9 @@
+#include 
+
+_CLC_DEF void __clc_r600_barrier(void) __asm("llvm.r600.group.barrier");
+
+_CLC_DEF void barrier(uint flags)
+{
+  // We should call mem_fence here, but that is not implemented for r600 yet
+  __clc_r600_barrier();
+}

Removed: 

[libclc] r346077 - r600: Convert get_num_groups to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:35:12 2018
New Revision: 346077

URL: http://llvm.org/viewvc/llvm-project?rev=346077=rev
Log:
r600: Convert get_num_groups to clc

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Added:
libclc/trunk/r600/lib/workitem/get_num_groups.cl
Removed:
libclc/trunk/r600/lib/workitem/get_num_groups.39.ll
libclc/trunk/r600/lib/workitem/get_num_groups.ll
Modified:
libclc/trunk/r600/lib/OVERRIDES_3.9
libclc/trunk/r600/lib/OVERRIDES_4.0
libclc/trunk/r600/lib/OVERRIDES_5.0
libclc/trunk/r600/lib/OVERRIDES_6.0
libclc/trunk/r600/lib/SOURCES
libclc/trunk/r600/lib/SOURCES_3.9
libclc/trunk/r600/lib/SOURCES_4.0
libclc/trunk/r600/lib/SOURCES_5.0
libclc/trunk/r600/lib/SOURCES_6.0

Modified: libclc/trunk/r600/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_3.9?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_3.9 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_4.0?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_4.0 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_5.0?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_5.0 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_6.0?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_6.0 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.ll
-workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Sat Nov  3 17:35:12 2018
@@ -6,5 +6,5 @@ workitem/get_group_id.cl
 workitem/get_global_size.cl
 workitem/get_local_id.cl
 workitem/get_local_size.cl
-workitem/get_num_groups.ll
+workitem/get_num_groups.cl
 workitem/get_work_dim.cl

Modified: libclc/trunk/r600/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_3.9?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/SOURCES_3.9 (original)
+++ libclc/trunk/r600/lib/SOURCES_3.9 Sat Nov  3 17:35:12 2018
@@ -14,4 +14,3 @@ image/write_imagei.cl
 image/write_imageui.cl
 image/write_image_impl.ll
 synchronization/barrier_impl.39.ll
-workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_4.0?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/SOURCES_4.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_4.0 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.39.ll
-workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_5.0?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/SOURCES_5.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_5.0 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.39.ll
-workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_6.0?rev=346077=346076=346077=diff
==
--- libclc/trunk/r600/lib/SOURCES_6.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_6.0 Sat Nov  3 17:35:12 2018
@@ -1,2 +1 @@
 synchronization/barrier_impl.39.ll
-workitem/get_num_groups.39.ll

Removed: libclc/trunk/r600/lib/workitem/get_num_groups.39.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_num_groups.39.ll?rev=346076=auto

[libclc] r346076 - r600: Convert get_global_size to clc

2018-11-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Nov  3 17:35:08 2018
New Revision: 346076

URL: http://llvm.org/viewvc/llvm-project?rev=346076=rev
Log:
r600: Convert get_global_size to clc

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Added:
libclc/trunk/r600/lib/workitem/get_global_size.cl
Removed:
libclc/trunk/r600/lib/workitem/get_global_size.39.ll
libclc/trunk/r600/lib/workitem/get_global_size.ll
Modified:
libclc/trunk/r600/lib/OVERRIDES_3.9
libclc/trunk/r600/lib/OVERRIDES_4.0
libclc/trunk/r600/lib/OVERRIDES_5.0
libclc/trunk/r600/lib/OVERRIDES_6.0
libclc/trunk/r600/lib/SOURCES
libclc/trunk/r600/lib/SOURCES_3.9
libclc/trunk/r600/lib/SOURCES_4.0
libclc/trunk/r600/lib/SOURCES_5.0
libclc/trunk/r600/lib/SOURCES_6.0

Modified: libclc/trunk/r600/lib/OVERRIDES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_3.9?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_3.9 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_3.9 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 synchronization/barrier_impl.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_4.0?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_4.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_4.0 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 synchronization/barrier_impl.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_5.0?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_5.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_5.0 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 synchronization/barrier_impl.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/OVERRIDES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/OVERRIDES_6.0?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/OVERRIDES_6.0 (original)
+++ libclc/trunk/r600/lib/OVERRIDES_6.0 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 synchronization/barrier_impl.ll
-workitem/get_global_size.ll
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Sat Nov  3 17:35:08 2018
@@ -3,7 +3,7 @@ math/fmin.cl
 synchronization/barrier_impl.ll
 workitem/get_global_offset.cl
 workitem/get_group_id.cl
-workitem/get_global_size.ll
+workitem/get_global_size.cl
 workitem/get_local_id.cl
 workitem/get_local_size.cl
 workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/SOURCES_3.9
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_3.9?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/SOURCES_3.9 (original)
+++ libclc/trunk/r600/lib/SOURCES_3.9 Sat Nov  3 17:35:08 2018
@@ -14,5 +14,4 @@ image/write_imagei.cl
 image/write_imageui.cl
 image/write_image_impl.ll
 synchronization/barrier_impl.39.ll
-workitem/get_global_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_4.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_4.0?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/SOURCES_4.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_4.0 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 synchronization/barrier_impl.39.ll
-workitem/get_global_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_5.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_5.0?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/SOURCES_5.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_5.0 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 synchronization/barrier_impl.39.ll
-workitem/get_global_size.39.ll
 workitem/get_num_groups.39.ll

Modified: libclc/trunk/r600/lib/SOURCES_6.0
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES_6.0?rev=346076=346075=346076=diff
==
--- libclc/trunk/r600/lib/SOURCES_6.0 (original)
+++ libclc/trunk/r600/lib/SOURCES_6.0 Sat Nov  3 17:35:08 2018
@@ -1,3 +1,2 @@
 

Re: r345866 - Reapply Logging: make os_log buffer size an integer constant expression.

2018-11-01 Thread Jan Vesely via cfe-commits
On Thu, 2018-11-01 at 18:40 +, Tim Northover via cfe-commits wrote:
> On 1 Nov 2018, at 18:36, Jan Vesely  wrote:
> > this patch seems to cause a build failure:
> 
> Ugh. Reverted as r345871. 
> 
> Do you know what linker and other options you’re using? The only
> failure I’ve been able to reproduce locally is when I introduced a
> circular dependency.

I'm using standard fedora 29 setup (with distcc but that is not
involved in linking). I use BUILD_SHARED_LIBS=ON which I think might
trigger the issue.

thanks,
Jan
> 
> Cheers.
> 
> Tim.
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



signature.asc
Description: This is a digitally signed message part
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r345866 - Reapply Logging: make os_log buffer size an integer constant expression.

2018-11-01 Thread Jan Vesely via cfe-commits
Hi,

this patch seems to cause a build failure:

/usr/bin/ld: CMakeFiles/clangAST.dir/OSLog.cpp.o: in function `(anonymous
namespace)::OSLogFormatStringHandler::~OSLogFormatStringHandler()':
/home/jvesely/llvm/tools/clang/lib/AST/OSLog.cpp:18: undefined reference to
`clang::analyze_format_string::FormatStringHandler::~FormatStringHandler()'
/usr/bin/ld: CMakeFiles/clangAST.dir/OSLog.cpp.o: in function `(anonymous
namespace)::OSLogFormatStringHandler::~OSLogFormatStringHandler()':
/home/jvesely/llvm/tools/clang/lib/AST/OSLog.cpp:18: undefined reference to
`clang::analyze_format_string::FormatStringHandler::~FormatStringHandler()'
/usr/bin/ld: CMakeFiles/clangAST.dir/OSLog.cpp.o: in function
`clang::analyze_os_log::computeOSLogBufferLayout(clang::ASTContext&,
clang::CallExpr const*, clang::analyze_os_log::OSLogBufferLayout&)':
/home/jvesely/llvm/tools/clang/lib/AST/OSLog.cpp:198: undefined reference
to
`clang::analyze_format_string::ParsePrintfString(clang::analyze_format_string::FormatStringHandler&,
char const*, char const*, clang::LangOptions const&, clang::TargetInfo
const&, bool)'
/usr/bin/ld: /home/jvesely/llvm/tools/clang/lib/AST/OSLog.cpp:18: undefined
reference to
`clang::analyze_format_string::FormatStringHandler::~FormatStringHandler()'
collect2: error: ld returned 1 exit status

thanks,
Jan

On Thu, Nov 1, 2018 at 2:06 PM Tim Northover via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: tnorthover
> Date: Thu Nov  1 11:04:49 2018
> New Revision: 345866
>
> URL: http://llvm.org/viewvc/llvm-project?rev=345866=rev
> Log:
> Reapply Logging: make os_log buffer size an integer constant expression.
>
> The size of an os_log buffer is known at any stage of compilation, so
> making it
> a constant expression means that the common idiom of declaring a buffer
> for it
> won't result in a VLA. That allows the compiler to skip saving and
> restoring
> the stack pointer around such buffers.
>
> This also moves the OSLog helpers from libclangAnalysis to libclangAST
> to avoid a circular dependency.
>
> Added:
> cfe/trunk/include/clang/AST/OSLog.h
> cfe/trunk/lib/AST/OSLog.cpp
> Removed:
> cfe/trunk/include/clang/Analysis/Analyses/OSLog.h
> cfe/trunk/lib/Analysis/OSLog.cpp
> Modified:
> cfe/trunk/lib/AST/CMakeLists.txt
> cfe/trunk/lib/AST/ExprConstant.cpp
> cfe/trunk/lib/Analysis/CMakeLists.txt
> cfe/trunk/lib/Analysis/PrintfFormatString.cpp
> cfe/trunk/lib/CodeGen/CGBuiltin.cpp
> cfe/trunk/test/CodeGen/builtins.c
>
> Added: cfe/trunk/include/clang/AST/OSLog.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OSLog.h?rev=345866=auto
>
> ==
> --- cfe/trunk/include/clang/AST/OSLog.h (added)
> +++ cfe/trunk/include/clang/AST/OSLog.h Thu Nov  1 11:04:49 2018
> @@ -0,0 +1,155 @@
> +//= OSLog.h - Analysis of calls to os_log builtins --*- C++
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
>
> +//===--===//
> +//
> +// This file defines APIs for determining the layout of the data buffer
> for
> +// os_log() and os_trace().
> +//
>
> +//===--===//
> +
> +#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H
> +#define LLVM_CLANG_ANALYSIS_ANALYSES_OSLOG_H
> +
> +#include "clang/AST/ASTContext.h"
> +#include "clang/AST/Expr.h"
> +
> +namespace clang {
> +namespace analyze_os_log {
> +
> +/// An OSLogBufferItem represents a single item in the data written by a
> call
> +/// to os_log() or os_trace().
> +class OSLogBufferItem {
> +public:
> +  enum Kind {
> +// The item is a scalar (int, float, raw pointer, etc.). No further
> copying
> +// is required. This is the only kind allowed by os_trace().
> +ScalarKind = 0,
> +
> +// The item is a count, which describes the length of the following
> item to
> +// be copied. A count may only be followed by an item of kind
> StringKind,
> +// WideStringKind, or PointerKind.
> +CountKind,
> +
> +// The item is a pointer to a C string. If preceded by a count 'n',
> +// os_log() will copy at most 'n' bytes from the pointer.
> +StringKind,
> +
> +// The item is a pointer to a block of raw data. This item must be
> preceded
> +// by a count 'n'. os_log() will copy exactly 'n' bytes from the
> pointer.
> +PointerKind,
> +
> +// The item is a pointer to an Objective-C object. os_log() may
> retain the
> +// object for later processing.
> +ObjCObjKind,
> +
> +// The item is a pointer to wide-char string.
> +WideStringKind,
> +
> +// The item is corresponding to the '%m' format specifier, no value is
> +// populated in the buffer and the runtime is loading the errno 

[libclc] r342341 - configure: Rework support for gfx9+ devices that were added post LLVM 3.9

2018-09-15 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Sep 15 15:02:01 2018
New Revision: 342341

URL: http://llvm.org/viewvc/llvm-project?rev=342341=rev
Log:
configure: Rework support for gfx9+ devices that were added post LLVM 3.9

v2: Fix reference to Vega12/20 enabling commit

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Modified:
libclc/trunk/configure.py

Modified: libclc/trunk/configure.py
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=342341=342340=342341=diff
==
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Sat Sep 15 15:02:01 2018
@@ -100,15 +100,25 @@ available_targets = {
 {'gpu' : 'barts',   'aliases' : ['turks', 'caicos'] },
 {'gpu' : 'cayman',  'aliases' : ['aruba']} ]},
   'amdgcn--': { 'devices' :
-[{'gpu' : 'tahiti', 'aliases' : ['pitcairn', 'verde', 'oland', 
'hainan', 'bonaire', 'kabini', 'kaveri', 'hawaii', 'mullins', 'tonga', 
'iceland', 'carrizo', 'fiji', 'stoney', 'polaris10', 'polaris11', 'gfx900']} ]},
+[{'gpu' : 'tahiti', 'aliases' : ['pitcairn', 'verde', 'oland', 
'hainan', 'bonaire', 'kabini', 'kaveri', 'hawaii', 'mullins', 'tonga', 
'iceland', 'carrizo', 'fiji', 'stoney', 'polaris10', 'polaris11']} ]},
   'amdgcn--amdhsa': { 'devices' :
-  [{'gpu' : '', 'aliases' : ['bonaire', 'kabini', 
'kaveri', 'hawaii', 'mullins', 'tonga', 'iceland', 'carrizo', 'fiji', 'stoney', 
'polaris10', 'polaris11', 'gfx900']} ]},
+  [{'gpu' : '', 'aliases' : ['bonaire', 'kabini', 
'kaveri', 'hawaii', 'mullins', 'tonga', 'iceland', 'carrizo', 'fiji', 'stoney', 
'polaris10', 'polaris11']} ]},
   'nvptx--'   : { 'devices' : [{'gpu' : '', 'aliases' : []} ]},
   'nvptx64--' : { 'devices' : [{'gpu' : '', 'aliases' : []} ]},
   'nvptx--nvidiacl'   : { 'devices' : [{'gpu' : '', 'aliases' : []} ]},
   'nvptx64--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []} ]},
 }
 
+# Support for gfx9 was added in LLVM 5 (r295554)
+if llvm_int_version >= 500:
+available_targets['amdgcn--']['devices'][0]['aliases'] += ['gfx900', 
'gfx902']
+available_targets['amdgcn--amdhsa']['devices'][0]['aliases'] += ['gfx900', 
'gfx902']
+
+# Support for Vega12 and Vega20 was added in LLVM 7 (r331215)
+if llvm_int_version >= 700:
+available_targets['amdgcn--']['devices'][0]['aliases'] += ['gfx904', 
'gfx906']
+available_targets['amdgcn--amdhsa']['devices'][0]['aliases'] += ['gfx904', 
'gfx906']
+
 
 default_targets = ['nvptx--nvidiacl', 'nvptx64--nvidiacl', 'r600--', 
'amdgcn--', 'amdgcn--amdhsa']
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r342337 - .travis: Use source whitelist alias for llvm-6 repository

2018-09-15 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Sep 15 13:00:12 2018
New Revision: 342337

URL: http://llvm.org/viewvc/llvm-project?rev=342337=rev
Log:
.travis: Use source whitelist alias for llvm-6 repository

Fixes issue with unauthenticated packages.
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=342337=342336=342337=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Sat Sep 15 13:00:12 2018
@@ -64,7 +64,7 @@ matrix:
   addons:
 apt:
   sources:
-- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-6.0 main'
+- llvm-toolchain-trusty-6.0
 - ubuntu-toolchain-r-test
   packages:
 - libedit-dev


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r342338 - .travis: Add llvm-7 build

2018-09-15 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sat Sep 15 13:00:37 2018
New Revision: 342338

URL: http://llvm.org/viewvc/llvm-project?rev=342338=rev
Log:
.travis: Add llvm-7 build

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=342338=342337=342338=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Sat Sep 15 13:00:37 2018
@@ -73,6 +73,26 @@ matrix:
 # From sources above
 - llvm-6.0-dev
 - clang-6.0
+- env:
+- LABEL="make gcc LLVM-7"
+- LLVM_VERSION=7
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+# llvm passes -Werror=date-time which is only supported in gcc-4.9+
+- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-7 main'
+  key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+# LLVM-7 needs libstdc++4.9
+- g++-4.9
+# From sources above
+- llvm-7-dev
+- clang-7
 
 before_install:
 - eval "${MATRIX_EVAL}"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r338898 - amdgcn: Use __constant AS for amdgcn builtins.

2018-08-03 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Fri Aug  3 08:14:08 2018
New Revision: 338898

URL: http://llvm.org/viewvc/llvm-project?rev=338898=rev
Log:
amdgcn: Use __constant AS for amdgcn builtins.

Fixes build after clang r338707.
Reviewer: matthew.arsena...@amd.com
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.cl
libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.cl
libclc/trunk/amdgcn/lib/workitem/get_global_offset.cl
libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl

Modified: libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.cl?rev=338898=338897=338898=diff
==
--- libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.cl (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/workitem/get_global_size.cl Fri Aug  3 
08:14:08 2018
@@ -1,6 +1,8 @@
 #include 
 
-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))

Modified: libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.cl?rev=338898=338897=338898=diff
==
--- libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.cl (original)
+++ libclc/trunk/amdgcn-amdhsa/lib/workitem/get_local_size.cl Fri Aug  3 
08:14:08 2018
@@ -1,6 +1,8 @@
 #include 
 
-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))

Modified: libclc/trunk/amdgcn/lib/workitem/get_global_offset.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_global_offset.cl?rev=338898=338897=338898=diff
==
--- libclc/trunk/amdgcn/lib/workitem/get_global_offset.cl (original)
+++ libclc/trunk/amdgcn/lib/workitem/get_global_offset.cl Fri Aug  3 08:14:08 
2018
@@ -1,6 +1,8 @@
 #include 
 
-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))

Modified: libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl?rev=338898=338897=338898=diff
==
--- libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl (original)
+++ libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl Fri Aug  3 08:14:08 2018
@@ -1,6 +1,8 @@
 #include 
 
-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r335280 - atom: Use volatile pointers for cl_khr_{global, local}_int32_{base, extended}_atomics

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:39 2018
New Revision: 335280

URL: http://llvm.org/viewvc/llvm-project?rev=335280=rev
Log:
atom: Use volatile pointers for 
cl_khr_{global,local}_int32_{base,extended}_atomics

int64 versions were switched to volatile pointers in cl1.1
cl1.1 also renamed atom_ functions to atomic_ that use volatile pointers.
CTS and applications use volatile pointers.

Passes CTS on carrizo
no return piglit tests still pass on turks.

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/generic/include/clc/atom_decl_int32.inc

libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h

libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h
libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h
libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h
libclc/trunk/generic/lib/atom_int32_binary.inc
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl

Modified: libclc/trunk/generic/include/clc/atom_decl_int32.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atom_decl_int32.inc?rev=335280=335279=335280=diff
==
--- libclc/trunk/generic/include/clc/atom_decl_int32.inc (original)
+++ libclc/trunk/generic/include/clc/atom_decl_int32.inc Thu Jun 21 12:27:39 
2018
@@ -1,5 +1,5 @@
 #define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
-   _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (ADDRSPACE TYPE *, TYPE);
+   _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, 
TYPE);
 
 __CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, int)
 __CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, uint)

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h?rev=335280=335279=335280=diff
==
--- 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h
 (original)
+++ 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h
 Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(global int *p, int cmp, int val);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(global unsigned int *p, 
unsigned int cmp, unsigned int val);
+_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile global int *p, int cmp, int 
val);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(volatile global unsigned int 
*p, unsigned int cmp, unsigned int val);

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h?rev=335280=335279=335280=diff
==
--- 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h 
(original)
+++ 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h 
Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_dec(global int *p);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(global unsigned int *p);
+_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile global int *p);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile global unsigned int *p);

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h?rev=335280=335279=335280=diff
==
--- 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h 
(original)
+++ 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h 
Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_inc(global int *p);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(global unsigned int *p);
+_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile global int *p);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile global unsigned int *p);

Modified: 
libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h
URL: 

[libclc] r335279 - atom: Consolidate cl_khr_{local, global}_int32_{base, extended}_atomics implementation

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:33 2018
New Revision: 335279

URL: http://llvm.org/viewvc/llvm-project?rev=335279=rev
Log:
atom: Consolidate cl_khr_{local,global}_int32_{base,extended}_atomics 
implementation

These are just atomic_* wrappers.
Switch inc, dec to use atomic_* wrappers as well.

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/atom_int32_binary.inc
Modified:
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_sub.cl
libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_xchg.cl
libclc/trunk/generic/lib/cl_khr_global_int32_extended_atomics/atom_and.cl
libclc/trunk/generic/lib/cl_khr_global_int32_extended_atomics/atom_max.cl
libclc/trunk/generic/lib/cl_khr_global_int32_extended_atomics/atom_min.cl
libclc/trunk/generic/lib/cl_khr_global_int32_extended_atomics/atom_or.cl
libclc/trunk/generic/lib/cl_khr_global_int32_extended_atomics/atom_xor.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl
libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_xchg.cl
libclc/trunk/generic/lib/cl_khr_local_int32_extended_atomics/atom_and.cl
libclc/trunk/generic/lib/cl_khr_local_int32_extended_atomics/atom_max.cl
libclc/trunk/generic/lib/cl_khr_local_int32_extended_atomics/atom_min.cl
libclc/trunk/generic/lib/cl_khr_local_int32_extended_atomics/atom_or.cl
libclc/trunk/generic/lib/cl_khr_local_int32_extended_atomics/atom_xor.cl

Added: libclc/trunk/generic/lib/atom_int32_binary.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/atom_int32_binary.inc?rev=335279=auto
==
--- libclc/trunk/generic/lib/atom_int32_binary.inc (added)
+++ libclc/trunk/generic/lib/atom_int32_binary.inc Thu Jun 21 12:27:33 2018
@@ -0,0 +1,14 @@
+#include 
+#include "utils.h"
+
+#define __CLC_ATOM_IMPL(AS, TYPE) \
+_CLC_OVERLOAD _CLC_DEF TYPE __CLC_XCONCAT(atom_, __CLC_ATOMIC_OP) (AS TYPE *p, 
TYPE val) { \
+  return __CLC_XCONCAT(atomic_, __CLC_ATOMIC_OP) (p, val); \
+}
+
+__CLC_ATOM_IMPL(__CLC_ATOMIC_ADDRESS_SPACE, int)
+__CLC_ATOM_IMPL(__CLC_ATOMIC_ADDRESS_SPACE, uint)
+
+#undef __CLC_ATOM_IMPL
+#undef __CLC_ATOMIC_OP
+#undef __CLC_ATOMIC_ADDRESS_SPACE

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl?rev=335279=335278=335279=diff
==
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl 
(original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl Thu 
Jun 21 12:27:33 2018
@@ -1,9 +1,3 @@
-#include 
-
-#define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_add(global TYPE *p, TYPE val) { \
-  return atomic_add(p, val); \
-}
-
-IMPL(int)
-IMPL(unsigned int)
+#define __CLC_ATOMIC_OP add
+#define __CLC_ATOMIC_ADDRESS_SPACE global
+#include "../atom_int32_binary.inc"

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl?rev=335279=335278=335279=diff
==
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl 
(original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl Thu 
Jun 21 12:27:33 2018
@@ -2,7 +2,7 @@
 
 #define IMPL(TYPE) \
 _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(global TYPE *p) { \
-  return atom_sub(p, (TYPE)1); \
+  return atomic_dec(p); \
 }
 
 IMPL(int)

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl?rev=335279=335278=335279=diff
==
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl 
(original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl Thu 
Jun 21 12:27:33 2018
@@ -2,7 +2,7 @@
 
 #define IMPL(TYPE) \
 _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(global TYPE *p) { \
-  return atom_add(p, (TYPE)1); \
+  return atomic_inc(p); \
 }
 
 IMPL(int)

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_sub.cl
URL: 

[libclc] r335274 - atomic: Move define cleanup to shared include

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:07 2018
New Revision: 335274

URL: http://llvm.org/viewvc/llvm-project?rev=335274=rev
Log:
atomic: Move define cleanup to shared include

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/generic/include/clc/atomic/atomic_add.h
libclc/trunk/generic/include/clc/atomic/atomic_and.h
libclc/trunk/generic/include/clc/atomic/atomic_decl.inc
libclc/trunk/generic/include/clc/atomic/atomic_max.h
libclc/trunk/generic/include/clc/atomic/atomic_min.h
libclc/trunk/generic/include/clc/atomic/atomic_or.h
libclc/trunk/generic/include/clc/atomic/atomic_sub.h
libclc/trunk/generic/include/clc/atomic/atomic_xchg.h
libclc/trunk/generic/include/clc/atomic/atomic_xor.h

Modified: libclc/trunk/generic/include/clc/atomic/atomic_add.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_add.h?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_add.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_add.h Thu Jun 21 12:27:07 
2018
@@ -1,5 +1,2 @@
 #define __CLC_FUNCTION atomic_add
 #include 
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

Modified: libclc/trunk/generic/include/clc/atomic/atomic_and.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_and.h?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_and.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_and.h Thu Jun 21 12:27:07 
2018
@@ -1,5 +1,2 @@
 #define __CLC_FUNCTION atomic_and
 #include 
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

Modified: libclc/trunk/generic/include/clc/atomic/atomic_decl.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_decl.inc?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_decl.inc (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_decl.inc Thu Jun 21 12:27:07 
2018
@@ -1,4 +1,3 @@
-
 #define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, 
TYPE);
 
@@ -8,3 +7,8 @@
 
 __CLC_DECLARE_ATOMIC_ADDRSPACE(int)
 __CLC_DECLARE_ATOMIC_ADDRSPACE(uint)
+
+#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
+#undef __CLC_DECLARE_ATOMIC
+
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/include/clc/atomic/atomic_max.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_max.h?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_max.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_max.h Thu Jun 21 12:27:07 
2018
@@ -1,5 +1,2 @@
 #define __CLC_FUNCTION atomic_max
 #include 
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

Modified: libclc/trunk/generic/include/clc/atomic/atomic_min.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_min.h?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_min.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_min.h Thu Jun 21 12:27:07 
2018
@@ -1,5 +1,2 @@
 #define __CLC_FUNCTION atomic_min
 #include 
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

Modified: libclc/trunk/generic/include/clc/atomic/atomic_or.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_or.h?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_or.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_or.h Thu Jun 21 12:27:07 2018
@@ -1,5 +1,2 @@
 #define __CLC_FUNCTION atomic_or
 #include 
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

Modified: libclc/trunk/generic/include/clc/atomic/atomic_sub.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_sub.h?rev=335274=335273=335274=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_sub.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_sub.h Thu Jun 21 12:27:07 
2018
@@ -1,5 +1,2 @@
 #define __CLC_FUNCTION atomic_sub
 #include 
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE

Modified: 

[libclc] r335278 - atomic: Provide function implementation of atomic_{dec, inc}

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:26 2018
New Revision: 335278

URL: http://llvm.org/viewvc/llvm-project?rev=335278=rev
Log:
atomic: Provide function implementation of atomic_{dec,inc}

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/lib/atomic/atomic_dec.cl
libclc/trunk/generic/lib/atomic/atomic_inc.cl
Modified:
libclc/trunk/generic/include/clc/atomic/atomic_dec.h
libclc/trunk/generic/include/clc/atomic/atomic_inc.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/atomic/atomic_dec.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_dec.h?rev=335278=335277=335278=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_dec.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_dec.h Thu Jun 21 12:27:26 
2018
@@ -1 +1,4 @@
-#define atomic_dec(p) atomic_sub(p, 1)
+_CLC_OVERLOAD _CLC_DECL int atomic_dec (volatile local int *);
+_CLC_OVERLOAD _CLC_DECL int atomic_dec (volatile global int *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_dec (volatile local uint *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_dec (volatile global uint *);

Modified: libclc/trunk/generic/include/clc/atomic/atomic_inc.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_inc.h?rev=335278=335277=335278=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_inc.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_inc.h Thu Jun 21 12:27:26 
2018
@@ -1 +1,4 @@
-#define atomic_inc(p) atomic_add(p, 1)
+_CLC_OVERLOAD _CLC_DECL int atomic_inc (volatile local int *);
+_CLC_OVERLOAD _CLC_DECL int atomic_inc (volatile global int *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_inc (volatile local uint *);
+_CLC_OVERLOAD _CLC_DECL uint atomic_inc (volatile global uint *);

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=335278=335277=335278=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Thu Jun 21 12:27:26 2018
@@ -7,6 +7,8 @@ async/wait_group_events.cl
 atomic/atomic_add.cl
 atomic/atomic_and.cl
 atomic/atomic_cmpxchg.cl
+atomic/atomic_dec.cl
+atomic/atomic_inc.cl
 atomic/atomic_max.cl
 atomic/atomic_min.cl
 atomic/atomic_or.cl

Added: libclc/trunk/generic/lib/atomic/atomic_dec.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/atomic/atomic_dec.cl?rev=335278=auto
==
--- libclc/trunk/generic/lib/atomic/atomic_dec.cl (added)
+++ libclc/trunk/generic/lib/atomic/atomic_dec.cl Thu Jun 21 12:27:26 2018
@@ -0,0 +1,12 @@
+#include 
+
+#define IMPL(TYPE, AS) \
+_CLC_OVERLOAD _CLC_DEF TYPE atomic_dec(volatile AS TYPE *p) { \
+  return __sync_fetch_and_sub(p, (TYPE)1); \
+}
+
+IMPL(int, global)
+IMPL(unsigned int, global)
+IMPL(int, local)
+IMPL(unsigned int, local)
+#undef IMPL

Added: libclc/trunk/generic/lib/atomic/atomic_inc.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/atomic/atomic_inc.cl?rev=335278=auto
==
--- libclc/trunk/generic/lib/atomic/atomic_inc.cl (added)
+++ libclc/trunk/generic/lib/atomic/atomic_inc.cl Thu Jun 21 12:27:26 2018
@@ -0,0 +1,12 @@
+#include 
+
+#define IMPL(TYPE, AS) \
+_CLC_OVERLOAD _CLC_DEF TYPE atomic_inc(volatile AS TYPE *p) { \
+  return __sync_fetch_and_add(p, (TYPE)1); \
+}
+
+IMPL(int, global)
+IMPL(unsigned int, global)
+IMPL(int, local)
+IMPL(unsigned int, local)
+#undef IMPL


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r335275 - atomic: Cleanup atomic_cmpxchg header

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:12 2018
New Revision: 335275

URL: http://llvm.org/viewvc/llvm-project?rev=335275=rev
Log:
atomic: Cleanup atomic_cmpxchg header

It's easier to just list the four function declarations

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/generic/include/clc/atomic/atomic_cmpxchg.h

Modified: libclc/trunk/generic/include/clc/atomic/atomic_cmpxchg.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atomic/atomic_cmpxchg.h?rev=335275=335274=335275=diff
==
--- libclc/trunk/generic/include/clc/atomic/atomic_cmpxchg.h (original)
+++ libclc/trunk/generic/include/clc/atomic/atomic_cmpxchg.h Thu Jun 21 
12:27:12 2018
@@ -1,15 +1,4 @@
-#define __CLC_FUNCTION atomic_cmpxchg
-
-#define __CLC_DECLARE_ATOMIC_3_ARG(ADDRSPACE, TYPE) \
-   _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, 
TYPE, TYPE);
-
-#define __CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(TYPE) \
-   __CLC_DECLARE_ATOMIC_3_ARG(global, TYPE) \
-   __CLC_DECLARE_ATOMIC_3_ARG(local, TYPE)
-
-__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(int)
-__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(uint)
-
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC_3_ARG
-#undef __CLC_DECLARE_ATOMIC_ADDRESS_SPACE_3_ARG
+_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg (volatile local int *, int, int);
+_CLC_OVERLOAD _CLC_DECL int atomic_cmpxchg (volatile global int *, int, int);
+_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg (volatile local uint *, uint, 
uint);
+_CLC_OVERLOAD _CLC_DECL uint atomic_cmpxchg (volatile global uint *, uint, 
uint);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r335276 - atom: Consolidate cl_khr_{local, global}_int32_{base, extended}_atomics declarations

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:18 2018
New Revision: 335276

URL: http://llvm.org/viewvc/llvm-project?rev=335276=rev
Log:
atom: Consolidate cl_khr_{local,global}_int32_{base,extended}_atomics 
declarations

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/clc/atom_decl_int32.inc
Modified:
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h

libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h

libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h

libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h

libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h

libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h

libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h
libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h
libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h
libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h

libclc/trunk/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h

libclc/trunk/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h

libclc/trunk/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h

libclc/trunk/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h

libclc/trunk/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h

Added: libclc/trunk/generic/include/clc/atom_decl_int32.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atom_decl_int32.inc?rev=335276=auto
==
--- libclc/trunk/generic/include/clc/atom_decl_int32.inc (added)
+++ libclc/trunk/generic/include/clc/atom_decl_int32.inc Thu Jun 21 12:27:18 
2018
@@ -0,0 +1,10 @@
+#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
+   _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (ADDRSPACE TYPE *, TYPE);
+
+__CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, int)
+__CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, uint)
+
+#undef __CLC_DECLARE_ATOM
+
+#undef __CLC_FUNCTION
+#undef __CLC_ADDRESS_SPACE

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h?rev=335276=335275=335276=diff
==
--- 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h 
(original)
+++ 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h 
Thu Jun 21 12:27:18 2018
@@ -1,2 +1,3 @@
-_CLC_OVERLOAD _CLC_DECL int atom_add(global int *p, int val);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(global unsigned int *p, unsigned 
int val);
+#define __CLC_FUNCTION atom_add
+#define __CLC_ADDRESS_SPACE global
+#include 

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h?rev=335276=335275=335276=diff
==
--- 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h 
(original)
+++ 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h 
Thu Jun 21 12:27:18 2018
@@ -1,2 +1,3 @@
-_CLC_OVERLOAD _CLC_DECL int atom_sub(global int *p, int val);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(global unsigned int *p, unsigned 
int val);
+#define __CLC_FUNCTION atom_sub
+#define __CLC_ADDRESS_SPACE global
+#include 

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h?rev=335276=335275=335276=diff
==
--- 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h 
(original)
+++ 
libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h 
Thu Jun 21 12:27:18 2018
@@ -1,2 +1,3 @@
-_CLC_OVERLOAD _CLC_DECL int atom_xchg(global int *p, int val);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(global unsigned int *p, 
unsigned int val);
+#define __CLC_FUNCTION atom_xchg
+#define __CLC_ADDRESS_SPACE global
+#include 

Modified: 
libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h?rev=335276=335275=335276=diff

[libclc] r335277 - atom: Consolidate cl_khr_int64_{base, extended}_atomics declarations

2018-06-21 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun 21 12:27:23 2018
New Revision: 335277

URL: http://llvm.org/viewvc/llvm-project?rev=335277=rev
Log:
atom: Consolidate cl_khr_int64_{base,extended}_atomics declarations

Reviewed-By: Aaron Watry 
Tested-By: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/clc/atom_decl_int64.inc
Modified:
libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_add.h
libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_sub.h
libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_xchg.h
libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_and.h
libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_max.h
libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_min.h
libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_or.h
libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_xor.h

Added: libclc/trunk/generic/include/clc/atom_decl_int64.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atom_decl_int64.inc?rev=335277=auto
==
--- libclc/trunk/generic/include/clc/atom_decl_int64.inc (added)
+++ libclc/trunk/generic/include/clc/atom_decl_int64.inc Thu Jun 21 12:27:23 
2018
@@ -0,0 +1,11 @@
+#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
+   _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, 
TYPE);
+
+__CLC_DECLARE_ATOM(local, long)
+__CLC_DECLARE_ATOM(local, ulong)
+__CLC_DECLARE_ATOM(global, long)
+__CLC_DECLARE_ATOM(global, ulong)
+
+#undef __CLC_DECLARE_ATOM
+
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_add.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_add.h?rev=335277=335276=335277=diff
==
--- libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_add.h 
(original)
+++ libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_add.h Thu 
Jun 21 12:27:23 2018
@@ -1,4 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL long atom_add(volatile global long *p, long val);
-_CLC_OVERLOAD _CLC_DECL unsigned long atom_add(volatile global unsigned long 
*p, unsigned long val);
-_CLC_OVERLOAD _CLC_DECL long atom_add(volatile local long *p, long val);
-_CLC_OVERLOAD _CLC_DECL unsigned long atom_add(volatile local unsigned long 
*p, unsigned long val);
+#define __CLC_FUNCTION atom_add
+#include 

Modified: libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_sub.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_sub.h?rev=335277=335276=335277=diff
==
--- libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_sub.h 
(original)
+++ libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_sub.h Thu 
Jun 21 12:27:23 2018
@@ -1,4 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL long atom_sub(volatile global long *p, long val);
-_CLC_OVERLOAD _CLC_DECL unsigned long atom_sub(volatile global unsigned long 
*p, unsigned long val);
-_CLC_OVERLOAD _CLC_DECL long atom_sub(volatile local long *p, long val);
-_CLC_OVERLOAD _CLC_DECL unsigned long atom_sub(volatile local unsigned long 
*p, unsigned long val);
+#define __CLC_FUNCTION atom_sub
+#include 

Modified: libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_xchg.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_xchg.h?rev=335277=335276=335277=diff
==
--- libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_xchg.h 
(original)
+++ libclc/trunk/generic/include/clc/cl_khr_int64_base_atomics/atom_xchg.h Thu 
Jun 21 12:27:23 2018
@@ -1,4 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL long atom_xchg(volatile global long *p, long val);
-_CLC_OVERLOAD _CLC_DECL unsigned long atom_xchg(volatile global unsigned long 
*p, unsigned long val);
-_CLC_OVERLOAD _CLC_DECL long atom_xchg(volatile local long *p, long val);
-_CLC_OVERLOAD _CLC_DECL unsigned long atom_xchg(volatile local unsigned long 
*p, unsigned long val);
+#define __CLC_FUNCTION atom_xchg
+#include 

Modified: 
libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_and.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_and.h?rev=335277=335276=335277=diff
==
--- libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_and.h 
(original)
+++ libclc/trunk/generic/include/clc/cl_khr_int64_extended_atomics/atom_and.h 
Thu Jun 21 12:27:23 2018
@@ -1,4 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL long atom_and(volatile global 

[libclc] r334227 - r600/fmax: Flush denormals before calling builtin.

2018-06-07 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun  7 13:27:56 2018
New Revision: 334227

URL: http://llvm.org/viewvc/llvm-project?rev=334227=rev
Log:
r600/fmax: Flush denormals before calling builtin.

Same reason as amdgcn.
Fixes fmax, maxmag CTS on turks.
Reviewer: Tom Stellard 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/r600/lib/math/fmax.cl
Modified:
libclc/trunk/r600/lib/SOURCES

Modified: libclc/trunk/r600/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=334227=334226=334227=diff
==
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Thu Jun  7 13:27:56 2018
@@ -1,3 +1,4 @@
+math/fmax.cl
 synchronization/barrier_impl.ll
 workitem/get_global_offset.cl
 workitem/get_group_id.cl

Added: libclc/trunk/r600/lib/math/fmax.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/math/fmax.cl?rev=334227=auto
==
--- libclc/trunk/r600/lib/math/fmax.cl (added)
+++ libclc/trunk/r600/lib/math/fmax.cl Thu Jun  7 13:27:56 2018
@@ -0,0 +1,29 @@
+#include 
+
+#include "../../../generic/lib/clcmacro.h"
+#include "../../../generic/lib/math/math.h"
+
+_CLC_DEF _CLC_OVERLOAD float fmax(float x, float y)
+{
+   /* Flush denormals if not enabled. Otherwise fmax instruction flushes
+* the values for comparison, but outputs original denormal */
+   x = __clc_flush_denormal_if_not_supported(x);
+   y = __clc_flush_denormal_if_not_supported(y);
+   return __builtin_fmaxf(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, fmax, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_DEF _CLC_OVERLOAD double fmax(double x, double y)
+{
+   return __builtin_fmax(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmax, double, double)
+
+#endif
+
+#define __CLC_BODY <../../../generic/lib/math/fmax.inc>
+#include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r334228 - r600/fmin: Flush denormals before calling builtin.

2018-06-07 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun  7 13:27:58 2018
New Revision: 334228

URL: http://llvm.org/viewvc/llvm-project?rev=334228=rev
Log:
r600/fmin: Flush denormals before calling builtin.

Same reason as amdgcn.
Fixes fmin, minmag CTS on turks.
Reviewer: Tom Stellard 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/r600/lib/math/fmin.cl
Modified:
libclc/trunk/r600/lib/SOURCES

Modified: libclc/trunk/r600/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=334228=334227=334228=diff
==
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Thu Jun  7 13:27:58 2018
@@ -1,4 +1,5 @@
 math/fmax.cl
+math/fmin.cl
 synchronization/barrier_impl.ll
 workitem/get_global_offset.cl
 workitem/get_group_id.cl

Added: libclc/trunk/r600/lib/math/fmin.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/math/fmin.cl?rev=334228=auto
==
--- libclc/trunk/r600/lib/math/fmin.cl (added)
+++ libclc/trunk/r600/lib/math/fmin.cl Thu Jun  7 13:27:58 2018
@@ -0,0 +1,30 @@
+#include 
+
+#include "../../../generic/lib/clcmacro.h"
+#include "../../../generic/lib/math/math.h"
+
+_CLC_DEF _CLC_OVERLOAD float fmin(float x, float y)
+{
+   /* fcanonicalize removes sNaNs and flushes denormals if not enabled.
+* Otherwise fmin instruction flushes the values for comparison,
+* but outputs original denormal */
+   x = __clc_flush_denormal_if_not_supported(x);
+   y = __clc_flush_denormal_if_not_supported(y);
+   return __builtin_fminf(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, fmin, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_DEF _CLC_OVERLOAD double fmin(double x, double y)
+{
+   return __builtin_fmin(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmin, double, double)
+
+#endif
+
+#define __CLC_BODY <../../../generic/lib/math/fmin.inc>
+#include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r334226 - math/fma: Add fp32 software implementation

2018-06-07 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Jun  7 13:27:43 2018
New Revision: 334226

URL: http://llvm.org/viewvc/llvm-project?rev=334226=rev
Log:
math/fma: Add fp32 software implementation

Passes CTS on carrizo (when forced to use sw fma) and turks.
Reviewer: Tom Stellard 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/clc/math/ternary_decl.inc
libclc/trunk/generic/include/math/clc_fma.h
libclc/trunk/generic/lib/math/clc_fma.cl
libclc/trunk/generic/lib/math/fma.cl
libclc/trunk/generic/lib/math/fma.inc
Modified:
libclc/trunk/generic/include/clc/math/fma.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/fma.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fma.h?rev=334226=334225=334226=diff
==
--- libclc/trunk/generic/include/clc/math/fma.h (original)
+++ libclc/trunk/generic/include/clc/math/fma.h Thu Jun  7 13:27:43 2018
@@ -1,6 +1,7 @@
-#undef fma
-#define fma __clc_fma
+#define __CLC_BODY 
+#define __CLC_FUNCTION fma
 
-#define __CLC_FUNCTION __clc_fma
-#define __CLC_INTRINSIC "llvm.fma"
-#include 
+#include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Added: libclc/trunk/generic/include/clc/math/ternary_decl.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/ternary_decl.inc?rev=334226=auto
==
--- libclc/trunk/generic/include/clc/math/ternary_decl.inc (added)
+++ libclc/trunk/generic/include/clc/math/ternary_decl.inc Thu Jun  7 13:27:43 
2018
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, 
__CLC_GENTYPE b, __CLC_GENTYPE c);

Added: libclc/trunk/generic/include/math/clc_fma.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_fma.h?rev=334226=auto
==
--- libclc/trunk/generic/include/math/clc_fma.h (added)
+++ libclc/trunk/generic/include/math/clc_fma.h Thu Jun  7 13:27:43 2018
@@ -0,0 +1,11 @@
+#define __CLC_FUNCTION __clc_fma
+#define __CLC_INTRINSIC "llvm.fma"
+#include 
+
+#define __FLOAT_ONLY
+#define __CLC_FUNCTION __clc_sw_fma
+#define __CLC_BODY 
+#include 
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
+#undef __FLOAT_ONLY

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=334226=334225=334226=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Thu Jun  7 13:27:43 2018
@@ -101,6 +101,8 @@ math/exp2.cl
 math/clc_exp10.cl
 math/exp10.cl
 math/fdim.cl
+math/clc_fma.cl
+math/fma.cl
 math/fmax.cl
 math/fmin.cl
 math/clc_fmod.cl

Added: libclc/trunk/generic/lib/math/clc_fma.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_fma.cl?rev=334226=auto
==
--- libclc/trunk/generic/lib/math/clc_fma.cl (added)
+++ libclc/trunk/generic/lib/math/clc_fma.cl Thu Jun  7 13:27:43 2018
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include 
+
+#include "config.h"
+#include "math.h"
+#include "../clcmacro.h"
+
+struct fp {
+   ulong mantissa;
+   int exponent;
+   uint sign;
+};
+
+_CLC_DEF _CLC_OVERLOAD float __clc_sw_fma(float a, float b, float c)
+{
+   /* special cases */
+   if (isnan(a) || isnan(b) || isnan(c) || isinf(a) || isinf(b))
+   return mad(a, b, c);
+
+   /* If only c is inf, and both a,b are regular numbers, the result is c*/
+   if (isinf(c))
+   return c;
+
+   a = __clc_flush_denormal_if_not_supported(a);
+   b = 

[libclc] r332677 - Add initial support for half precision builtins

2018-05-17 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu May 17 15:55:30 2018
New Revision: 332677

URL: http://llvm.org/viewvc/llvm-project?rev=332677=rev
Log:
Add initial support for half precision builtins

v2: fix fmax implementation
use consistent checks for __CLC_FP_SIZE
add missing TODOs
fix whitespace in definitions.h
v3: undef ZERO in modf.inc

Signed-off-by: Jan Vesely 
reviewer: Jeroen Ketema 
Reviewed-by: Aaron Watry 
Tested-by: Aaron Watry 

Modified:
libclc/trunk/amdgcn/lib/math/fmax.cl
libclc/trunk/amdgcn/lib/math/fmin.cl
libclc/trunk/amdgpu/lib/math/nextafter.cl
libclc/trunk/amdgpu/lib/math/sqrt.cl
libclc/trunk/generic/include/clc/as_type.h
libclc/trunk/generic/include/clc/async/gentype.inc
libclc/trunk/generic/include/clc/float/definitions.h
libclc/trunk/generic/include/clc/geometric/floatn.inc
libclc/trunk/generic/include/clc/math/binary_intrin.inc
libclc/trunk/generic/include/clc/math/gentype.inc
libclc/trunk/generic/include/clc/math/nan.inc
libclc/trunk/generic/include/clc/math/ternary_intrin.inc
libclc/trunk/generic/include/clc/math/unary_intrin.inc
libclc/trunk/generic/include/clc/relational/floatn.inc
libclc/trunk/generic/include/clc/relational/isequal.h
libclc/trunk/generic/include/clc/relational/isinf.h
libclc/trunk/generic/include/clc/relational/isnan.h
libclc/trunk/generic/include/math/clc_ldexp.h
libclc/trunk/generic/lib/geometric/dot.cl
libclc/trunk/generic/lib/geometric/length.cl
libclc/trunk/generic/lib/math/acos.inc
libclc/trunk/generic/lib/math/asin.inc
libclc/trunk/generic/lib/math/clc_nextafter.cl
libclc/trunk/generic/lib/math/clc_sqrt_impl.inc
libclc/trunk/generic/lib/math/clc_sw_binary.inc
libclc/trunk/generic/lib/math/clc_sw_unary.inc
libclc/trunk/generic/lib/math/copysign.cl
libclc/trunk/generic/lib/math/fmax.cl
libclc/trunk/generic/lib/math/fmax.inc
libclc/trunk/generic/lib/math/fmin.cl
libclc/trunk/generic/lib/math/fmin.inc
libclc/trunk/generic/lib/math/fract.inc
libclc/trunk/generic/lib/math/ldexp.cl
libclc/trunk/generic/lib/math/ldexp.inc
libclc/trunk/generic/lib/math/lgamma_r.inc
libclc/trunk/generic/lib/math/modf.inc
libclc/trunk/generic/lib/math/nan.inc
libclc/trunk/generic/lib/math/pown.inc
libclc/trunk/generic/lib/math/remquo.inc
libclc/trunk/generic/lib/math/rootn.inc
libclc/trunk/generic/lib/math/sincos.inc
libclc/trunk/generic/lib/math/sqrt.cl
libclc/trunk/generic/lib/relational/isequal.cl
libclc/trunk/generic/lib/relational/isfinite.cl
libclc/trunk/generic/lib/relational/isgreater.cl
libclc/trunk/generic/lib/relational/isgreaterequal.cl
libclc/trunk/generic/lib/relational/isinf.cl
libclc/trunk/generic/lib/relational/isless.cl
libclc/trunk/generic/lib/relational/islessequal.cl
libclc/trunk/generic/lib/relational/islessgreater.cl
libclc/trunk/generic/lib/relational/isnan.cl
libclc/trunk/generic/lib/relational/isnormal.cl
libclc/trunk/generic/lib/relational/isnotequal.cl
libclc/trunk/generic/lib/relational/isordered.cl
libclc/trunk/generic/lib/relational/isunordered.cl
libclc/trunk/generic/lib/relational/signbit.cl
libclc/trunk/generic/lib/shared/vstore_half.inc

Modified: libclc/trunk/amdgcn/lib/math/fmax.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/math/fmax.cl?rev=332677=332676=332677=diff
==
--- libclc/trunk/amdgcn/lib/math/fmax.cl (original)
+++ libclc/trunk/amdgcn/lib/math/fmax.cl Thu May 17 15:55:30 2018
@@ -26,6 +26,21 @@ _CLC_DEF _CLC_OVERLOAD double fmax(doubl
 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmax, double, double)
 
 #endif
+#ifdef cl_khr_fp16
+
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+_CLC_DEF _CLC_OVERLOAD half fmax(half x, half y)
+{
+   if (isnan(x))
+  return y;
+   if (isnan(y))
+  return x;
+   return (y < x) ? x : y;
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, fmax, half, half)
+
+#endif
 
 #define __CLC_BODY <../../../generic/lib/math/fmax.inc>
 #include 

Modified: libclc/trunk/amdgcn/lib/math/fmin.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/math/fmin.cl?rev=332677=332676=332677=diff
==
--- libclc/trunk/amdgcn/lib/math/fmin.cl (original)
+++ libclc/trunk/amdgcn/lib/math/fmin.cl Thu May 17 15:55:30 2018
@@ -26,6 +26,21 @@ _CLC_DEF _CLC_OVERLOAD double fmin(doubl
 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmin, double, double)
 
 #endif
+#ifdef cl_khr_fp16
+
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+_CLC_DEF _CLC_OVERLOAD half fmin(half x, half y)
+{
+   if (isnan(x))
+  return y;
+   if (isnan(y))
+  return x;
+   return (y < x) ? y : x;
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD 

[libclc] r332324 - rootn: Use denormal path only

2018-05-14 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon May 14 21:22:43 2018
New Revision: 332324

URL: http://llvm.org/viewvc/llvm-project?rev=332324=rev
Log:
rootn: Use denormal path only

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Use 0.0f explicitly intead of relying on GPU to flush it.
Fixes CTS on carrizo and turks

Signed-off-by: Jan Vesely 
Acked-by: Aaron Watry 
Tested-by: Aaron Watry 

Modified:
libclc/trunk/generic/lib/math/clc_rootn.cl

Modified: libclc/trunk/generic/lib/math/clc_rootn.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_rootn.cl?rev=332324=332323=332324=diff
==
--- libclc/trunk/generic/lib/math/clc_rootn.cl (original)
+++ libclc/trunk/generic/lib/math/clc_rootn.cl Mon May 14 21:22:43 2018
@@ -170,16 +170,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_rootn
 tv = USE_TABLE(exp_tbl_ep, j);
 
 float expylogx = mad(tv.s0, poly, mad(tv.s1, poly, tv.s1)) + tv.s0;
-float sexpylogx;
-if (!__clc_fp32_subnormals_supported()) {
-   int explg = ((as_uint(expylogx) & EXPBITS_SP32 >> 23) - 127);
-   m = (23-(m + 149)) == 0 ? 1: m;
-   uint mantissa =  ((as_uint(expylogx) & 
MANTBITS_SP32)|IMPBIT_SP32) >> (23-(m + 149));
-   sexpylogx = as_float(mantissa);
-} else {
-   sexpylogx = expylogx * as_float(0x1 << (m + 149));
-}
-
+float sexpylogx = __clc_fp32_subnormals_supported() ? expylogx * 
as_float(0x1 << (m + 149)) : 0.0f;
 
 float texpylogx = as_float(as_int(expylogx) + m2);
 expylogx = m < -125 ? sexpylogx : texpylogx;


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r331435 - remquo: Flush denormals if not supported

2018-05-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed May  2 22:44:28 2018
New Revision: 331435

URL: http://llvm.org/viewvc/llvm-project?rev=331435=rev
Log:
remquo: Flush denormals if not supported

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs.
Fixes CTS on carrizo and turks.

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Modified:
libclc/trunk/generic/lib/math/clc_remquo.cl

Modified: libclc/trunk/generic/lib/math/clc_remquo.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_remquo.cl?rev=331435=331434=331435=diff
==
--- libclc/trunk/generic/lib/math/clc_remquo.cl (original)
+++ libclc/trunk/generic/lib/math/clc_remquo.cl Wed May  2 22:44:28 2018
@@ -29,6 +29,8 @@
 
 _CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y, __private int *quo)
 {
+x = __clc_flush_denormal_if_not_supported(x);
+y = __clc_flush_denormal_if_not_supported(y);
 int ux = as_int(x);
 int ax = ux & EXSIGNBIT_SP32;
 float xa = as_float(ax);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r331433 - math: Add helper function to flush denormals if not supported.

2018-05-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed May  2 22:44:22 2018
New Revision: 331433

URL: http://llvm.org/viewvc/llvm-project?rev=331433=rev
Log:
math: Add helper function to flush denormals if not supported.

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Modified:
libclc/trunk/generic/lib/math/math.h

Modified: libclc/trunk/generic/lib/math/math.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/math.h?rev=331433=331432=331433=diff
==
--- libclc/trunk/generic/lib/math/math.h (original)
+++ libclc/trunk/generic/lib/math/math.h Wed May  2 22:44:22 2018
@@ -20,6 +20,13 @@
  * THE SOFTWARE.
  */
 
+#ifndef __CLC_MATH_H_
+#define __CLC_MATH_H_
+
+#include "clc/clcfunc.h"
+#include "clc/as_type.h"
+#include "config.h"
+
 #define SNAN 0x001
 #define QNAN 0x002
 #define NINF 0x004
@@ -66,6 +73,17 @@
 #define MANTLENGTH_SP32   24
 #define BASEDIGITS_SP32   7
 
+_CLC_OVERLOAD _CLC_INLINE float __clc_flush_denormal_if_not_supported(float x)
+{
+   int ix = as_int(x);
+   if (!__clc_fp32_subnormals_supported() &&
+   ((ix & EXPBITS_SP32) == 0) && ((ix & MANTBITS_SP32) != 0)) {
+   ix &= SIGNBIT_SP32;
+   x = as_float(ix);
+   }
+   return x;
+}
+
 #ifdef cl_khr_fp64
 
 #define SIGNBIT_DP64  0x8000L
@@ -93,3 +111,4 @@
 #endif // cl_khr_fp64
 
 #define ALIGNED(x) __attribute__((aligned(x)))
+#endif // __CLC_MATH_H_


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r331434 - remquo: Port from amd builtins

2018-05-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed May  2 22:44:26 2018
New Revision: 331434

URL: http://llvm.org/viewvc/llvm-project?rev=331434=rev
Log:
remquo: Port from amd builtins

double version passes on carrizo. float version fails on denormals.

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Added:
libclc/trunk/generic/include/clc/math/remquo.h
libclc/trunk/generic/include/clc/math/remquo.inc
libclc/trunk/generic/include/math/clc_remquo.h
libclc/trunk/generic/lib/math/clc_remquo.cl
libclc/trunk/generic/lib/math/remquo.cl
libclc/trunk/generic/lib/math/remquo.inc
Modified:
libclc/trunk/generic/include/clc/clc.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/clc.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=331434=331433=331434=diff
==
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Wed May  2 22:44:26 2018
@@ -104,6 +104,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Added: libclc/trunk/generic/include/clc/math/remquo.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/remquo.h?rev=331434=auto
==
--- libclc/trunk/generic/include/clc/math/remquo.h (added)
+++ libclc/trunk/generic/include/clc/math/remquo.h Wed May  2 22:44:26 2018
@@ -0,0 +1,18 @@
+#define __CLC_FUNCTION remquo
+
+#define __CLC_BODY 
+#define __CLC_ADDRESS_SPACE global
+#include 
+#undef __CLC_ADDRESS_SPACE
+
+#define __CLC_BODY 
+#define __CLC_ADDRESS_SPACE local
+#include 
+#undef __CLC_ADDRESS_SPACE
+
+#define __CLC_BODY 
+#define __CLC_ADDRESS_SPACE private
+#include 
+#undef __CLC_ADDRESS_SPACE
+
+#undef __CLC_FUNCTION

Added: libclc/trunk/generic/include/clc/math/remquo.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/remquo.inc?rev=331434=auto
==
--- libclc/trunk/generic/include/clc/math/remquo.inc (added)
+++ libclc/trunk/generic/include/clc/math/remquo.inc Wed May  2 22:44:26 2018
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, 
__CLC_GENTYPE y, __CLC_ADDRESS_SPACE __CLC_INTN *q);

Added: libclc/trunk/generic/include/math/clc_remquo.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_remquo.h?rev=331434=auto
==
--- libclc/trunk/generic/include/math/clc_remquo.h (added)
+++ libclc/trunk/generic/include/math/clc_remquo.h Wed May  2 22:44:26 2018
@@ -0,0 +1,8 @@
+#define __CLC_FUNCTION __clc_remquo
+
+#define __CLC_BODY 
+#define __CLC_ADDRESS_SPACE private
+#include 
+#undef __CLC_ADDRESS_SPACE
+
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=331434=331433=331434=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed May  2 22:44:26 2018
@@ -163,6 +163,8 @@ math/clc_powr.cl
 math/powr.cl
 math/clc_remainder.cl
 math/remainder.cl
+math/clc_remquo.cl
+math/remquo.cl
 math/clc_rootn.cl
 math/rootn.cl
 math/sin.cl

Added: libclc/trunk/generic/lib/math/clc_remquo.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_remquo.cl?rev=331434=auto
==
--- libclc/trunk/generic/lib/math/clc_remquo.cl (added)
+++ libclc/trunk/generic/lib/math/clc_remquo.cl Wed May  2 22:44:26 2018
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 

[libclc] r331366 - clc_sqrt: Reuse unary_decl.inc

2018-05-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed May  2 09:06:52 2018
New Revision: 331366

URL: http://llvm.org/viewvc/llvm-project?rev=331366=rev
Log:
clc_sqrt: Reuse unary_decl.inc

Signed-off-by: Jan Vesely 
Reviewed-by: Aaron Watry 
Tested-by: Aaron Watry 

Removed:
libclc/trunk/generic/include/math/clc_sqrt.inc
Modified:
libclc/trunk/generic/include/math/clc_sqrt.h

Modified: libclc/trunk/generic/include/math/clc_sqrt.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_sqrt.h?rev=331366=331365=331366=diff
==
--- libclc/trunk/generic/include/math/clc_sqrt.h (original)
+++ libclc/trunk/generic/include/math/clc_sqrt.h Wed May  2 09:06:52 2018
@@ -1,29 +1,5 @@
-/*
- * Copyright (c) 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif
-
-#define __CLC_BODY 
+#define __CLC_FUNCTION __clc_sqrt
+#define __CLC_BODY 
 #include 
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/math/clc_sqrt.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_sqrt.inc?rev=331365=auto
==
--- libclc/trunk/generic/include/math/clc_sqrt.inc (original)
+++ libclc/trunk/generic/include/math/clc_sqrt.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __clc_sqrt(__CLC_GENTYPE a);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r330851 - relational/select: Condition types for half are short/ushort, not char/uchar

2018-04-25 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Wed Apr 25 10:36:36 2018
New Revision: 330851

URL: http://llvm.org/viewvc/llvm-project?rev=330851=rev
Log:
relational/select: Condition types for half are short/ushort, not char/uchar

Signed-off-by: Jan Vesely 
Reviewed-by: Aaron Watry 

Modified:
libclc/trunk/generic/include/clc/relational/select.inc

Modified: libclc/trunk/generic/include/clc/relational/select.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/relational/select.inc?rev=330851=330850=330851=diff
==
--- libclc/trunk/generic/include/clc/relational/select.inc (original)
+++ libclc/trunk/generic/include/clc/relational/select.inc Wed Apr 25 10:36:36 
2018
@@ -9,8 +9,8 @@
 #define __CLC_S_GENTYPE __CLC_XCONCAT(int, __CLC_VECSIZE)
 #define __CLC_U_GENTYPE __CLC_XCONCAT(uint, __CLC_VECSIZE)
 #elif __CLC_FPSIZE == 16
-#define __CLC_S_GENTYPE __CLC_XCONCAT(char, __CLC_VECSIZE)
-#define __CLC_U_GENTYPE __CLC_XCONCAT(uchar, __CLC_VECSIZE)
+#define __CLC_S_GENTYPE __CLC_XCONCAT(short, __CLC_VECSIZE)
+#define __CLC_U_GENTYPE __CLC_XCONCAT(ushort, __CLC_VECSIZE)
 #endif
 
 _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE select(__CLC_GENTYPE x, __CLC_GENTYPE y, 
__CLC_S_GENTYPE z);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r330649 - log10: Use sw implementation from amd builtins

2018-04-23 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon Apr 23 14:10:42 2018
New Revision: 330649

URL: http://llvm.org/viewvc/llvm-project?rev=330649=rev
Log:
log10: Use sw implementation from amd builtins

Add missing table.
Fixes log10d CTS on carrizo.
Signed-off-by: Jan Vesely 
Acked-by: Aaron Watry 
Tested-by: Aaron Watry 

Removed:
libclc/trunk/generic/lib/math/log10.inc
Modified:
libclc/trunk/generic/lib/math/log10.cl
libclc/trunk/generic/lib/math/log_base.h
libclc/trunk/generic/lib/math/tables.cl
libclc/trunk/generic/lib/math/tables.h

Modified: libclc/trunk/generic/lib/math/log10.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/log10.cl?rev=330649=330648=330649=diff
==
--- libclc/trunk/generic/lib/math/log10.cl (original)
+++ libclc/trunk/generic/lib/math/log10.cl Mon Apr 23 14:10:42 2018
@@ -1,4 +1,39 @@
+/*
+ * Copyright (c) 2015 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
 #include 
+#include "../clcmacro.h"
+#include "tables.h"
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif // cl_khr_fp64
+
+#define COMPILING_LOG10
+#include "log_base.h"
+#undef COMPILING_LOG10
+
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, log10, float);
 
-#define __CLC_BODY 
-#include 
+#ifdef cl_khr_fp64
+_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, log10, double);
+#endif // cl_khr_fp64

Removed: libclc/trunk/generic/lib/math/log10.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/log10.inc?rev=330648=auto
==
--- libclc/trunk/generic/lib/math/log10.inc (original)
+++ libclc/trunk/generic/lib/math/log10.inc (removed)
@@ -1,13 +0,0 @@
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE log10(__CLC_GENTYPE val) {
-  // log10(x) = log2(x) / log2(10)
-  // 1 / log2(10) = 0.30102999566 = log10(2)
-  // SP representation is 0.30103 (0x1.344136p-2)
-  // DP representation is 
0.30102999565993762312442414(0x1.34413509E61D8p-2)
-#if __CLC_FPSIZE == 32
-  return log2(val) * 0x1.344136p-2f;
-#elif __CLC_FPSIZE == 64
-  return log2(val) * 0x1.34413509E61D8p-2;
-#else
-#error unknown _CLC_FPSIZE
-#endif
-}

Modified: libclc/trunk/generic/lib/math/log_base.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/log_base.h?rev=330649=330648=330649=diff
==
--- libclc/trunk/generic/lib/math/log_base.h (original)
+++ libclc/trunk/generic/lib/math/log_base.h Mon Apr 23 14:10:42 2018
@@ -92,14 +92,12 @@ log(float x)
 const float LOG2E_HEAD = 0x1.70p+0f; // 1.4375
 const float LOG2E_TAIL = 0x1.547652p-8f; // 0.00519504072
 #elif defined(COMPILING_LOG10)
-USE_TABLE(float2, p_log, LOG10_TBL);
 const float LOG10E = 0x1.bcb7b2p-2f;// 0.43429448190325182
 const float LOG10E_HEAD = 0x1.bcp-2f;   // 0.43359375
 const float LOG10E_TAIL = 0x1.6f62a4p-11f;  // 0.0007007319
 const float LOG10_2_HEAD = 0x1.34p-2f;  // 0.30078125
 const float LOG10_2_TAIL = 0x1.04d426p-12f; // 0.000248745637
 #else
-USE_TABLE(float2, p_log, LOGE_TBL);
 const float LOG2_HEAD = 0x1.62e000p-1f;  // 0.693115234
 const float LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.319461833
 #endif
@@ -158,11 +156,11 @@ log(float x)
 z1 = tv.s0 + mf;
 z2 = mad(poly, -LOG2E, tv.s1);
 #elif defined(COMPILING_LOG10)
-float2 tv = p_log[indx];
+float2 tv = USE_TABLE(log10_tbl, indx);
 z1 = mad(mf, LOG10_2_HEAD, tv.s0);
 z2 = mad(poly, -LOG10E, mf*LOG10_2_TAIL) + tv.s1;
 #else
-float2 tv = p_log[indx];
+float2 tv = USE_TABLE(log_tbl, indx);
 z1 = mad(mf, LOG2_HEAD, tv.s0);
 z2 = mad(mf, LOG2_TAIL, -poly) + tv.s1;
 #endif

Modified: 

[libclc] r330205 - pow: Use denormal path only

2018-04-17 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Apr 17 12:35:28 2018
New Revision: 330205

URL: http://llvm.org/viewvc/llvm-project?rev=330205=rev
Log:
pow: Use denormal path only

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Modified:
libclc/trunk/generic/lib/math/clc_pow.cl

Modified: libclc/trunk/generic/lib/math/clc_pow.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_pow.cl?rev=330205=330204=330205=diff
==
--- libclc/trunk/generic/lib/math/clc_pow.cl (original)
+++ libclc/trunk/generic/lib/math/clc_pow.cl Tue Apr 17 12:35:28 2018
@@ -169,17 +169,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_pow(f
 tv = USE_TABLE(exp_tbl_ep, j);
 
 float expylogx = mad(tv.s0, poly, mad(tv.s1, poly, tv.s1)) + tv.s0;
-float sexpylogx;
-if (!__clc_fp32_subnormals_supported()) {
-   int explg = ((as_uint(expylogx) & EXPBITS_SP32 >> 23) - 127);
-   m = (23-(m + 149)) == 0 ? 1: m;
-   uint mantissa =  ((as_uint(expylogx) & 
MANTBITS_SP32)|IMPBIT_SP32) >> (23-(m + 149));
-   sexpylogx = as_float(mantissa);
-} else {
-   sexpylogx = expylogx * as_float(0x1 << (m + 149));
-}
-
-
+float sexpylogx = expylogx * as_float(0x1 << (m + 149));
 float texpylogx = as_float(as_int(expylogx) + m2);
 expylogx = m < -125 ? sexpylogx : texpylogx;
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r330206 - pown: Use denormal path only

2018-04-17 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Apr 17 12:35:30 2018
New Revision: 330206

URL: http://llvm.org/viewvc/llvm-project?rev=330206=rev
Log:
pown: Use denormal path only

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Modified:
libclc/trunk/generic/lib/math/clc_pown.cl

Modified: libclc/trunk/generic/lib/math/clc_pown.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_pown.cl?rev=330206=330205=330206=diff
==
--- libclc/trunk/generic/lib/math/clc_pown.cl (original)
+++ libclc/trunk/generic/lib/math/clc_pown.cl Tue Apr 17 12:35:30 2018
@@ -167,17 +167,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_pown(
 tv = USE_TABLE(exp_tbl_ep, j);
 
 float expylogx = mad(tv.s0, poly, mad(tv.s1, poly, tv.s1)) + tv.s0;
-float sexpylogx;
-if (!__clc_fp32_subnormals_supported()) {
-   int explg = ((as_uint(expylogx) & EXPBITS_SP32 >> 23) - 127);
-   m = (23-(m + 149)) == 0 ? 1: m;
-   uint mantissa =  ((as_uint(expylogx) & 
MANTBITS_SP32)|IMPBIT_SP32) >> (23-(m + 149));
-   sexpylogx = as_float(mantissa);
-} else {
-   sexpylogx = expylogx * as_float(0x1 << (m + 149));
-}
-
-
+float sexpylogx = expylogx * as_float(0x1 << (m + 149));
 float texpylogx = as_float(as_int(expylogx) + m2);
 expylogx = m < -125 ? sexpylogx : texpylogx;
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r330207 - powr: Use denormal path only

2018-04-17 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Apr 17 12:35:32 2018
New Revision: 330207

URL: http://llvm.org/viewvc/llvm-project?rev=330207=rev
Log:
powr: Use denormal path only

It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Modified:
libclc/trunk/generic/lib/math/clc_powr.cl

Modified: libclc/trunk/generic/lib/math/clc_powr.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_powr.cl?rev=330207=330206=330207=diff
==
--- libclc/trunk/generic/lib/math/clc_powr.cl (original)
+++ libclc/trunk/generic/lib/math/clc_powr.cl Tue Apr 17 12:35:32 2018
@@ -165,17 +165,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_powr(
 tv = USE_TABLE(exp_tbl_ep, j);
 
 float expylogx = mad(tv.s0, poly, mad(tv.s1, poly, tv.s1)) + tv.s0;
-float sexpylogx;
-if (!__clc_fp32_subnormals_supported()) {
-   int explg = ((as_uint(expylogx) & EXPBITS_SP32 >> 23) - 127);
-   m = (23-(m + 149)) == 0 ? 1: m;
-   uint mantissa =  ((as_uint(expylogx) & 
MANTBITS_SP32)|IMPBIT_SP32) >> (23-(m + 149));
-   sexpylogx = as_float(mantissa);
-} else {
-   sexpylogx = expylogx * as_float(0x1 << (m + 149));
-}
-
-
+float sexpylogx = expylogx * as_float(0x1 << (m + 149));
 float texpylogx = as_float(as_int(expylogx) + m2);
 expylogx = m < -125 ? sexpylogx : texpylogx;
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r330198 - amdgcn/fmin: Fix typos that reduced precision

2018-04-17 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Apr 17 11:11:29 2018
New Revision: 330198

URL: http://llvm.org/viewvc/llvm-project?rev=330198=rev
Log:
amdgcn/fmin: Fix typos that reduced precision

Not sure how these sneaked in.
Fixes fminD and few other tests(fractD, cosD) on carrizo
Signed-off-by: Jan Vesely 
Reviewed-by: Aaron Watry 

Modified:
libclc/trunk/amdgcn/lib/math/fmin.cl

Modified: libclc/trunk/amdgcn/lib/math/fmin.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/math/fmin.cl?rev=330198=330197=330198=diff
==
--- libclc/trunk/amdgcn/lib/math/fmin.cl (original)
+++ libclc/trunk/amdgcn/lib/math/fmin.cl Tue Apr 17 11:11:29 2018
@@ -19,9 +19,9 @@ _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC
 
 _CLC_DEF _CLC_OVERLOAD double fmin(double x, double y)
 {
-   x = __builtin_canonicalizef(x);
-   y = __builtin_canonicalizef(y);
-   return __builtin_fminf(x, y);
+   x = __builtin_canonicalize(x);
+   y = __builtin_canonicalize(y);
+   return __builtin_fmin(x, y);
 }
 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmin, double, double)
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r330197 - exp10: Port from amd builtins

2018-04-17 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Tue Apr 17 11:08:08 2018
New Revision: 330197

URL: http://llvm.org/viewvc/llvm-project?rev=330197=rev
Log:
exp10: Port from amd builtins

Passes CTS on carrizo and turks.
Signed-off-by: Jan Vesely 
Reviewed and Tested (on RX 580) by: Aaron Watry 

Added:
libclc/trunk/generic/include/math/clc_exp10.h
libclc/trunk/generic/lib/math/clc_exp10.cl
Removed:
libclc/trunk/generic/lib/math/exp10.inc
Modified:
libclc/trunk/generic/lib/SOURCES
libclc/trunk/generic/lib/math/exp10.cl

Added: libclc/trunk/generic/include/math/clc_exp10.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_exp10.h?rev=330197=auto
==
--- libclc/trunk/generic/include/math/clc_exp10.h (added)
+++ libclc/trunk/generic/include/math/clc_exp10.h Tue Apr 17 11:08:08 2018
@@ -0,0 +1,4 @@
+#define __CLC_FUNCTION __clc_exp10
+#define __CLC_BODY 
+#include 
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=330197=330196=330197=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Tue Apr 17 11:08:08 2018
@@ -98,6 +98,7 @@ math/exp.cl
 math/exp_helper.cl
 math/expm1.cl
 math/exp2.cl
+math/clc_exp10.cl
 math/exp10.cl
 math/fdim.cl
 math/fmax.cl

Added: libclc/trunk/generic/lib/math/clc_exp10.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_exp10.cl?rev=330197=auto
==
--- libclc/trunk/generic/lib/math/clc_exp10.cl (added)
+++ libclc/trunk/generic/lib/math/clc_exp10.cl Tue Apr 17 11:08:08 2018
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include 
+
+#include "config.h"
+#include "math.h"
+#include "tables.h"
+#include "../clcmacro.h"
+
+//Algorithm:
+//
+//e^x = 2^(x/ln(2)) = 2^(x*(64/ln(2))/64)
+//
+//x*(64/ln(2)) = n + f, |f| <= 0.5, n is integer
+//n = 64*m + j,   0 <= j < 64
+//
+//e^x = 2^((64*m + j + f)/64)
+//= (2^m) * (2^(j/64)) * 2^(f/64)
+//= (2^m) * (2^(j/64)) * e^(f*(ln(2)/64))
+//
+//f = x*(64/ln(2)) - n
+//r = f*(ln(2)/64) = x - n*(ln(2)/64)
+//
+//e^x = (2^m) * (2^(j/64)) * e^r
+//
+//(2^(j/64)) is precomputed
+//
+//e^r = 1 + r + (r^2)/2! + (r^3)/3! + (r^4)/4! + (r^5)/5!
+//e^r = 1 + q
+//
+//q = r + (r^2)/2! + (r^3)/3! + (r^4)/4! + (r^5)/5!
+//
+//e^x = (2^m) * ( (2^(j/64)) + q*(2^(j/64)) )
+
+_CLC_DEF _CLC_OVERLOAD float __clc_exp10(float x)
+{
+const float X_MAX =  0x1.344134p+5f; // 128*log2/log10 : 38.53183944498959
+const float X_MIN = -0x1.66d3e8p+5f; // -149*log2/log10 : -44.8534693539332
+
+const float R_64_BY_LOG10_2 = 0x1.a934f0p+7f; // 64*log10/log2 : 
212.6033980727912
+const float R_LOG10_2_BY_64_LD = 0x1.34p-8f; // log2/(64 * log10) lead 
: 0.004699707
+const float R_LOG10_2_BY_64_TL = 0x1.04d426p-18f; // log2/(64 * log10) 
tail : 0.0388665057
+const float R_LN10 = 0x1.26bb1cp+1f;
+
+int return_nan = isnan(x);
+int return_inf = x > X_MAX;
+int return_zero = x < X_MIN;
+
+int n = convert_int(x * R_64_BY_LOG10_2);
+
+float fn = (float)n;
+int j = n & 0x3f;
+int m = n >> 6;
+int m2 = m << EXPSHIFTBITS_SP32;
+float r;
+
+r = R_LN10 * mad(fn, -R_LOG10_2_BY_64_TL, mad(fn, -R_LOG10_2_BY_64_LD, x));
+
+// Truncated Taylor series for e^r
+float z2 = mad(mad(mad(r, 0x1.56p-5f, 0x1.56p-3f), r, 
0x1.00p-1f), r*r, r);
+
+float two_to_jby64 = USE_TABLE(exp_tbl, j);
+z2 = mad(two_to_jby64, z2, two_to_jby64);
+
+float z2s = z2 * as_float(0x1 << (m + 149));
+

[libclc] r329647 - hypot: Port from amd builtins

2018-04-09 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon Apr  9 17:11:58 2018
New Revision: 329647

URL: http://llvm.org/viewvc/llvm-project?rev=329647=rev
Log:
hypot: Port from amd builtins

v2: Fix whitespace errors

Use only subnormal path.
Passes CTS on carrizo and turks.
Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Added:
libclc/trunk/generic/include/math/clc_hypot.h
libclc/trunk/generic/lib/math/clc_hypot.cl
Removed:
libclc/trunk/generic/lib/math/hypot.inc
Modified:
libclc/trunk/generic/lib/SOURCES
libclc/trunk/generic/lib/math/hypot.cl

Added: libclc/trunk/generic/include/math/clc_hypot.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_hypot.h?rev=329647=auto
==
--- libclc/trunk/generic/include/math/clc_hypot.h (added)
+++ libclc/trunk/generic/include/math/clc_hypot.h Mon Apr  9 17:11:58 2018
@@ -0,0 +1,5 @@
+#define __CLC_FUNCTION __clc_hypot
+#define __CLC_BODY 
+#include 
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=329647=329646=329647=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Mon Apr  9 17:11:58 2018
@@ -120,6 +120,7 @@ math/half_rsqrt.cl
 math/half_sin.cl
 math/half_sqrt.cl
 math/half_tan.cl
+math/clc_hypot.cl
 math/hypot.cl
 math/ilogb.cl
 math/clc_ldexp.cl

Added: libclc/trunk/generic/lib/math/clc_hypot.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_hypot.cl?rev=329647=auto
==
--- libclc/trunk/generic/lib/math/clc_hypot.cl (added)
+++ libclc/trunk/generic/lib/math/clc_hypot.cl Mon Apr  9 17:11:58 2018
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include 
+#include 
+
+#include "config.h"
+#include "math.h"
+#include "../clcmacro.h"
+
+// Returns sqrt(x*x + y*y) with no overflow or underflow unless the result 
warrants it
+_CLC_DEF _CLC_OVERLOAD float __clc_hypot(float x, float y)
+{
+uint ux = as_uint(x);
+uint aux = ux & EXSIGNBIT_SP32;
+uint uy = as_uint(y);
+uint auy = uy & EXSIGNBIT_SP32;
+float retval;
+int c = aux > auy;
+ux = c ? aux : auy;
+uy = c ? auy : aux;
+
+int xexp = clamp((int)(ux >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32, -126, 126);
+float fx_exp = as_float((xexp + EXPBIAS_SP32) << EXPSHIFTBITS_SP32);
+float fi_exp = as_float((-xexp + EXPBIAS_SP32) << EXPSHIFTBITS_SP32);
+float fx = as_float(ux) * fi_exp;
+float fy = as_float(uy) * fi_exp;
+retval = sqrt(mad(fx, fx, fy*fy)) * fx_exp;
+
+retval = ux > PINFBITPATT_SP32 | uy == 0 ? as_float(ux) : retval;
+retval = ux == PINFBITPATT_SP32 | uy == PINFBITPATT_SP32 ? 
as_float(PINFBITPATT_SP32) : retval;
+return retval;
+}
+_CLC_BINARY_VECTORIZE(_CLC_DEF _CLC_OVERLOAD, float, __clc_hypot, float, float)
+
+#ifdef cl_khr_fp64
+_CLC_DEF _CLC_OVERLOAD double __clc_hypot(double x, double y)
+{
+ulong ux = as_ulong(x) & ~SIGNBIT_DP64;
+int xexp = ux >> EXPSHIFTBITS_DP64;
+x = as_double(ux);
+
+ulong uy = as_ulong(y) & ~SIGNBIT_DP64;
+int yexp = uy >> EXPSHIFTBITS_DP64;
+y = as_double(uy);
+
+int c = xexp > EXPBIAS_DP64 + 500 | yexp > EXPBIAS_DP64 + 500;
+double preadjust = c ? 0x1.0p-600 : 1.0;
+double postadjust = c ? 0x1.0p+600 : 1.0;
+
+c = xexp < EXPBIAS_DP64 - 500 | yexp < EXPBIAS_DP64 - 500;
+preadjust = c ? 0x1.0p+600 : preadjust;
+postadjust = c ? 0x1.0p-600 : postadjust;
+
+double ax = x * preadjust;
+double ay = y * preadjust;
+
+// The post adjust may overflow, but this can't be avoided in any case
+

[libclc] r329462 - select: simplify implementation and fix fp16

2018-04-06 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Fri Apr  6 15:00:00 2018
New Revision: 329462

URL: http://llvm.org/viewvc/llvm-project?rev=329462=rev
Log:
select: simplify implementation and fix fp16

Fix half precision implementation
Vector ?: operator should behave exactly as select
Passes CTS on carrizo

Signed-off-by: Jan Vesely 
Reviewer: Jeroen Ketema 

Modified:
libclc/trunk/generic/lib/relational/select.inc

Modified: libclc/trunk/generic/lib/relational/select.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/relational/select.inc?rev=329462=329461=329462=diff
==
--- libclc/trunk/generic/lib/relational/select.inc (original)
+++ libclc/trunk/generic/lib/relational/select.inc Fri Apr  6 15:00:00 2018
@@ -9,39 +9,25 @@
 #define __CLC_S_GENTYPE __CLC_XCONCAT(int, __CLC_VECSIZE)
 #define __CLC_U_GENTYPE __CLC_XCONCAT(uint, __CLC_VECSIZE)
 #elif __CLC_FPSIZE == 16
-#define __CLC_S_GENTYPE __CLC_XCONCAT(char, __CLC_VECSIZE)
-#define __CLC_U_GENTYPE __CLC_XCONCAT(uchar, __CLC_VECSIZE)
-#endif
-#ifdef __CLC_FPSIZE
-#define __CLC_GENSIZE   __CLC_FPSIZE
+#define __CLC_S_GENTYPE __CLC_XCONCAT(short, __CLC_VECSIZE)
+#define __CLC_U_GENTYPE __CLC_XCONCAT(ushort, __CLC_VECSIZE)
 #endif
 
-#define __CLC_AS_S_GENTYPE __CLC_XCONCAT(as_, __CLC_S_GENTYPE)
-#define __CLC_AS_GENTYPE __CLC_XCONCAT(as_, __CLC_GENTYPE)
-
 _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE select(__CLC_GENTYPE x, __CLC_GENTYPE y, 
__CLC_S_GENTYPE z)
 {
-#ifdef __CLC_SCALAR
return z ? y : x;
-#else
-   __CLC_S_GENTYPE bitmask = z >> (__CLC_GENSIZE - 1);
-   return __CLC_AS_GENTYPE(bitselect(__CLC_AS_S_GENTYPE(x), 
__CLC_AS_S_GENTYPE(y), bitmask));
-#endif
 }
 
 _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE select(__CLC_GENTYPE x, __CLC_GENTYPE y, 
__CLC_U_GENTYPE z)
 {
-   return select(x, y, __CLC_AS_S_GENTYPE(z));
+   return z ? y : x;
 }
 
-#undef __CLC_AS_S_GENTYPE
-#undef __CLC_AS_GENTYPE
-
 #ifdef __CLC_FPSIZE
 #undef __CLC_S_GENTYPE
 #undef __CLC_U_GENTYPE
-#undef __CLC_GENSIZE
 #endif
+
 #ifdef __CLC_SCALAR
 #undef __CLC_VECSIZE
 #endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r329433 - fmod: Port from amd_builtins

2018-04-06 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Fri Apr  6 10:43:08 2018
New Revision: 329433

URL: http://llvm.org/viewvc/llvm-project?rev=329433=rev
Log:
fmod: Port from amd_builtins

Uses only denormal path for fp32.
Passes CTS on carrizo and turks.

v2: whitespace fix

Signed-off-by: Jan Vesely 
Reviewer: Aaron Watry 

Added:
libclc/trunk/generic/include/math/clc_fmod.h
libclc/trunk/generic/lib/math/clc_fmod.cl
Removed:
libclc/trunk/generic/include/clc/math/fmod.inc
Modified:
libclc/trunk/generic/include/clc/math/fmod.h
libclc/trunk/generic/lib/SOURCES
libclc/trunk/generic/lib/math/fmod.cl

Modified: libclc/trunk/generic/include/clc/math/fmod.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fmod.h?rev=329433=329432=329433=diff
==
--- libclc/trunk/generic/include/clc/math/fmod.h (original)
+++ libclc/trunk/generic/include/clc/math/fmod.h Fri Apr  6 10:43:08 2018
@@ -1,2 +1,4 @@
-#define __CLC_BODY 
+#define __CLC_FUNCTION fmod
+#define __CLC_BODY 
 #include 
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/fmod.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fmod.inc?rev=329432=auto
==
--- libclc/trunk/generic/include/clc/math/fmod.inc (original)
+++ libclc/trunk/generic/include/clc/math/fmod.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fmod(__CLC_GENTYPE a, __CLC_GENTYPE b);

Added: libclc/trunk/generic/include/math/clc_fmod.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_fmod.h?rev=329433=auto
==
--- libclc/trunk/generic/include/math/clc_fmod.h (added)
+++ libclc/trunk/generic/include/math/clc_fmod.h Fri Apr  6 10:43:08 2018
@@ -0,0 +1,4 @@
+#define __CLC_FUNCTION __clc_fmod
+#define __CLC_BODY 
+#include 
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=329433=329432=329433=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Fri Apr  6 10:43:08 2018
@@ -102,6 +102,7 @@ math/exp10.cl
 math/fdim.cl
 math/fmax.cl
 math/fmin.cl
+math/clc_fmod.cl
 math/fmod.cl
 math/fract.cl
 math/frexp.cl

Added: libclc/trunk/generic/lib/math/clc_fmod.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_fmod.cl?rev=329433=auto
==
--- libclc/trunk/generic/lib/math/clc_fmod.cl (added)
+++ libclc/trunk/generic/lib/math/clc_fmod.cl Fri Apr  6 10:43:08 2018
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include 
+
+#include 
+#include "../clcmacro.h"
+#include "config.h"
+#include "math.h"
+
+_CLC_DEF _CLC_OVERLOAD float __clc_fmod(float x, float y)
+{
+int ux = as_int(x);
+int ax = ux & EXSIGNBIT_SP32;
+float xa = as_float(ax);
+int sx = ux ^ ax;
+int ex = ax >> EXPSHIFTBITS_SP32;
+
+int uy = as_int(y);
+int ay = uy & EXSIGNBIT_SP32;
+float ya = as_float(ay);
+int ey = ay >> EXPSHIFTBITS_SP32;
+
+float xr = as_float(0x3f80 | (ax & 0x007f));
+float yr = as_float(0x3f80 | (ay & 0x007f));
+int c;
+int k = ex - ey;
+
+while (k > 0) {
+c = xr >= yr;
+xr -= c ? yr : 0.0f;
+xr += xr;
+--k;
+}
+
+c = xr >= yr;
+xr -= c ? yr : 0.0f;
+
+int lt = ex < ey;
+
+xr = lt ? xa : xr;
+yr = lt ? ya : yr;
+
+
+float s = as_float(ey << EXPSHIFTBITS_SP32);
+xr *= lt ? 1.0f : s;
+
+c 

[libclc] r329291 - r600: Update datalayout after LLVM r328656

2018-04-05 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Apr  5 07:47:57 2018
New Revision: 329291

URL: http://llvm.org/viewvc/llvm-project?rev=329291=rev
Log:
r600: Update datalayout after LLVM r328656

Signed-off-by: Jan Vesely 
Reviewed-by: Aaron Watry 

Modified:
libclc/trunk/r600/lib/synchronization/barrier_impl.ll
libclc/trunk/r600/lib/workitem/get_global_size.ll
libclc/trunk/r600/lib/workitem/get_local_size.ll
libclc/trunk/r600/lib/workitem/get_num_groups.ll

Modified: libclc/trunk/r600/lib/synchronization/barrier_impl.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/synchronization/barrier_impl.ll?rev=329291=329290=329291=diff
==
--- libclc/trunk/r600/lib/synchronization/barrier_impl.ll (original)
+++ libclc/trunk/r600/lib/synchronization/barrier_impl.ll Thu Apr  5 07:47:57 
2018
@@ -1,6 +1,6 @@
 declare void @llvm.r600.group.barrier() #0
 
-target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define void @barrier(i32 %flags) #1 {
 entry:

Modified: libclc/trunk/r600/lib/workitem/get_global_size.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_global_size.ll?rev=329291=329290=329291=diff
==
--- libclc/trunk/r600/lib/workitem/get_global_size.ll (original)
+++ libclc/trunk/r600/lib/workitem/get_global_size.ll Thu Apr  5 07:47:57 2018
@@ -2,7 +2,7 @@ declare i32 @llvm.r600.read.global.size.
 declare i32 @llvm.r600.read.global.size.y() nounwind readnone
 declare i32 @llvm.r600.read.global.size.z() nounwind readnone
 
-target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i32 @get_global_size(i32 %dim) nounwind readnone alwaysinline {
   switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 
2, label %z_dim]

Modified: libclc/trunk/r600/lib/workitem/get_local_size.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_local_size.ll?rev=329291=329290=329291=diff
==
--- libclc/trunk/r600/lib/workitem/get_local_size.ll (original)
+++ libclc/trunk/r600/lib/workitem/get_local_size.ll Thu Apr  5 07:47:57 2018
@@ -2,7 +2,7 @@ declare i32 @llvm.r600.read.local.size.x
 declare i32 @llvm.r600.read.local.size.y() nounwind readnone
 declare i32 @llvm.r600.read.local.size.z() nounwind readnone
 
-target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i32 @get_local_size(i32 %dim) nounwind readnone alwaysinline {
   switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 
2, label %z_dim]

Modified: libclc/trunk/r600/lib/workitem/get_num_groups.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_num_groups.ll?rev=329291=329290=329291=diff
==
--- libclc/trunk/r600/lib/workitem/get_num_groups.ll (original)
+++ libclc/trunk/r600/lib/workitem/get_num_groups.ll Thu Apr  5 07:47:57 2018
@@ -2,7 +2,7 @@ declare i32 @llvm.r600.read.ngroups.x()
 declare i32 @llvm.r600.read.ngroups.y() nounwind readnone
 declare i32 @llvm.r600.read.ngroups.z() nounwind readnone
 
-target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i32 @get_num_groups(i32 %dim) nounwind readnone alwaysinline {
   switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 
2, label %z_dim]


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r329290 - amdgcn: Update datalayout after LLVM r328656

2018-04-05 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Apr  5 07:47:44 2018
New Revision: 329290

URL: http://llvm.org/viewvc/llvm-project?rev=329290=rev
Log:
amdgcn: Update datalayout after LLVM r328656

Signed-off-by: Jan Vesely 
Reviewed-by: Aaron Watry 

Modified:
libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll
libclc/trunk/amdgcn/lib/workitem/get_global_size.ll
libclc/trunk/amdgcn/lib/workitem/get_local_size.ll
libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll

Modified: 
libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll?rev=329290=329289=329290=diff
==
--- libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll 
(original)
+++ libclc/trunk/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll Thu 
Apr  5 07:47:44 2018
@@ -1,4 +1,4 @@
-target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i64 @__clc__sync_fetch_and_min_global_8(i64 addrspace(1)* nocapture 
%ptr, i64 %value) nounwind alwaysinline {
 entry:

Modified: libclc/trunk/amdgcn/lib/workitem/get_global_size.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_global_size.ll?rev=329290=329289=329290=diff
==
--- libclc/trunk/amdgcn/lib/workitem/get_global_size.ll (original)
+++ libclc/trunk/amdgcn/lib/workitem/get_global_size.ll Thu Apr  5 07:47:44 2018
@@ -2,7 +2,7 @@ declare i32 @llvm.r600.read.global.size.
 declare i32 @llvm.r600.read.global.size.y() nounwind readnone
 declare i32 @llvm.r600.read.global.size.z() nounwind readnone
 
-target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i64 @get_global_size(i32 %dim) nounwind readnone alwaysinline {
   switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 
2, label %z_dim]

Modified: libclc/trunk/amdgcn/lib/workitem/get_local_size.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_local_size.ll?rev=329290=329289=329290=diff
==
--- libclc/trunk/amdgcn/lib/workitem/get_local_size.ll (original)
+++ libclc/trunk/amdgcn/lib/workitem/get_local_size.ll Thu Apr  5 07:47:44 2018
@@ -2,7 +2,7 @@ declare i32 @llvm.r600.read.local.size.x
 declare i32 @llvm.r600.read.local.size.y() nounwind readnone
 declare i32 @llvm.r600.read.local.size.z() nounwind readnone
 
-target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i64 @get_local_size(i32 %dim) nounwind readnone alwaysinline {
   switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 
2, label %z_dim]

Modified: libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll?rev=329290=329289=329290=diff
==
--- libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll (original)
+++ libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll Thu Apr  5 07:47:44 2018
@@ -2,7 +2,7 @@ declare i32 @llvm.r600.read.ngroups.x()
 declare i32 @llvm.r600.read.ngroups.y() nounwind readnone
 declare i32 @llvm.r600.read.ngroups.z() nounwind readnone
 
-target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5"
+target datalayout = 
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
 
 define i64 @get_num_groups(i32 %dim) nounwind readnone alwaysinline {
   switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 
2, label %z_dim]



[libclc] r327818 - remainder: Port from amd builtins

2018-03-18 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Sun Mar 18 18:01:10 2018
New Revision: 327818

URL: http://llvm.org/viewvc/llvm-project?rev=327818=rev
Log:
remainder: Port from amd builtins

Mostly ported from amd_builtins, uses only denormal path for fp32.
Passes CTS on carrizo and turks

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/clc/math/remainder.h
libclc/trunk/generic/include/math/clc_remainder.h
libclc/trunk/generic/lib/math/clc_remainder.cl
libclc/trunk/generic/lib/math/remainder.cl
Modified:
libclc/trunk/generic/include/clc/clc.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/clc.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=327818=327817=327818=diff
==
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Sun Mar 18 18:01:10 2018
@@ -103,6 +103,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Added: libclc/trunk/generic/include/clc/math/remainder.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/remainder.h?rev=327818=auto
==
--- libclc/trunk/generic/include/clc/math/remainder.h (added)
+++ libclc/trunk/generic/include/clc/math/remainder.h Sun Mar 18 18:01:10 2018
@@ -0,0 +1,4 @@
+#define __CLC_FUNCTION remainder
+#define __CLC_BODY 
+#include 
+#undef __CLC_FUNCTION

Added: libclc/trunk/generic/include/math/clc_remainder.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/math/clc_remainder.h?rev=327818=auto
==
--- libclc/trunk/generic/include/math/clc_remainder.h (added)
+++ libclc/trunk/generic/include/math/clc_remainder.h Sun Mar 18 18:01:10 2018
@@ -0,0 +1,4 @@
+#define __CLC_FUNCTION __clc_remainder
+#define __CLC_BODY 
+#include 
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=327818=327817=327818=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Sun Mar 18 18:01:10 2018
@@ -158,6 +158,8 @@ math/clc_pown.cl
 math/pown.cl
 math/clc_powr.cl
 math/powr.cl
+math/clc_remainder.cl
+math/remainder.cl
 math/clc_rootn.cl
 math/rootn.cl
 math/sin.cl

Added: libclc/trunk/generic/lib/math/clc_remainder.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/clc_remainder.cl?rev=327818=auto
==
--- libclc/trunk/generic/lib/math/clc_remainder.cl (added)
+++ libclc/trunk/generic/lib/math/clc_remainder.cl Sun Mar 18 18:01:10 2018
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include 
+
+#include 
+#include "../clcmacro.h"
+#include "config.h"
+#include "math.h"
+
+_CLC_DEF _CLC_OVERLOAD float __clc_remainder(float x, float y)
+{
+int ux = as_int(x);
+int ax = ux & EXSIGNBIT_SP32;
+float xa = as_float(ax);
+int sx = ux ^ ax;
+int ex = ax >> EXPSHIFTBITS_SP32;
+
+int uy = as_int(y);
+int ay = uy & EXSIGNBIT_SP32;
+float ya = as_float(ay);
+int ey = ay >> EXPSHIFTBITS_SP32;
+
+float xr = as_float(0x3f80 | (ax & 0x007f));
+float yr = as_float(0x3f80 | (ay & 0x007f));
+int c;
+int k = ex - ey;
+
+uint q = 0;
+
+while (k > 0) {
+c = xr >= yr;
+q = (q << 1) | c;
+xr -= c ? yr : 0.0f;
+xr += xr;
+   --k;
+}
+
+c = xr > yr;
+q = (q << 1) | c;
+xr -= c ? yr : 0.0f;
+
+

[libclc] r327324 - nan: Implement

2018-03-12 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon Mar 12 12:46:52 2018
New Revision: 327324

URL: http://llvm.org/viewvc/llvm-project?rev=327324=rev
Log:
nan: Implement

Passes CTS on carrizo and turks

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/clc/math/nan.h
libclc/trunk/generic/include/clc/math/nan.inc
libclc/trunk/generic/lib/math/nan.cl
libclc/trunk/generic/lib/math/nan.inc
Modified:
libclc/trunk/generic/include/clc/clc.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/clc.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=327324=327323=327324=diff
==
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Mon Mar 12 12:46:52 2018
@@ -98,6 +98,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Added: libclc/trunk/generic/include/clc/math/nan.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/nan.h?rev=327324=auto
==
--- libclc/trunk/generic/include/clc/math/nan.h (added)
+++ libclc/trunk/generic/include/clc/math/nan.h Mon Mar 12 12:46:52 2018
@@ -0,0 +1,8 @@
+#define __CLC_CONCAT(x, y) x ## y
+#define __CLC_XCONCAT(x, y) __CLC_CONCAT(x, y)
+
+#define __CLC_BODY 
+#include 
+
+#undef __CLC_XCONCAT
+#undef __CLC_CONCAT

Added: libclc/trunk/generic/include/clc/math/nan.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/nan.inc?rev=327324=auto
==
--- libclc/trunk/generic/include/clc/math/nan.inc (added)
+++ libclc/trunk/generic/include/clc/math/nan.inc Mon Mar 12 12:46:52 2018
@@ -0,0 +1,16 @@
+#ifdef __CLC_SCALAR
+#define __CLC_VECSIZE
+#endif
+
+#if __CLC_FPSIZE == 64
+#define __CLC_NATN __CLC_XCONCAT(ulong, __CLC_VECSIZE)
+#else
+#define __CLC_NATN __CLC_XCONCAT(uint, __CLC_VECSIZE)
+#endif
+
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE nan(__CLC_NATN code);
+
+#undef __CLC_NATN
+#ifdef __CLC_SCALAR
+#undef __CLC_VECSIZE
+#endif

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=327324=327323=327324=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Mon Mar 12 12:46:52 2018
@@ -134,6 +134,7 @@ math/mad.cl
 math/maxmag.cl
 math/minmag.cl
 math/modf.cl
+math/nan.cl
 math/native_cos.cl
 math/native_divide.cl
 math/native_exp.cl

Added: libclc/trunk/generic/lib/math/nan.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/nan.cl?rev=327324=auto
==
--- libclc/trunk/generic/lib/math/nan.cl (added)
+++ libclc/trunk/generic/lib/math/nan.cl Mon Mar 12 12:46:52 2018
@@ -0,0 +1,6 @@
+#include 
+#include "utils.h"
+
+#define __CLC_AS_GENTYPE __CLC_XCONCAT(as_, __CLC_GENTYPE)
+#define __CLC_BODY 
+#include 

Added: libclc/trunk/generic/lib/math/nan.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/nan.inc?rev=327324=auto
==
--- libclc/trunk/generic/lib/math/nan.inc (added)
+++ libclc/trunk/generic/lib/math/nan.inc Mon Mar 12 12:46:52 2018
@@ -0,0 +1,20 @@
+#ifdef __CLC_SCALAR
+#define __CLC_VECSIZE
+#endif
+
+#if __CLC_FPSIZE == 64
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE nan(__CLC_XCONCAT(ulong, __CLC_VECSIZE) 
code)
+{
+   return __CLC_AS_GENTYPE(code | 0x7ff0ul);
+}
+#else
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE nan(__CLC_XCONCAT(uint, __CLC_VECSIZE) 
code)
+{
+   return __CLC_AS_GENTYPE(code | 0x7fc0);
+}
+#endif
+
+
+#ifdef __CLC_SCALAR
+#undef __CLC_VECSIZE
+#endif


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r327323 - travis: Add build using llvm-6

2018-03-12 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Mon Mar 12 12:46:48 2018
New Revision: 327323

URL: http://llvm.org/viewvc/llvm-project?rev=327323=rev
Log:
travis: Add build using llvm-6

Acked-by: Aaron Watry 
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/.travis.yml

Modified: libclc/trunk/.travis.yml
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/.travis.yml?rev=327323=327322=327323=diff
==
--- libclc/trunk/.travis.yml (original)
+++ libclc/trunk/.travis.yml Mon Mar 12 12:46:48 2018
@@ -54,6 +54,28 @@ matrix:
 # From sources above
 - llvm-5.0-dev
 - clang-5.0
+- env:
+- LABEL="make gcc LLVM-6.0"
+- LLVM_VERSION=6.0
+- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+- CHECK_FILES="barts-r600--.bc cayman-r600--.bc cedar-r600--.bc 
cypress-r600--.bc tahiti-amdgcn--.bc amdgcn--amdhsa.bc nvptx--nvidiacl.bc 
nvptx64--nvidiacl.bc"
+# llvm passes -Werror=date-time which is only supported in gcc-4.9+
+- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+  addons:
+apt:
+  sources:
+- sourceline: 'deb http://apt.llvm.org/trusty/ 
llvm-toolchain-trusty-6.0 main'
+- ubuntu-toolchain-r-test
+  packages:
+- libedit-dev
+# LLVM-6 needs libstdc++4.9
+- g++-4.9
+# From sources above
+- llvm-6.0-dev
+- clang-6.0
+
+before_install:
+- eval "${MATRIX_EVAL}"
 
 script:
   - $PYTHON ./configure.py --with-llvm-config=$LLVM_CONFIG 
--with-cxx-compiler=$CXX && make -j4


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r327076 - amdgcn/fmax: fcanonicalize operands

2018-03-08 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Mar  8 15:01:01 2018
New Revision: 327076

URL: http://llvm.org/viewvc/llvm-project?rev=327076=rev
Log:
amdgcn/fmax: fcanonicalize operands

v_max instruction needs canonicalized operands.
Passes CTS on carrizo

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/amdgcn/lib/math/fmax.cl
Modified:
libclc/trunk/amdgcn/lib/SOURCES

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=327076=327075=327076=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Thu Mar  8 15:01:01 2018
@@ -1,5 +1,6 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
 integer/popcount.cl
+math/fmax.cl
 math/fmin.cl
 math/ldexp.cl
 mem_fence/fence.cl

Added: libclc/trunk/amdgcn/lib/math/fmax.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/math/fmax.cl?rev=327076=auto
==
--- libclc/trunk/amdgcn/lib/math/fmax.cl (added)
+++ libclc/trunk/amdgcn/lib/math/fmax.cl Thu Mar  8 15:01:01 2018
@@ -0,0 +1,31 @@
+#include 
+
+#include "../../../generic/lib/clcmacro.h"
+
+_CLC_DEF _CLC_OVERLOAD float fmax(float x, float y)
+{
+   /* fcanonicalize removes sNaNs and flushes denormals if not enabled.
+* Otherwise fmax instruction flushes the values for comparison,
+* but outputs original denormal */
+   x = __builtin_canonicalizef(x);
+   y = __builtin_canonicalizef(y);
+   return __builtin_fmaxf(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, fmax, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_DEF _CLC_OVERLOAD double fmax(double x, double y)
+{
+   x = __builtin_canonicalize(x);
+   y = __builtin_canonicalize(y);
+   return __builtin_fmax(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmax, double, double)
+
+#endif
+
+#define __CLC_BODY <../../../generic/lib/math/fmax.inc>
+#include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r327075 - amdgcn/fmin: fcanonicalize operands

2018-03-08 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Mar  8 15:00:58 2018
New Revision: 327075

URL: http://llvm.org/viewvc/llvm-project?rev=327075=rev
Log:
amdgcn/fmin: fcanonicalize operands

v_min instruction needs canonicalized operands.
Passes CTS on carrizo

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/amdgcn/lib/math/fmin.cl
Modified:
libclc/trunk/amdgcn/lib/SOURCES

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=327075=327074=327075=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Thu Mar  8 15:00:58 2018
@@ -1,5 +1,6 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
 integer/popcount.cl
+math/fmin.cl
 math/ldexp.cl
 mem_fence/fence.cl
 synchronization/barrier.cl

Added: libclc/trunk/amdgcn/lib/math/fmin.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/math/fmin.cl?rev=327075=auto
==
--- libclc/trunk/amdgcn/lib/math/fmin.cl (added)
+++ libclc/trunk/amdgcn/lib/math/fmin.cl Thu Mar  8 15:00:58 2018
@@ -0,0 +1,31 @@
+#include 
+
+#include "../../../generic/lib/clcmacro.h"
+
+_CLC_DEF _CLC_OVERLOAD float fmin(float x, float y)
+{
+   /* fcanonicalize removes sNaNs and flushes denormals if not enabled.
+* Otherwise fmin instruction flushes the values for comparison,
+* but outputs original denormal */
+   x = __builtin_canonicalizef(x);
+   y = __builtin_canonicalizef(y);
+   return __builtin_fminf(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, fmin, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_DEF _CLC_OVERLOAD double fmin(double x, double y)
+{
+   x = __builtin_canonicalizef(x);
+   y = __builtin_canonicalizef(y);
+   return __builtin_fminf(x, y);
+}
+_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, fmin, double, double)
+
+#endif
+
+#define __CLC_BODY <../../../generic/lib/math/fmin.inc>
+#include 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r327044 - amdgcn, popcount: Workaround broken llvm.ctpop intrinsic on some GCN ASICs

2018-03-08 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Mar  8 10:58:07 2018
New Revision: 327044

URL: http://llvm.org/viewvc/llvm-project?rev=327044=rev
Log:
amdgcn,popcount: Workaround broken llvm.ctpop intrinsic on some GCN ASICs

This is only really needed for VI+ ASICs. However, llvm would cast the value to
i32 for older asics anyway. The proper fix is in LLVM-7 (r326535).
Fixes CTS popcount on carrizo.

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/amdgcn/lib/integer/
libclc/trunk/amdgcn/lib/integer/popcount.cl
libclc/trunk/amdgcn/lib/integer/popcount.inc
Modified:
libclc/trunk/amdgcn/lib/SOURCES

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=327044=327043=327044=diff
==
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Thu Mar  8 10:58:07 2018
@@ -1,4 +1,5 @@
 cl_khr_int64_extended_atomics/minmax_helpers.ll
+integer/popcount.cl
 math/ldexp.cl
 mem_fence/fence.cl
 synchronization/barrier.cl

Added: libclc/trunk/amdgcn/lib/integer/popcount.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/integer/popcount.cl?rev=327044=auto
==
--- libclc/trunk/amdgcn/lib/integer/popcount.cl (added)
+++ libclc/trunk/amdgcn/lib/integer/popcount.cl Thu Mar  8 10:58:07 2018
@@ -0,0 +1,6 @@
+#include 
+#include 
+#include 
+
+#define __CLC_BODY "popcount.inc"
+#include 

Added: libclc/trunk/amdgcn/lib/integer/popcount.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/integer/popcount.inc?rev=327044=auto
==
--- libclc/trunk/amdgcn/lib/integer/popcount.inc (added)
+++ libclc/trunk/amdgcn/lib/integer/popcount.inc Thu Mar  8 10:58:07 2018
@@ -0,0 +1,17 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE popcount(__CLC_GENTYPE x) {
+/* LLVM-4+ implements i16 ops for VI+ ASICs. However, ctpop implementation
+ * is missing until r326535. Therefore we have to convert sub i32 types to uint
+ * as a workaround. */
+#if __clang_major__ < 7 && __clang_major__ > 3 && __CLC_GENSIZE < 32
+   /* Prevent sign extension on uint conversion */
+   const __CLC_U_GENTYPE y = __CLC_XCONCAT(as_, __CLC_U_GENTYPE)(x);
+   /* Convert to uintX */
+   const __CLC_XCONCAT(uint, __CLC_VECSIZE) z = 
__CLC_XCONCAT(convert_uint, __CLC_VECSIZE)(y);
+   /* Call popcount on uintX type */
+   const __CLC_XCONCAT(uint, __CLC_VECSIZE) res = __clc_native_popcount(z);
+   /* Convert the result back to gentype. */
+   return __CLC_XCONCAT(convert_, __CLC_GENTYPE)(res);
+#else
+   return __clc_native_popcount(x);
+#endif
+}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] r327043 - integer/gentype: Add __CLC_VECSIZE macro

2018-03-08 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Mar  8 10:58:05 2018
New Revision: 327043

URL: http://llvm.org/viewvc/llvm-project?rev=327043=rev
Log:
integer/gentype: Add __CLC_VECSIZE macro

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Modified:
libclc/trunk/generic/include/clc/integer/gentype.inc

Modified: libclc/trunk/generic/include/clc/integer/gentype.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/integer/gentype.inc?rev=327043=327042=327043=diff
==
--- libclc/trunk/generic/include/clc/integer/gentype.inc (original)
+++ libclc/trunk/generic/include/clc/integer/gentype.inc Thu Mar  8 10:58:05 
2018
@@ -7,7 +7,9 @@
 #define __CLC_U_GENTYPE uchar
 #define __CLC_S_GENTYPE char
 #define __CLC_SCALAR 1
+#define __CLC_VECSIZE
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_SCALAR
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
@@ -16,7 +18,9 @@
 #define __CLC_GENTYPE char2
 #define __CLC_U_GENTYPE uchar2
 #define __CLC_S_GENTYPE char2
+#define __CLC_VECSIZE 2
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -24,7 +28,9 @@
 #define __CLC_GENTYPE char3
 #define __CLC_U_GENTYPE uchar3
 #define __CLC_S_GENTYPE char3
+#define __CLC_VECSIZE 3
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -32,7 +38,9 @@
 #define __CLC_GENTYPE char4
 #define __CLC_U_GENTYPE uchar4
 #define __CLC_S_GENTYPE char4
+#define __CLC_VECSIZE 4
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -40,7 +48,9 @@
 #define __CLC_GENTYPE char8
 #define __CLC_U_GENTYPE uchar8
 #define __CLC_S_GENTYPE char8
+#define __CLC_VECSIZE 8
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -48,7 +58,9 @@
 #define __CLC_GENTYPE char16
 #define __CLC_U_GENTYPE uchar16
 #define __CLC_S_GENTYPE char16
+#define __CLC_VECSIZE 16
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -60,7 +72,9 @@
 #define __CLC_U_GENTYPE uchar
 #define __CLC_S_GENTYPE char
 #define __CLC_SCALAR 1
+#define __CLC_VECSIZE
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_SCALAR
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
@@ -69,7 +83,9 @@
 #define __CLC_GENTYPE uchar2
 #define __CLC_U_GENTYPE uchar2
 #define __CLC_S_GENTYPE char2
+#define __CLC_VECSIZE 2
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -77,7 +93,9 @@
 #define __CLC_GENTYPE uchar3
 #define __CLC_U_GENTYPE uchar3
 #define __CLC_S_GENTYPE char3
+#define __CLC_VECSIZE 3
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -85,7 +103,9 @@
 #define __CLC_GENTYPE uchar4
 #define __CLC_U_GENTYPE uchar4
 #define __CLC_S_GENTYPE char4
+#define __CLC_VECSIZE 4
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -93,7 +113,9 @@
 #define __CLC_GENTYPE uchar8
 #define __CLC_U_GENTYPE uchar8
 #define __CLC_S_GENTYPE char8
+#define __CLC_VECSIZE 8
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -101,7 +123,9 @@
 #define __CLC_GENTYPE uchar16
 #define __CLC_U_GENTYPE uchar16
 #define __CLC_S_GENTYPE char16
+#define __CLC_VECSIZE 16
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -115,7 +139,9 @@
 #define __CLC_U_GENTYPE ushort
 #define __CLC_S_GENTYPE short
 #define __CLC_SCALAR 1
+#define __CLC_VECSIZE
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_SCALAR
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
@@ -124,7 +150,9 @@
 #define __CLC_GENTYPE short2
 #define __CLC_U_GENTYPE ushort2
 #define __CLC_S_GENTYPE short2
+#define __CLC_VECSIZE 2
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -132,7 +160,9 @@
 #define __CLC_GENTYPE short3
 #define __CLC_U_GENTYPE ushort3
 #define __CLC_S_GENTYPE short3
+#define __CLC_VECSIZE 3
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -140,7 +170,9 @@
 #define __CLC_GENTYPE short4
 #define __CLC_U_GENTYPE ushort4
 #define __CLC_S_GENTYPE short4
+#define __CLC_VECSIZE 4
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -148,7 +180,9 @@
 #define __CLC_GENTYPE short8
 #define __CLC_U_GENTYPE ushort8
 #define __CLC_S_GENTYPE short8
+#define __CLC_VECSIZE 8
 #include __CLC_BODY
+#undef __CLC_VECSIZE
 #undef __CLC_GENTYPE
 #undef __CLC_U_GENTYPE
 #undef __CLC_S_GENTYPE
@@ -156,7 +190,9 @@
 #define 

[libclc] r327042 - popcount: Provide function implementation rather than intrinsic redirect

2018-03-08 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Mar  8 10:58:00 2018
New Revision: 327042

URL: http://llvm.org/viewvc/llvm-project?rev=327042=rev
Log:
popcount: Provide function implementation rather than intrinsic redirect

amdgcn will need to override this

Reviewer: Aaron Watry 
Signed-off-by: Jan Vesely 

Added:
libclc/trunk/generic/include/clc/integer/unary.inc
libclc/trunk/generic/include/integer/
libclc/trunk/generic/include/integer/popcount.h
libclc/trunk/generic/include/integer/unary_intrin.inc
  - copied, changed from r326821, 
libclc/trunk/generic/include/clc/integer/unary_intrin.inc
libclc/trunk/generic/lib/clc_unary.inc
libclc/trunk/generic/lib/integer/popcount.cl
Removed:
libclc/trunk/generic/include/clc/integer/unary_intrin.inc
Modified:
libclc/trunk/generic/include/clc/integer/popcount.h
libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/integer/popcount.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/integer/popcount.h?rev=327042=327041=327042=diff
==
--- libclc/trunk/generic/include/clc/integer/popcount.h (original)
+++ libclc/trunk/generic/include/clc/integer/popcount.h Thu Mar  8 10:58:00 2018
@@ -1,6 +1,5 @@
-#undef popcount
-#define popcount __clc_popcount
-
-#define __CLC_FUNCTION __clc_popcount
-#define __CLC_INTRINSIC "llvm.ctpop"
-#include 
+#define __CLC_FUNCTION popcount
+#define __CLC_BODY 
+#include 
+#undef __CLC_FUNCTION
+#undef __CLC_BODY

Added: libclc/trunk/generic/include/clc/integer/unary.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/integer/unary.inc?rev=327042=auto
==
--- libclc/trunk/generic/include/clc/integer/unary.inc (added)
+++ libclc/trunk/generic/include/clc/integer/unary.inc Thu Mar  8 10:58:00 2018
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x);

Removed: libclc/trunk/generic/include/clc/integer/unary_intrin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/integer/unary_intrin.inc?rev=327041=auto
==
--- libclc/trunk/generic/include/clc/integer/unary_intrin.inc (original)
+++ libclc/trunk/generic/include/clc/integer/unary_intrin.inc (removed)
@@ -1,20 +0,0 @@
-#define __CLC_INTRINSIC_DEF(SCALAR_TYPE, BIT_SIZE) \
-_CLC_OVERLOAD SCALAR_TYPE __CLC_FUNCTION(SCALAR_TYPE x) __asm(__CLC_INTRINSIC 
".i" BIT_SIZE); \
-_CLC_OVERLOAD SCALAR_TYPE##2 __CLC_FUNCTION(SCALAR_TYPE##2 x) 
__asm(__CLC_INTRINSIC ".v2i" BIT_SIZE); \
-_CLC_OVERLOAD SCALAR_TYPE##3 __CLC_FUNCTION(SCALAR_TYPE##3 x) 
__asm(__CLC_INTRINSIC ".v3i" BIT_SIZE); \
-_CLC_OVERLOAD SCALAR_TYPE##4 __CLC_FUNCTION(SCALAR_TYPE##4 x) 
__asm(__CLC_INTRINSIC ".v4i" BIT_SIZE); \
-_CLC_OVERLOAD SCALAR_TYPE##8 __CLC_FUNCTION(SCALAR_TYPE##8 x) 
__asm(__CLC_INTRINSIC ".v8i" BIT_SIZE); \
-_CLC_OVERLOAD SCALAR_TYPE##16 __CLC_FUNCTION(SCALAR_TYPE##16 x) 
__asm(__CLC_INTRINSIC ".v16i" BIT_SIZE);
-
-__CLC_INTRINSIC_DEF(char, "8")
-__CLC_INTRINSIC_DEF(uchar, "8")
-__CLC_INTRINSIC_DEF(short, "16")
-__CLC_INTRINSIC_DEF(ushort, "16")
-__CLC_INTRINSIC_DEF(int, "32")
-__CLC_INTRINSIC_DEF(uint, "32")
-__CLC_INTRINSIC_DEF(long, "64")
-__CLC_INTRINSIC_DEF(ulong, "64")
-
-#undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC
-#undef __CLC_INTRINSIC_DEF

Added: libclc/trunk/generic/include/integer/popcount.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/integer/popcount.h?rev=327042=auto
==
--- libclc/trunk/generic/include/integer/popcount.h (added)
+++ libclc/trunk/generic/include/integer/popcount.h Thu Mar  8 10:58:00 2018
@@ -0,0 +1,3 @@
+#define __CLC_FUNCTION __clc_native_popcount
+#define __CLC_INTRINSIC "llvm.ctpop"
+#include 

Copied: libclc/trunk/generic/include/integer/unary_intrin.inc (from r326821, 
libclc/trunk/generic/include/clc/integer/unary_intrin.inc)
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/integer/unary_intrin.inc?p2=libclc/trunk/generic/include/integer/unary_intrin.inc=libclc/trunk/generic/include/clc/integer/unary_intrin.inc=326821=327042=327042=diff
==
(empty)

Modified: libclc/trunk/generic/lib/SOURCES
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=327042=327041=327042=diff
==
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Thu Mar  8 10:58:00 2018
@@ -70,6 +70,7 @@ integer/mad24.cl
 integer/mad_sat.cl
 integer/mul24.cl
 integer/mul_hi.cl
+integer/popcount.cl
 integer/rhadd.cl
 integer/rotate.cl
 integer/sub_sat.cl

Added: 

  1   2   3   4   >