Skip to content

Commit 02aacb0

Browse files
committed
[libclc] Move clc_remquo
1 parent 200e650 commit 02aacb0

File tree

10 files changed

+23
-13
lines changed

10 files changed

+23
-13
lines changed

libclc/generic/include/math/clc_remquo.h renamed to libclc/clc/include/clc/math/clc_remquo.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_MATH_CLC_REMQUO_H__
10+
#define __CLC_MATH_CLC_REMQUO_H__
11+
912
#define __CLC_FUNCTION __clc_remquo
1013

11-
#define __CLC_BODY <clc/math/remquo.inc>
14+
#define __CLC_BODY <clc/math/remquo_decl.inc>
1215
#define __CLC_ADDRESS_SPACE private
1316
#include <clc/math/gentype.inc>
14-
#undef __CLC_ADDRESS_SPACE
1517

18+
#undef __CLC_ADDRESS_SPACE
19+
#undef __CLC_BODY
1620
#undef __CLC_FUNCTION
21+
22+
#endif // __CLC_MATH_CLC_REMQUO_H__

libclc/generic/include/clc/math/remquo.inc renamed to libclc/clc/include/clc/math/remquo_decl.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_ADDRESS_SPACE __CLC_INTN *q);
9+
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(
10+
__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_ADDRESS_SPACE __CLC_INTN *q);

libclc/clc/lib/generic/SOURCES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ math/clc_modf.cl
4747
math/clc_nan.cl
4848
math/clc_nextafter.cl
4949
math/clc_remainder.cl
50+
math/clc_remquo.cl
5051
math/clc_rint.cl
5152
math/clc_round.cl
5253
math/clc_rsqrt.cl

libclc/generic/lib/math/clc_remquo.cl renamed to libclc/clc/lib/generic/math/clc_remquo.cl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <clc/clc.h>
109
#include <clc/clc_convert.h>
1110
#include <clc/clcmacro.h>
1211
#include <clc/integer/clc_clz.h>
12+
#include <clc/internal/clc.h>
1313
#include <clc/math/clc_floor.h>
1414
#include <clc/math/clc_fma.h>
15+
#include <clc/math/clc_ldexp.h>
1516
#include <clc/math/clc_subnormal_config.h>
1617
#include <clc/math/clc_trunc.h>
1718
#include <clc/math/math.h>
@@ -115,6 +116,9 @@ __VEC_REMQUO(float, 8, 4)
115116
__VEC_REMQUO(float, 16, 8)
116117

117118
#ifdef cl_khr_fp64
119+
120+
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
121+
118122
_CLC_DEF _CLC_OVERLOAD double __clc_remquo(double x, double y,
119123
__private int *pquo) {
120124
ulong ux = __clc_as_ulong(x);
@@ -143,7 +147,7 @@ _CLC_DEF _CLC_OVERLOAD double __clc_remquo(double x, double y,
143147
// but it doesn't matter - it just means that we'll go round
144148
// the loop below one extra time.
145149
int ntimes = __clc_max(0, (xexp1 - yexp1) / 53);
146-
double w = ldexp(dy, ntimes * 53);
150+
double w = __clc_ldexp(dy, ntimes * 53);
147151
w = ntimes == 0 ? dy : w;
148152
double scale = ntimes == 0 ? 1.0 : 0x1.0p-53;
149153

libclc/clspv/lib/SOURCES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ subnormal_config.cl
2020
../../generic/lib/math/clc_pow.cl
2121
../../generic/lib/math/clc_pown.cl
2222
../../generic/lib/math/clc_powr.cl
23-
../../generic/lib/math/clc_remquo.cl
2423
../../generic/lib/math/clc_rootn.cl
2524
../../generic/lib/math/clc_tan.cl
2625
../../generic/lib/math/clc_tanpi.cl

libclc/generic/include/clc/math/remquo.h

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

99
#define __CLC_FUNCTION remquo
1010

11-
#define __CLC_BODY <clc/math/remquo.inc>
11+
#define __CLC_BODY <clc/math/remquo_decl.inc>
1212
#define __CLC_ADDRESS_SPACE global
1313
#include <clc/math/gentype.inc>
1414
#undef __CLC_ADDRESS_SPACE
1515

16-
#define __CLC_BODY <clc/math/remquo.inc>
16+
#define __CLC_BODY <clc/math/remquo_decl.inc>
1717
#define __CLC_ADDRESS_SPACE local
1818
#include <clc/math/gentype.inc>
1919
#undef __CLC_ADDRESS_SPACE
2020

21-
#define __CLC_BODY <clc/math/remquo.inc>
21+
#define __CLC_BODY <clc/math/remquo_decl.inc>
2222
#define __CLC_ADDRESS_SPACE private
2323
#include <clc/math/gentype.inc>
2424
#undef __CLC_ADDRESS_SPACE

libclc/generic/lib/SOURCES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ math/pown.cl
163163
math/clc_powr.cl
164164
math/powr.cl
165165
math/remainder.cl
166-
math/clc_remquo.cl
167166
math/remquo.cl
168167
math/rint.cl
169168
math/clc_rootn.cl

libclc/generic/lib/math/remquo.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include <clc/clc.h>
10-
#include <math/clc_remquo.h>
10+
#include <clc/math/clc_remquo.h>
1111

1212
#define __CLC_BODY <remquo.inc>
1313
#define __CLC_ADDRESS_SPACE global

libclc/generic/lib/math/remquo.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE remquo(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_ADDRESS_SPACE __CLC_INTN *q) {
9+
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE remquo(__CLC_GENTYPE x, __CLC_GENTYPE y,
10+
__CLC_ADDRESS_SPACE __CLC_INTN *q) {
1011
__CLC_INTN local_q;
1112
__CLC_GENTYPE ret = __clc_remquo(x, y, &local_q);
1213
*q = local_q;

libclc/spirv/lib/SOURCES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ math/fma.cl
6565
../../generic/lib/math/clc_powr.cl
6666
../../generic/lib/math/powr.cl
6767
../../generic/lib/math/remainder.cl
68-
../../generic/lib/math/clc_remquo.cl
6968
../../generic/lib/math/remquo.cl
7069
../../generic/lib/math/clc_rootn.cl
7170
../../generic/lib/math/rootn.cl

0 commit comments

Comments
 (0)