llvm-project
6b63fe05 - [libc] Add UB-free cpp::to_bitmask helper

Commit
2 days ago
[libc] Add UB-free cpp::to_bitmask helper Bit-casting a simd<bool, N> mask directly to its integer simd_bitmask type reads padding bits as poison whenever N is not a multiple of CHAR_BIT (for example, the scalar fallback N == 1). Add cpp::to_bitmask to convert simd<bool, N> masks without reading padding bits, and use it in shift_mask in inline_strlen.h. Assisted-By: LLM Reviewers: jhuber6, michaelrj-google Pull Request: https://github.com/llvm/llvm-project/pull/244696
Parents
Loading