The idea is that the builtins are wrapped by portable intrinsics (e.g. mm* on x86) and therefore those should be used as an interface in programming. If there’s no suitable intrinsic then we’ll expose the builtin.
The question isn’t about the Intel mm* intrinsics, it’s about the C math builtins we provide under __builtin_pow, etc. I think most of them are mapped to their libc calls for convenience. Some have been added on an ad-hoc basis as needed.
I believe that GCC lowers most calls to __builtin_sqrt and such to instructions before library calls, so we can go ahead and map most of those down to LLVM intrinsics without worrying about things like errno. It’s worth checking as you go, though, rather than blindly mapping everything to LLVM intrinsics.
The question isn’t about the Intel mm* intrinsics, it’s about the C math builtins we provide under __builtin_pow, etc. I think most of them are mapped to their libc calls for convenience. Some have been added on an ad-hoc basis as needed.
Right. Same general principle
I believe that GCC lowers most calls to __builtin_sqrt and such to instructions before library calls, so we can go ahead and map most of those down to LLVM intrinsics without worrying about things like errno. It’s worth checking as you go, though, rather than blindly mapping everything to LLVM intrinsics.