Skip to content

Commit 8dfd2cb

Browse files
committed
use clc_ldexp
1 parent b38c981 commit 8dfd2cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libclc/clc/lib/amdgpu/math/clc_sqrt_fp64.cl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <clc/clcmacro.h>
2424
#include <clc/internal/clc.h>
2525
#include <clc/math/clc_fma.h>
26+
#include <clc/math/clc_ldexp.h>
2627

2728
#ifdef cl_khr_fp64
2829

@@ -39,7 +40,7 @@ _CLC_OVERLOAD _CLC_DEF double __clc_sqrt(double x) {
3940
uint exp0 = vcc ? 0x100 : 0;
4041
unsigned exp1 = vcc ? 0xffffff80 : 0;
4142

42-
double v01 = __builtin_ldexp(x, exp0);
43+
double v01 = __clc_ldexp(x, exp0);
4344
double v23 = __clc_builtin_rsq(v01);
4445
double v45 = v01 * v23;
4546
v23 = v23 * 0.5;
@@ -52,7 +53,7 @@ _CLC_OVERLOAD _CLC_DEF double __clc_sqrt(double x) {
5253
v67 = __clc_fma(-v45, v45, v01);
5354
v23 = __clc_fma(v67, v23, v45);
5455

55-
v23 = __builtin_ldexp(v23, exp1);
56+
v23 = __clc_ldexp(v23, exp1);
5657
return (x == __builtin_inf() || (x == 0.0)) ? v01 : v23;
5758
}
5859

0 commit comments

Comments
 (0)