https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129135
Bug ID: 129135
Summary: Does not select appropriate int or float version of
avx instructions
Product: gcc
Version: 16.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: denis.yaroshevskij at gmail dot com
Target Milestone: ---
```
#include <immintrin.h>
__m256i masked_load_int(int const* p, __m256i m)
{
__m256i x = _mm256_maskload_epi32(p, m);
return _mm256_add_epi32(x, x);
}
__m256i masked_load_float(float const* p, __m256i m)
{
__m256i x = _mm256_castps_si256(_mm256_maskload_ps(p, m));
return _mm256_add_epi32(x, x);
}
__m256i load_int(int const* p)
{
__m256i x = _mm256_loadu_si256((__m256i const*)p);
return _mm256_add_epi32(x, x);
}
__m256i load_float(float const* p)
{
__m256i x = _mm256_castps_si256(_mm256_loadu_ps(p));
return _mm256_add_epi32(x, x);
}
```
gcc doesn't select the correct mask load, instead relying on what the user
specified
https://godbolt.org/z/q1rY6P7o9