44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
66
7+ #if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
8+ #include <math.h>
9+ #endif
10+
711void sincos (double __x , double * p_sin , double * p_cos );
812void sincosl (long double __x , long double * p_sin , long double * p_cos );
913void sincosf (float __x , float * p_sin , float * p_cos );
@@ -27,10 +31,9 @@ void sincos (double __x, double *p_sin, double *p_cos)
2731 "fstp %%st(1)\n\t"
2832 "fsincos\n\t"
2933 "1:" : "=t" (c ), "=u" (s ) : "0" (__x ));
30- #elif defined(__aarch64__ )
31- // TODO
32- c = 0.0 ;
33- s = 0.0 ;
34+ #elif __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
35+ s = sin (__x );
36+ c = cos (__x );
3437#endif
3538 * p_sin = (double ) s ;
3639 * p_cos = (double ) c ;
@@ -55,10 +58,9 @@ void sincosf (float __x, float *p_sin, float *p_cos)
5558 "fstp %%st(1)\n\t"
5659 "fsincos\n\t"
5760 "1:" : "=t" (c ), "=u" (s ) : "0" (__x ));
58- #elif defined(__aarch64__ )
59- // TODO
60- c = 0.0 ;
61- s = 0.0 ;
61+ #elif __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
62+ s = sinf (__x );
63+ c = cosf (__x );
6264#endif
6365 * p_sin = (float ) s ;
6466 * p_cos = (float ) c ;
@@ -83,10 +85,9 @@ void sincosl (long double __x, long double *p_sin, long double *p_cos)
8385 "fstp %%st(1)\n\t"
8486 "fsincos\n\t"
8587 "1:" : "=t" (c ), "=u" (s ) : "0" (__x ));
86- #elif defined(__aarch64__ )
87- // TODO
88- c = 0.0 ;
89- s = 0.0 ;
88+ #elif __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
89+ s = sin ((double )__x );
90+ c = cos ((double )__x );
9091#endif
9192 * p_sin = s ;
9293 * p_cos = c ;
0 commit comments