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(
266
266
# CLC builtins
267
267
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_cos.cl
268
268
${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
269
270
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_exp2.cl
270
271
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_exp.cl
271
272
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_log10.cl
272
273
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_log2.cl
273
274
${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
274
276
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_recip.cl
275
277
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_rsqrt.cl
276
278
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/generic/math/clc_native_sin.cl
277
279
${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
278
281
# Target-specific CLC builtins
279
282
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/amdgpu/math/clc_native_exp2.cl
280
283
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/amdgpu/math/clc_native_exp.cl
281
284
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/amdgpu/math/clc_native_log10.cl
282
- # Target-specific OpenCL builtins
283
285
${CMAKE_CURRENT_SOURCE_DIR} /clc/lib/r600/math/clc_native_rsqrt.cl
284
286
# OpenCL builtins
285
287
${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
58
58
math/clc_native_cos.cl
59
59
math/clc_native_divide.cl
60
60
math/clc_native_exp.cl
61
+ math/clc_native_exp10.cl
61
62
math/clc_native_exp2.cl
62
63
math/clc_native_log.cl
63
64
math/clc_native_log10.cl
64
65
math/clc_native_log2.cl
66
+ math/clc_native_powr.cl
65
67
math/clc_native_rsqrt.cl
66
68
math/clc_native_recip.cl
67
69
math/clc_native_sin.cl
68
70
math/clc_native_sqrt.cl
71
+ math/clc_native_tan.cl
69
72
math/clc_nextafter.cl
70
73
math/clc_pow.cl
71
74
math/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 6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
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);
11
11
}
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 6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
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) {
10
11
// x^y == 2^{log2 x^y} == 2^{y * log2 x}
11
12
// 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));
13
14
}
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>
Original file line number Diff line number Diff line change 6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
- _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_tan (__CLC_GENTYPE val) {
10
- return native_sin (val) / native_cos (val);
9
+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_native_tan (__CLC_GENTYPE val) {
10
+ return __clc_native_sin (val) / __clc_native_cos (val);
11
11
}
Original file line number Diff line number Diff line change 6
6
//
7
7
//===----------------------------------------------------------------------===//
8
8
9
- #define __CLC_BODY <clc/math/binary_decl_tt .inc>
9
+ #define __CLC_BODY <clc/shared/binary_decl .inc>
10
10
#define __CLC_FUNCTION native_divide
11
11
12
12
#include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 6
6
//
7
7
//===----------------------------------------------------------------------===//
8
8
9
- #define __CLC_BODY <clc/math/binary_decl_tt .inc>
9
+ #define __CLC_BODY <clc/shared/binary_decl .inc>
10
10
#define __CLC_FUNCTION native_powr
11
11
12
12
#include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 7
7
//===----------------------------------------------------------------------===//
8
8
9
9
#include <clc/clc.h>
10
+ #include <clc/math/clc_native_exp10.h>
10
11
11
- #define __CLC_BODY <native_exp10.inc>
12
12
#define __FLOAT_ONLY
13
+ #define FUNCTION native_exp10
14
+ #define __CLC_BODY <clc/shared/unary_def.inc>
15
+
13
16
#include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 7
7
//===----------------------------------------------------------------------===//
8
8
9
9
#include <clc/clc.h>
10
+ #include <clc/math/clc_native_powr.h>
10
11
11
- #define __CLC_BODY <native_powr.inc>
12
12
#define __FLOAT_ONLY
13
+ #define FUNCTION native_powr
14
+ #define __CLC_BODY <clc/shared/binary_def.inc>
15
+
13
16
#include <clc/math/gentype.inc>
Original file line number Diff line number Diff line change 7
7
//===----------------------------------------------------------------------===//
8
8
9
9
#include <clc/clc.h>
10
+ #include <clc/math/clc_native_tan.h>
10
11
11
- #define __CLC_BODY <native_tan.inc>
12
12
#define __FLOAT_ONLY
13
+ #define FUNCTION native_tan
14
+ #define __CLC_BODY <clc/shared/unary_def.inc>
15
+
13
16
#include <clc/math/gentype.inc>
You can’t perform that action at this time.
0 commit comments