Skip to content

Commit 3f665ce

Browse files
committed
rename __clc_flush_denormal_if_not_supportedto __clc_soft_flush_denormal
1 parent 4608f77 commit 3f665ce

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

libclc/clc/include/clc/math/math.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);
6464

6565
#define LOG_MAGIC_NUM_SP32 (1 + NUMEXPBITS_SP32 - EXPBIAS_SP32)
6666

67-
_CLC_OVERLOAD _CLC_INLINE float __clc_flush_denormal_if_not_supported(float x) {
67+
_CLC_OVERLOAD _CLC_INLINE float __clc_soft_flush_denormal(float x) {
6868
// Avoid calling __clc_fp32_subnormals_supported here: it uses
6969
// llvm.canonicalize, which quiets sNaN.
70-
return __builtin_fabsf(x) < 0x1p-149f
70+
return __builtin_elementwise_abs(x) < 0x1p-149f
7171
? __builtin_elementwise_copysign(0.0f, x)
7272
: x;
7373
}

libclc/clc/lib/clspv/math/clc_sw_fma.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ _CLC_DEF _CLC_OVERLOAD float __clc_sw_fma(float a, float b, float c) {
127127
return c;
128128
}
129129

130-
a = __clc_flush_denormal_if_not_supported(a);
131-
b = __clc_flush_denormal_if_not_supported(b);
132-
c = __clc_flush_denormal_if_not_supported(c);
130+
a = __clc_soft_flush_denormal(a);
131+
b = __clc_soft_flush_denormal(b);
132+
c = __clc_soft_flush_denormal(c);
133133

134134
if (a == 0.0f || b == 0.0f) {
135135
return c;

libclc/clc/lib/generic/math/clc_remquo.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
_CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y,
1010
__CLC_ADDRESS_SPACE int *quo) {
11-
x = __clc_flush_denormal_if_not_supported(x);
12-
y = __clc_flush_denormal_if_not_supported(y);
11+
x = __clc_soft_flush_denormal(x);
12+
y = __clc_soft_flush_denormal(y);
1313
int ux = __clc_as_int(x);
1414
int ax = ux & EXSIGNBIT_SP32;
1515
float xa = __clc_as_float(ax);

libclc/clc/lib/generic/math/clc_sw_fma.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ _CLC_DEF _CLC_OVERLOAD float __clc_sw_fma(float a, float b, float c) {
3636
return c;
3737
}
3838

39-
a = __clc_flush_denormal_if_not_supported(a);
40-
b = __clc_flush_denormal_if_not_supported(b);
41-
c = __clc_flush_denormal_if_not_supported(c);
39+
a = __clc_soft_flush_denormal(a);
40+
b = __clc_soft_flush_denormal(b);
41+
c = __clc_soft_flush_denormal(c);
4242

4343
if (c == 0) {
4444
return a * b;

0 commit comments

Comments
 (0)