Skip to content

Commit e28d7f7

Browse files
committed
[libclc] Format clc_tan.cl. NFC
1 parent f1888e4 commit e28d7f7

File tree

1 file changed

+24
-26
lines changed

1 file changed

+24
-26
lines changed

libclc/generic/lib/math/clc_tan.cl

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,46 +26,44 @@
2626
#include "../clcmacro.h"
2727
#include "tables.h"
2828

29-
_CLC_DEF _CLC_OVERLOAD float __clc_tan(float x)
30-
{
31-
int ix = as_int(x);
32-
int ax = ix & 0x7fffffff;
33-
float dx = as_float(ax);
29+
_CLC_DEF _CLC_OVERLOAD float __clc_tan(float x) {
30+
int ix = as_int(x);
31+
int ax = ix & 0x7fffffff;
32+
float dx = as_float(ax);
3433

35-
float r0, r1;
36-
int regn = __clc_argReductionS(&r0, &r1, dx);
34+
float r0, r1;
35+
int regn = __clc_argReductionS(&r0, &r1, dx);
3736

38-
float t = __clc_tanf_piby4(r0 + r1, regn);
39-
t = as_float(as_int(t) ^ (ix ^ ax));
37+
float t = __clc_tanf_piby4(r0 + r1, regn);
38+
t = as_float(as_int(t) ^ (ix ^ ax));
4039

41-
t = ax >= PINFBITPATT_SP32 ? as_float(QNANBITPATT_SP32) : t;
42-
//Take care of subnormals
43-
t = (x == 0.0f) ? x : t;
44-
return t;
40+
t = ax >= PINFBITPATT_SP32 ? as_float(QNANBITPATT_SP32) : t;
41+
// Take care of subnormals
42+
t = (x == 0.0f) ? x : t;
43+
return t;
4544
}
4645
_CLC_UNARY_VECTORIZE(_CLC_DEF _CLC_OVERLOAD, float, __clc_tan, float);
4746

4847
#ifdef cl_khr_fp64
4948
#include "sincosD_piby4.h"
5049

51-
_CLC_DEF _CLC_OVERLOAD double __clc_tan(double x)
52-
{
53-
double y = fabs(x);
50+
_CLC_DEF _CLC_OVERLOAD double __clc_tan(double x) {
51+
double y = fabs(x);
5452

55-
double r, rr;
56-
int regn;
53+
double r, rr;
54+
int regn;
5755

58-
if (y < 0x1.0p+30)
59-
__clc_remainder_piby2_medium(y, &r, &rr, &regn);
60-
else
61-
__clc_remainder_piby2_large(y, &r, &rr, &regn);
56+
if (y < 0x1.0p+30)
57+
__clc_remainder_piby2_medium(y, &r, &rr, &regn);
58+
else
59+
__clc_remainder_piby2_large(y, &r, &rr, &regn);
6260

63-
double2 tt = __clc_tan_piby4(r, rr);
61+
double2 tt = __clc_tan_piby4(r, rr);
6462

65-
int2 t = as_int2(regn & 1 ? tt.y : tt.x);
66-
t.hi ^= (x < 0.0) << 31;
63+
int2 t = as_int2(regn & 1 ? tt.y : tt.x);
64+
t.hi ^= (x < 0.0) << 31;
6765

68-
return isnan(x) || isinf(x) ? as_double(QNANBITPATT_DP64) : as_double(t);
66+
return isnan(x) || isinf(x) ? as_double(QNANBITPATT_DP64) : as_double(t);
6967
}
7068
_CLC_UNARY_VECTORIZE(_CLC_DEF _CLC_OVERLOAD, double, __clc_tan, double);
7169
#endif

0 commit comments

Comments
 (0)