File tree Expand file tree Collapse file tree 16 files changed +141
-12
lines changed Expand file tree Collapse file tree 16 files changed +141
-12
lines changed Original file line number Diff line number Diff line change @@ -266,20 +266,22 @@ set_source_files_properties(
266266 # CLC builtins
267267 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_cos.cl
268268 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_divide.cl
269+ ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_exp10.cl
269270 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_exp2.cl
270271 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_exp.cl
271272 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_log10.cl
272273 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_log2.cl
273274 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_log.cl
275+ ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_powr.cl
274276 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_recip.cl
275277 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_rsqrt.cl
276278 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_sin.cl
277279 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_sqrt.cl
280+ ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_tan.cl
278281 # Target-specific CLC builtins
279282 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/amdgpu/math/clc_native_exp2.cl
280283 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/amdgpu/math/clc_native_exp.cl
281284 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/amdgpu/math/clc_native_log10.cl
282- # Target-specific OpenCL builtins
283285 ${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/r600/math/clc_native_rsqrt.cl
284286 # OpenCL builtins
285287 ${CMAKE_CURRENT_SOURCE_DIR} /generic/lib/math/native_cos.cl
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+
9+ #ifndef __CLC_MATH_CLC_NATIVE_EXP10_H__
10+ #define __CLC_MATH_CLC_NATIVE_EXP10_H__
11+
12+ #define __FLOAT_ONLY
13+ #define __CLC_FUNCTION __clc_native_exp10
14+ #define __CLC_BODY <clc/shared/unary_decl.inc>
15+
16+ #include <clc/math/gentype.inc>
17+
18+ #undef __CLC_BODY
19+ #undef __CLC_FUNCTION
20+ #undef __FLOAT_ONLY
21+
22+ #endif // __CLC_MATH_CLC_NATIVE_EXP10_H__
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+
9+ #ifndef __CLC_MATH_CLC_NATIVE_POWR_H__
10+ #define __CLC_MATH_CLC_NATIVE_POWR_H__
11+
12+ #define __FLOAT_ONLY
13+ #define __CLC_FUNCTION __clc_native_powr
14+ #define __CLC_BODY <clc/shared/binary_decl.inc>
15+
16+ #include <clc/math/gentype.inc>
17+
18+ #undef __CLC_BODY
19+ #undef __CLC_FUNCTION
20+ #undef __FLOAT_ONLY
21+
22+ #endif // __CLC_MATH_CLC_NATIVE_POWR_H__
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+
9+ #ifndef __CLC_MATH_CLC_NATIVE_TAN_H__
10+ #define __CLC_MATH_CLC_NATIVE_TAN_H__
11+
12+ #define __FLOAT_ONLY
13+ #define __CLC_FUNCTION __clc_native_tan
14+ #define __CLC_BODY <clc/shared/unary_decl.inc>
15+
16+ #include <clc/math/gentype.inc>
17+
18+ #undef __CLC_BODY
19+ #undef __CLC_FUNCTION
20+ #undef __FLOAT_ONLY
21+
22+ #endif // __CLC_MATH_CLC_NATIVE_TAN_H__
Original file line number Diff line number Diff line change @@ -58,14 +58,17 @@ math/clc_nan.cl
5858math/clc_native_cos.cl
5959math/clc_native_divide.cl
6060math/clc_native_exp.cl
61+ math/clc_native_exp10.cl
6162math/clc_native_exp2.cl
6263math/clc_native_log.cl
6364math/clc_native_log10.cl
6465math/clc_native_log2.cl
66+ math/clc_native_powr.cl
6567math/clc_native_rsqrt.cl
6668math/clc_native_recip.cl
6769math/clc_native_sin.cl
6870math/clc_native_sqrt.cl
71+ math/clc_native_tan.cl
6972math/clc_nextafter.cl
7073math/clc_pow.cl
7174math/clc_pown.cl
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+
9+ #include <clc/float/definitions.h>
10+ #include <clc/internal/clc.h>
11+ #include <clc/math/clc_native_exp2.h>
12+
13+ #define __FLOAT_ONLY
14+ #define __CLC_BODY <clc_native_exp10.inc>
15+
16+ #include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_exp10 (__CLC_GENTYPE val) {
10- return native_exp2 (val * M_LOG210_F);
9+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_native_exp10 (__CLC_GENTYPE val) {
10+ return __clc_native_exp2 (val * M_LOG210_F);
1111}
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+
9+ #include <clc/internal/clc.h>
10+ #include <clc/math/clc_native_exp2.h>
11+ #include <clc/math/clc_native_log2.h>
12+
13+ #define __FLOAT_ONLY
14+ #define __CLC_BODY <clc_native_powr.inc>
15+
16+ #include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_powr (__CLC_GENTYPE x, __CLC_GENTYPE y) {
9+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_native_powr (__CLC_GENTYPE x,
10+ __CLC_GENTYPE y) {
1011 // x^y == 2^{log2 x^y} == 2^{y * log2 x}
1112 // for x < 0 propagate nan created by log2
12- return native_exp2 (y * native_log2 (x));
13+ return __clc_native_exp2 (y * __clc_native_log2 (x));
1314}
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+
9+ #include <clc/internal/clc.h>
10+ #include <clc/math/clc_native_cos.h>
11+ #include <clc/math/clc_native_sin.h>
12+
13+ #define __FLOAT_ONLY
14+ #define __CLC_BODY <clc_native_tan.inc>
15+
16+ #include <clc/math/gentype.inc>
You can’t perform that action at this time.
0 commit comments