libstdc++: Improve copysign(simd) codegen
authorMatthias Kretz <m.kretz@gsi.de>
Thu, 24 Jun 2021 13:20:13 +0000 (14:20 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 24 Jun 2021 13:20:13 +0000 (14:20 +0100)
commit0237aa8c706f09bb2568224afcdac40b5e47c3e1
treeededaa5c376512293fc0b5a1e2f48b574bce73a3
parent07ba52849ffca26a3d461f94921b23a9cdbaea7f
libstdc++: Improve copysign(simd) codegen

This also resolves a test failure on aarch64 with -ffast-math and
fixed_size<N> with large N.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* include/experimental/bits/simd.h: Add missing operator~
overload for simd<floating-point> to __float_bitwise_operators.
* include/experimental/bits/simd_builtin.h
(_SimdImplBuiltin::_S_complement): Bitcast to int (and back) to
implement complement for floating-point vectors.
* include/experimental/bits/simd_fixed_size.h
(_SimdImplFixedSize::_S_copysign): New function, forwarding to
copysign implementation of _SimdTuple members.
* include/experimental/bits/simd_math.h (copysign): Call
_SimdImpl::_S_copysign for fixed_size arguments. Simplify
generic copysign implementation using the new ~ operator.
libstdc++-v3/include/experimental/bits/simd.h
libstdc++-v3/include/experimental/bits/simd_builtin.h
libstdc++-v3/include/experimental/bits/simd_fixed_size.h
libstdc++-v3/include/experimental/bits/simd_math.h