Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc/src/__support/FPUtil/sqrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ template <> LIBC_INLINE double sqrt<double>(double x) {
}
#endif // LIBC_TARGET_CPU_HAS_FPU_DOUBLE

// Use 80-bit long double instruction on x86.
// https://godbolt.org/z/oWEaj6hxK
#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
template <> LIBC_INLINE long double sqrt<long double>(long double x) {
return __builtin_elementwise_sqrt(x);
}
#endif

} // namespace fputil
} // namespace LIBC_NAMESPACE_DECL

Expand Down
Loading