20 */
21
22 /*
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 */
25 /*
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 /*
31 * Copyright 2011, Richard Lowe.
32 */
33
34 /* Functions in this file are duplicated in locallibm.il. Keep them in sync */
35
36 #ifndef _LIBM_INLINES_H
37 #define _LIBM_INLINES_H
38
39 #ifdef __GNUC__
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 #include <sys/types.h>
46 #include <sys/ieeefp.h>
47
48 extern __GNU_INLINE float
49 __inline_sqrtf(float a)
50 {
51 float ret;
52
53 __asm__ __volatile__("sqrtss %1, %0\n\t" : "=x" (ret) : "x" (a));
54 return (ret);
55 }
56
57 extern __GNU_INLINE double
58 __inline_sqrt(double a)
59 {
60 double ret;
198 : "x" (d)
199 : "cc");
200 return (ret);
201 }
202
203 extern __GNU_INLINE double
204 sqrt(double d)
205 {
206 return (__inline_sqrt(d));
207 }
208
209 extern __GNU_INLINE float
210 sqrtf(float f)
211 {
212 return (__inline_sqrtf(f));
213 }
214
215 #ifdef __cplusplus
216 }
217 #endif
218
219 #endif /* __GNUC__ */
220
221 #endif /* _LIBM_INLINES_H */
|
20 */
21
22 /*
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 */
25 /*
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 /*
31 * Copyright 2011, Richard Lowe.
32 */
33
34 /* Functions in this file are duplicated in locallibm.il. Keep them in sync */
35
36 #ifndef _LIBM_INLINES_H
37 #define _LIBM_INLINES_H
38
39 #ifdef __GNUC__
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 #include <sys/types.h>
45 #include <sys/ieeefp.h>
46
47 extern __GNU_INLINE float
48 __inline_sqrtf(float a)
49 {
50 float ret;
51
52 __asm__ __volatile__("sqrtss %1, %0\n\t" : "=x" (ret) : "x" (a));
53 return (ret);
54 }
55
56 extern __GNU_INLINE double
57 __inline_sqrt(double a)
58 {
59 double ret;
197 : "x" (d)
198 : "cc");
199 return (ret);
200 }
201
202 extern __GNU_INLINE double
203 sqrt(double d)
204 {
205 return (__inline_sqrt(d));
206 }
207
208 extern __GNU_INLINE float
209 sqrtf(float f)
210 {
211 return (__inline_sqrtf(f));
212 }
213
214 #ifdef __cplusplus
215 }
216 #endif
217 #endif /* __GNUC__ */
218 #endif /* _LIBM_INLINES_H */
|