We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 802a2e3 commit a179a1bCopy full SHA for a179a1b
libc/src/__support/FPUtil/sqrt.h
@@ -35,6 +35,14 @@ template <> LIBC_INLINE double sqrt<double>(double x) {
35
}
36
#endif // LIBC_TARGET_CPU_HAS_FPU_DOUBLE
37
38
+// Use 80-bit long double instruction on x86.
39
+// https://godbolt.org/z/oWEaj6hxK
40
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
41
+template <> LIBC_INLINE long double sqrt<long double>(long double x) {
42
+ return __builtin_elementwise_sqrt(x);
43
+}
44
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
45
+
46
} // namespace fputil
47
} // namespace LIBC_NAMESPACE_DECL
48
0 commit comments