File tree Expand file tree Collapse file tree 7 files changed +61
-84
lines changed Expand file tree Collapse file tree 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 5757#define __CLC_CONVERT_UINTN __CLC_XCONCAT (__clc_convert_, __CLC_UINTN)
5858#define __CLC_CONVERT_ULONGN __CLC_XCONCAT (__clc_convert_, __CLC_ULONGN)
5959
60+ #define __CLC_CONVERT_BIT_INTN __CLC_XCONCAT (__clc_convert_, __CLC_BIT_INTN)
61+
6062// See definitions of __CLC_S_GENTYPE/__CLC_U_GENTYPE below, which depend on the
6163// specific size of floating-point type. These are the signed and unsigned
6264// integers of the same bitwidth and element count as the GENTYPE. They match
329331#undef __CLC_CONVERT_UINTN
330332#undef __CLC_CONVERT_ULONGN
331333
334+ #undef __CLC_CONVERT_BIT_INTN
335+
332336#undef __CLC_ULONGN
333337#undef __CLC_UINTN
334338#undef __CLC_USHORTN
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ math/clc_exp2.cl
4141math/clc_expm1.cl
4242math/clc_exp_helper.cl
4343math/clc_fabs.cl
44+ math/clc_fdim.cl
4445math/clc_fma.cl
4546math/clc_fmax.cl
4647math/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 77//===----------------------------------------------------------------------===//
88
99#include <clc/clc.h>
10- #include <clc/math/math .h>
10+ #include <clc/math/clc_fdim .h>
1111
12- #define __CLC_BODY <fdim.inc>
12+ #define FUNCTION fdim
13+ #define __CLC_BODY <clc/shared/binary_def.inc>
1314#include <clc/math/gentype.inc>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments