As suggested by @rsmith on PR47267, by replacing the builtin_memcpy bitcast pattern with builtin_bit_cast we can use _castf32_u32, _castu32_f32, _castf64_u64 and _castu64_f64 inside constant expresssions (constexpr). Although __builtin_bit_cast was added for c++20 it works on all clang c/c++ modes.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
It would be useful to include in our documentation a brief list of which of these intrinsics can be used in constant expressions.
clang-tidy: error: "Never use <ia32intrin.h> directly; include <x86intrin.h> instead." [clang-diagnostic-error]
not useful