Author: Fraser Cormack Date: 2024-11-04T10:52:46Z New Revision: e28d7f713471cf33908a0fe5223f480dfd9b06f0
URL: https://github.com/llvm/llvm-project/commit/e28d7f713471cf33908a0fe5223f480dfd9b06f0 DIFF: https://github.com/llvm/llvm-project/commit/e28d7f713471cf33908a0fe5223f480dfd9b06f0.diff LOG: [libclc] Format clc_tan.cl. NFC Added: Modified: libclc/generic/lib/math/clc_tan.cl Removed: ################################################################################ diff --git a/libclc/generic/lib/math/clc_tan.cl b/libclc/generic/lib/math/clc_tan.cl index ebba36a0d257e2..36e5fe55219351 100644 --- a/libclc/generic/lib/math/clc_tan.cl +++ b/libclc/generic/lib/math/clc_tan.cl @@ -26,46 +26,44 @@ #include "../clcmacro.h" #include "tables.h" -_CLC_DEF _CLC_OVERLOAD float __clc_tan(float x) -{ - int ix = as_int(x); - int ax = ix & 0x7fffffff; - float dx = as_float(ax); +_CLC_DEF _CLC_OVERLOAD float __clc_tan(float x) { + int ix = as_int(x); + int ax = ix & 0x7fffffff; + float dx = as_float(ax); - float r0, r1; - int regn = __clc_argReductionS(&r0, &r1, dx); + float r0, r1; + int regn = __clc_argReductionS(&r0, &r1, dx); - float t = __clc_tanf_piby4(r0 + r1, regn); - t = as_float(as_int(t) ^ (ix ^ ax)); + float t = __clc_tanf_piby4(r0 + r1, regn); + t = as_float(as_int(t) ^ (ix ^ ax)); - t = ax >= PINFBITPATT_SP32 ? as_float(QNANBITPATT_SP32) : t; - //Take care of subnormals - t = (x == 0.0f) ? x : t; - return t; + t = ax >= PINFBITPATT_SP32 ? as_float(QNANBITPATT_SP32) : t; + // Take care of subnormals + t = (x == 0.0f) ? x : t; + return t; } _CLC_UNARY_VECTORIZE(_CLC_DEF _CLC_OVERLOAD, float, __clc_tan, float); #ifdef cl_khr_fp64 #include "sincosD_piby4.h" -_CLC_DEF _CLC_OVERLOAD double __clc_tan(double x) -{ - double y = fabs(x); +_CLC_DEF _CLC_OVERLOAD double __clc_tan(double x) { + double y = fabs(x); - double r, rr; - int regn; + double r, rr; + int regn; - if (y < 0x1.0p+30) - __clc_remainder_piby2_medium(y, &r, &rr, ®n); - else - __clc_remainder_piby2_large(y, &r, &rr, ®n); + if (y < 0x1.0p+30) + __clc_remainder_piby2_medium(y, &r, &rr, ®n); + else + __clc_remainder_piby2_large(y, &r, &rr, ®n); - double2 tt = __clc_tan_piby4(r, rr); + double2 tt = __clc_tan_piby4(r, rr); - int2 t = as_int2(regn & 1 ? tt.y : tt.x); - t.hi ^= (x < 0.0) << 31; + int2 t = as_int2(regn & 1 ? tt.y : tt.x); + t.hi ^= (x < 0.0) << 31; - return isnan(x) || isinf(x) ? as_double(QNANBITPATT_DP64) : as_double(t); + return isnan(x) || isinf(x) ? as_double(QNANBITPATT_DP64) : as_double(t); } _CLC_UNARY_VECTORIZE(_CLC_DEF _CLC_OVERLOAD, double, __clc_tan, double); #endif _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits