File tree 7 files changed +61
-84
lines changed
7 files changed +61
-84
lines changed 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_FDIM_H__
10
+ #define __CLC_MATH_CLC_FDIM_H__
11
+
12
+ #define __CLC_BODY <clc/shared/binary_decl.inc>
13
+ #define __CLC_FUNCTION __clc_fdim
14
+
15
+ #include <clc/math/gentype.inc>
16
+
17
+ #undef __CLC_BODY
18
+ #undef __CLC_FUNCTION
19
+
20
+ #endif // __CLC_MATH_CLC_FDIM_H__
Original file line number Diff line number Diff line change 57
57
#define __CLC_CONVERT_UINTN __CLC_XCONCAT (__clc_convert_, __CLC_UINTN)
58
58
#define __CLC_CONVERT_ULONGN __CLC_XCONCAT (__clc_convert_, __CLC_ULONGN)
59
59
60
+ #define __CLC_CONVERT_BIT_INTN __CLC_XCONCAT (__clc_convert_, __CLC_BIT_INTN)
61
+
60
62
// See definitions of __CLC_S_GENTYPE/__CLC_U_GENTYPE below, which depend on the
61
63
// specific size of floating-point type. These are the signed and unsigned
62
64
// integers of the same bitwidth and element count as the GENTYPE. They match
329
331
#undef __CLC_CONVERT_UINTN
330
332
#undef __CLC_CONVERT_ULONGN
331
333
334
+ #undef __CLC_CONVERT_BIT_INTN
335
+
332
336
#undef __CLC_ULONGN
333
337
#undef __CLC_UINTN
334
338
#undef __CLC_USHORTN
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ math/clc_exp2.cl
41
41
math/clc_expm1.cl
42
42
math/clc_exp_helper.cl
43
43
math/clc_fabs.cl
44
+ math/clc_fdim.cl
44
45
math/clc_fma.cl
45
46
math/clc_fmax.cl
46
47
math/clc_fmin.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/clc_convert.h>
10
+ #include <clc/float/definitions.h>
11
+ #include <clc/internal/clc.h>
12
+ #include <clc/math/clc_fmax.h>
13
+ #include <clc/math/math.h>
14
+ #include <clc/relational/clc_isnan.h>
15
+ #include <clc/relational/clc_select.h>
16
+
17
+ #define __CLC_BODY <clc_fdim.inc>
18
+ #include <clc/math/gentype.inc>
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
+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_fdim (__CLC_GENTYPE x,
10
+ __CLC_GENTYPE y) {
11
+ return __clc_select (
12
+ __builtin_elementwise_max (x - y, (__CLC_GENTYPE)__CLC_FP_LIT (0.0 )),
13
+ __CLC_GENTYPE_NAN,
14
+ __CLC_CONVERT_BIT_INTN (__clc_isnan (x) || __clc_isnan (y)));
15
+ }
Original file line number Diff line number Diff line change 7
7
//===----------------------------------------------------------------------===//
8
8
9
9
#include <clc/clc.h>
10
- #include <clc/math/math .h>
10
+ #include <clc/math/clc_fdim .h>
11
11
12
- #define __CLC_BODY <fdim.inc>
12
+ #define FUNCTION fdim
13
+ #define __CLC_BODY <clc/shared/binary_def.inc>
13
14
#include <clc/math/gentype.inc>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments