From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7857) id 375473858CDB; Wed, 17 Apr 2024 08:34:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 375473858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713342884; bh=jRINWObCbTZEbnGImX+37pm2WFDin+cE/WvtQH9eJaU=; h=From:To:Subject:Date:From; b=vo7Z4377gDoVb0JfdNhDfDj9pxAu90bxTI9VtpwO7A36VImY0Hi0WAkLcFEHFmrOY AW9qKi9TrcgVUgPaAD4t0dfmRx3O/sbMTfLMTg0OasO5Eb+vwMmLfRqdsMPj+PK8ZS OFtkPRN6yz92xzsODSuTV8bN7g9ECpDfyajPcxYM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Matthias Kretz To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-10001] libstdc++: Avoid ill-formed types on ARM X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/master X-Git-Oldrev: 299d14a54672a4d12c1abbe4031a732bb56cddaa X-Git-Newrev: 0fc7f3c6adc8543f55ec35b309016d9d9c4ddd35 Message-Id: <20240417083444.375473858CDB@sourceware.org> Date: Wed, 17 Apr 2024 08:34:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0fc7f3c6adc8543f55ec35b309016d9d9c4ddd35 commit r14-10001-g0fc7f3c6adc8543f55ec35b309016d9d9c4ddd35 Author: Matthias Kretz Date: Wed Apr 17 09:11:25 2024 +0200 libstdc++: Avoid ill-formed types on ARM This resolves failing tests in check-simd. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/114750 * include/experimental/bits/simd_builtin.h (_SimdImplBuiltin::_S_load, _S_store): Fall back to copying scalars if the memory type cannot be vectorized for the target. Diff: --- libstdc++-v3/include/experimental/bits/simd_builtin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libstdc++-v3/include/experimental/bits/simd_builtin.h index 28227a5d97f..af0c4886108 100644 --- a/libstdc++-v3/include/experimental/bits/simd_builtin.h +++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h @@ -1464,7 +1464,7 @@ template [&](auto __i) constexpr { return static_cast<_Tp>(__i < _Np ? __mem[__i] : 0); }); - else if constexpr (sizeof(_Up) > 8) + else if constexpr (sizeof(_Up) > 8 or __vectorized_sizeof<_Up>() <= sizeof(_Up)) return __generate_vector<_Tp, _SimdMember<_Tp>::_S_full_size>( [&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA { return static_cast<_Tp>(__i < _Np ? __mem[__i] : 0); @@ -1536,7 +1536,7 @@ template for (size_t __i = 0; __i < _Np; ++__i) __mem[__i] = __v[__i]; } - else if constexpr (sizeof(_Up) > 8) + else if constexpr (sizeof(_Up) > 8 or __vectorized_sizeof<_Up>() <= sizeof(_Up)) __execute_n_times<_Np>([&](auto __i) constexpr _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA { __mem[__i] = __v[__i]; });