|
15 | 15 | #include <clc/relational/clc_isnan.h> |
16 | 16 | #include <clc/shared/clc_clamp.h> |
17 | 17 |
|
18 | | -#define _CLC_DEF_ldexp _CLC_DEF __attribute__((weak)) |
19 | | - |
20 | | -_CLC_DEF_ldexp _CLC_OVERLOAD float __clc_ldexp(float x, int n) { |
| 18 | +_CLC_DEF_WEAK _CLC_OVERLOAD float __clc_ldexp(float x, int n) { |
21 | 19 |
|
22 | 20 | if (!__clc_fp32_subnormals_supported()) { |
23 | 21 | // This treats subnormals as zeros |
@@ -90,7 +88,7 @@ _CLC_DEF_ldexp _CLC_OVERLOAD float __clc_ldexp(float x, int n) { |
90 | 88 |
|
91 | 89 | #pragma OPENCL EXTENSION cl_khr_fp64 : enable |
92 | 90 |
|
93 | | -_CLC_DEF_ldexp _CLC_OVERLOAD double __clc_ldexp(double x, int n) { |
| 91 | +_CLC_DEF_WEAK _CLC_OVERLOAD double __clc_ldexp(double x, int n) { |
94 | 92 | long l = __clc_as_ulong(x); |
95 | 93 | int e = (l >> 52) & 0x7ff; |
96 | 94 | long s = l & 0x8000000000000000; |
@@ -125,14 +123,14 @@ _CLC_DEF_ldexp _CLC_OVERLOAD double __clc_ldexp(double x, int n) { |
125 | 123 |
|
126 | 124 | #pragma OPENCL EXTENSION cl_khr_fp16 : enable |
127 | 125 |
|
128 | | -_CLC_OVERLOAD _CLC_DEF_ldexp half __clc_ldexp(half x, int n) { |
| 126 | +_CLC_OVERLOAD _CLC_DEF_WEAK half __clc_ldexp(half x, int n) { |
129 | 127 | return (half)__clc_ldexp((float)x, n); |
130 | 128 | } |
131 | 129 |
|
132 | 130 | #endif |
133 | 131 |
|
134 | 132 | #define __CLC_FUNCTION __clc_ldexp |
135 | | -#define __CLC_DEF_SPEC _CLC_DEF_ldexp |
| 133 | +#define __CLC_DEF_SPEC _CLC_DEF_WEAK |
136 | 134 | #define __CLC_ARG2_TYPE int |
137 | 135 | #define __CLC_BODY <clc/shared/binary_def_scalarize.inc> |
138 | 136 | #include <clc/math/gentype.inc> |
0 commit comments