Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ set( LIBCLC_MIN_LLVM 3.9.0 )
set( LIBCLC_TARGETS_TO_BUILD "all"
CACHE STRING "Semicolon-separated list of libclc targets to build, or 'all'." )

option( ENABLE_RUNTIME_SUBNORMAL "Enable runtime linking of subnormal support." OFF )

option(
LIBCLC_USE_SPIRV_BACKEND "Build SPIR-V targets with the SPIR-V backend." OFF
)
Expand Down Expand Up @@ -231,19 +229,6 @@ set( tahiti_aliases pitcairn verde oland hainan bonaire kabini kaveri hawaii
configure_file( libclc.pc.in libclc.pc @ONLY )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" )

if( ENABLE_RUNTIME_SUBNORMAL )
foreach( file IN ITEMS subnormal_use_default subnormal_disable )
link_bc(
TARGET ${file}
INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/${file}.ll
)
install(
FILES $<TARGET_PROPERTY:${file},TARGET_FILE>
DESTINATION "${CMAKE_INSTALL_DATADIR}/clc"
)
endforeach()
endif()

find_package( Python3 REQUIRED COMPONENTS Interpreter )
file( TO_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/utils/gen_convert.py script_loc )
add_custom_command(
Expand Down Expand Up @@ -371,9 +356,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
list( APPEND opencl_gen_files clspv-convert.cl )
else()
list( APPEND opencl_gen_files convert.cl )
if ( NOT ENABLE_RUNTIME_SUBNORMAL )
list( APPEND opencl_lib_files opencl/lib/generic/subnormal_use_default.ll )
endif()
endif()
endif()

Expand Down Expand Up @@ -430,6 +412,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
# Error on undefined macros
-Werror=undef
-fdiscard-value-names
-fdenormal-fp-math=dynamic
)

if( NOT "${cpu}" STREQUAL "" )
Expand Down
19 changes: 0 additions & 19 deletions libclc/clc/include/clc/internal/math/clc_sw_fma.h

This file was deleted.

1 change: 0 additions & 1 deletion libclc/clc/include/clc/math/clc_subnormal_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <clc/clcfunc.h>

_CLC_DECL bool __clc_subnormals_disabled();
_CLC_DECL bool __clc_fp16_subnormals_supported();
_CLC_DECL bool __clc_fp32_subnormals_supported();
_CLC_DECL bool __clc_fp64_subnormals_supported();
Expand Down
24 changes: 6 additions & 18 deletions libclc/clc/include/clc/math/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <clc/clc_as_type.h>
#include <clc/clcfunc.h>
#include <clc/math/clc_subnormal_config.h>

#define SNAN 0x001
#define QNAN 0x002
Expand All @@ -24,15 +23,6 @@
#define PNOR 0x100
#define PINF 0x200

#if (defined __AMDGCN__ || defined __R600__) && !defined __HAS_FMAF__
#define __CLC_HAVE_HW_FMA32() (0)
#elif defined(CLC_SPIRV)
bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);
#define __CLC_HAVE_HW_FMA32() __clc_runtime_has_hw_fma32()
#else
#define __CLC_HAVE_HW_FMA32() (1)
#endif

#define HAVE_BITALIGN() (0)
#define HAVE_FAST_FMA32() (0)

Expand Down Expand Up @@ -65,14 +55,12 @@ bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);

#define LOG_MAGIC_NUM_SP32 (1 + NUMEXPBITS_SP32 - EXPBIAS_SP32)

_CLC_OVERLOAD _CLC_INLINE float __clc_flush_denormal_if_not_supported(float x) {
int ix = __clc_as_int(x);
if (!__clc_fp32_subnormals_supported() && ((ix & EXPBITS_SP32) == 0) &&
((ix & MANTBITS_SP32) != 0)) {
ix &= SIGNBIT_SP32;
x = __clc_as_float(ix);
}
return x;
_CLC_OVERLOAD _CLC_INLINE float __clc_soft_flush_denormal(float x) {
// Avoid calling __clc_fp32_subnormals_supported here: it uses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might have less trouble just using canonicalize for now and trying to relax it later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might have less trouble just using canonicalize for now and trying to relax it later

do you mean reverting __clc_soft_flush_denormal to use __clc_fp32_subnormals_supported which uses llvm.canonicalize, or just replacing use of __clc_fp32_subnormals_supported with __builtin_elementwise_canonicalize?

// llvm.canonicalize, which quiets sNaN.
return __builtin_elementwise_abs(x) < 0x1p-149f
? __builtin_elementwise_copysign(0.0f, x)
: x;
}

#ifdef cl_khr_fp64
Expand Down
1 change: 0 additions & 1 deletion libclc/clc/lib/clspv/SOURCES
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
math/clc_sw_fma.cl
integer/clc_mul_hi.cl
274 changes: 0 additions & 274 deletions libclc/clc/lib/clspv/math/clc_sw_fma.cl

This file was deleted.

Loading
Loading