Description
Hi.
This is a continuation of this Zulip discussion as it seems this might be a bug in compiler-builtins (please close if this is not the case).
The context was:
I'm trying to update compiler-builtins in rustc_codegen_gcc that was pinned to 0.1.109 until the support for f16 and f128 was implemented.
I used to not generate symbols likesqrt
fromcompiler_builtins
(instead, we were using the one from libgcc) in order to avoid infinite recursion like:compiler_builtins::math::libm::sqrt::sqrt compiler_builtins::math::sqrt sqrt core::core_arch::x86::sse2::_mm_sqrt_pd
because rustc_codegen_gcc implements SIMD
sqrt
by callingsqrt
on each element of the vector for now.
But with the new update, it seems I cannot do that anymore. This workaround seemed like a hack anyway.
@Amanieu mentioned the following which might be the solution:
Really compiler_builtins shouldn't be calling the native instruction, it should only contain the fallback.
Since the compiler is responsible for emitting the proper instruction and not calling the builtin in the first place.
Thanks.
Activity