[clang] [Clang] Replace some x86 sqrt builtins with the generic __builtin_elementwise_sqrt versions (PR #165682)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 30 03:32:01 PST 2025


phoebewang wrote:

> hello, with the latest version of this project, we dont have __builtin_ia32_sqrtsd anymore, which was handy because it is the same name as the gcc one. it would have been nice to mark it as deprecated before removing it suddenly. https://godbolt.org/z/6fo7zchx4 (ignore msvc, clang 21.1.0 works) can you say what I have to use instead pls?

You can either target intrinsic `_mm_sqrt_sd` or use the common `__builtin_sqrt` instead. Note, you need `-fno-math-errno` for the latter, https://godbolt.org/z/sGWEzqYWE. We don't guarantee compatibilities of target specific builtins.

https://github.com/llvm/llvm-project/pull/165682


More information about the cfe-commits mailing list