Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msvc SSE2 compilation fails in i_extract(const float32<4>& a) #188

Open
peabody-korg opened this issue Sep 3, 2024 · 0 comments
Open

msvc SSE2 compilation fails in i_extract(const float32<4>& a) #188

peabody-korg opened this issue Sep 3, 2024 · 0 comments

Comments

@peabody-korg
Copy link
Contributor

#elif SIMDPP_USE_SSE2
    switch (id) {
    case 0: return _mm_cvtss_f32(a.native());
#if SIMDPP_USE_SSE3
    case 1: return _mm_cvtss_f32(_mm_movehdup_ps(a.native()));
#else
    case 1: return _mm_cvtss_f32(_mm_shuffle_ps(a.native(), a.native(), _MM_SHUFFLE(id, id, id, id)));
#endif
    case 2: return _mm_cvtss_f32(_mm_unpackhi_ps(a.native(), a.native()));
    case 3: return _mm_cvtss_f32(_mm_shuffle_ps(a.native(), a.native(), _MM_SHUFFLE(id, id, id, id)));
    }

fails with

Error	C4715	'simdpp::arch_sse4p1::detail::insn::i_extract<0>': not all control paths return a value	C:\Users\[...]\libsimdpp\simdpp\detail\insn\extract.h	369		

the simplest fix is to add a default: case to the switch, such as:

#elif SIMDPP_USE_SSE2
    switch (id) {
    default:
    case 0: return _mm_cvtss_f32(a.native());
#if SIMDPP_USE_SSE3

Windows 11 Pro
Version 23H2

Microsoft Visual Studio Community 2022
Version 17.11.2

x86_64 SSE4.1 build

commit 55860b5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant