File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
libc/src/__support/FPUtil/aarch64 Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,25 @@ namespace fputil {
25
25
26
26
#ifdef LIBC_TARGET_CPU_HAS_ARM_FPU_FLOAT
27
27
template <> LIBC_INLINE float sqrt<float >(float x) {
28
+ #if __has_builtin(__builtin_elementwise_sqrt)
29
+ return __builtin_elementwise_sqrt (x);
30
+ #else
28
31
float y;
29
32
asm (" fsqrt %s0, %s1\n\t " : " =w" (y) : " w" (x));
30
33
return y;
34
+ #endif // __builtin_elementwise_sqrt
31
35
}
32
36
#endif // LIBC_TARGET_CPU_HAS_ARM_FPU_FLOAT
33
37
34
38
#ifdef LIBC_TARGET_CPU_HAS_ARM_FPU_DOUBLE
35
39
template <> LIBC_INLINE double sqrt<double >(double x) {
40
+ #if __has_builtin(__builtin_elementwise_sqrt)
41
+ return __builtin_elementwise_sqrt (x);
42
+ #else
36
43
double y;
37
44
asm (" fsqrt %d0, %d1\n\t " : " =w" (y) : " w" (x));
38
45
return y;
46
+ #endif // __builtin_elementwise_sqrt
39
47
}
40
48
#endif // LIBC_TARGET_CPU_HAS_ARM_FPU_DOUBLE
41
49
You can’t perform that action at this time.
0 commit comments