Skip to content

Commit 7b290a2

Browse files
committed
delete clc_sw_fma
1 parent 3f665ce commit 7b290a2

File tree

12 files changed

+7
-512
lines changed

12 files changed

+7
-512
lines changed

libclc/clc/include/clc/internal/math/clc_sw_fma.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323
#define PNOR 0x100
2424
#define PINF 0x200
2525

26-
#if (defined __AMDGCN__ || defined __R600__) && !defined __HAS_FMAF__
27-
#define __CLC_HAVE_HW_FMA32() (0)
28-
#elif defined(CLC_SPIRV)
29-
bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);
30-
#define __CLC_HAVE_HW_FMA32() __clc_runtime_has_hw_fma32()
31-
#else
32-
#define __CLC_HAVE_HW_FMA32() (1)
33-
#endif
34-
3526
#define HAVE_BITALIGN() (0)
3627
#define HAVE_FAST_FMA32() (0)
3728

libclc/clc/lib/clspv/SOURCES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
math/clc_sw_fma.cl
21
integer/clc_mul_hi.cl

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

Lines changed: 0 additions & 274 deletions
This file was deleted.

libclc/clc/lib/generic/SOURCES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ math/clc_sinh.cl
138138
math/clc_sinpi.cl
139139
math/clc_sqrt.cl
140140
math/clc_subnormal_config.cl
141-
math/clc_sw_fma.cl
142141
math/clc_tables.cl
143142
math/clc_tan.cl
144143
math/clc_tanh.cl

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@
88

99
_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_fma(__CLC_GENTYPE a, __CLC_GENTYPE b,
1010
__CLC_GENTYPE c) {
11-
#if __CLC_FPSIZE == 32
12-
if (!__CLC_HAVE_HW_FMA32())
13-
return __clc_sw_fma(a, b, c);
14-
#endif
1511
return __builtin_elementwise_fma(a, b, c);
1612
}

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

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,9 @@ _CLC_DEF _CLC_OVERLOAD void __clc_fullMulS(private __CLC_FLOATN *hi,
9797
private __CLC_FLOATN *lo,
9898
__CLC_FLOATN a, __CLC_FLOATN b,
9999
__CLC_FLOATN bh, __CLC_FLOATN bt) {
100-
if (__CLC_HAVE_HW_FMA32()) {
101-
__CLC_FLOATN ph = a * b;
102-
*hi = ph;
103-
*lo = __clc_fma(a, b, -ph);
104-
} else {
105-
__CLC_FLOATN ah = __CLC_AS_FLOATN(__CLC_AS_UINTN(a) & 0xfffff000U);
106-
__CLC_FLOATN at = a - ah;
107-
__CLC_FLOATN ph = a * b;
108-
__CLC_FLOATN pt = __clc_mad(
109-
at, bt, __clc_mad(at, bh, __clc_mad(ah, bt, __clc_mad(ah, bh, -ph))));
110-
*hi = ph;
111-
*lo = pt;
112-
}
100+
__CLC_FLOATN ph = a * b;
101+
*hi = ph;
102+
*lo = __clc_fma(a, b, -ph);
113103
}
114104

115105
_CLC_DEF _CLC_OVERLOAD __CLC_FLOATN __clc_removePi2S(private __CLC_FLOATN *hi,
@@ -280,20 +270,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_INTN __clc_argReductionLargeS(
280270
const __CLC_FLOATN pio2t = (__CLC_FLOATN)0xa22168 / 0x1.0p+47f;
281271

282272
__CLC_FLOATN rh, rt;
283-
284-
if (__CLC_HAVE_HW_FMA32()) {
285-
rh = q1 * pio2h;
286-
rt = __clc_fma(q0, pio2h, __clc_fma(q1, pio2t, __clc_fma(q1, pio2h, -rh)));
287-
} else {
288-
__CLC_FLOATN q1h = __CLC_AS_FLOATN(__CLC_AS_UINTN(q1) & 0xfffff000);
289-
__CLC_FLOATN q1t = q1 - q1h;
290-
rh = q1 * pio2h;
291-
rt = __clc_mad(
292-
q1t, pio2ht,
293-
__clc_mad(q1t, pio2hh,
294-
__clc_mad(q1h, pio2ht, __clc_mad(q1h, pio2hh, -rh))));
295-
rt = __clc_mad(q0, pio2h, __clc_mad(q1, pio2t, rt));
296-
}
273+
rh = q1 * pio2h;
274+
rt = __clc_fma(q0, pio2h, __clc_fma(q1, pio2t, __clc_fma(q1, pio2h, -rh)));
297275

298276
__CLC_FLOATN t = rh + rt;
299277
rt = rt - (t - rh);

0 commit comments

Comments
 (0)