Skip to content

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

Open
@peabody-korg

Description

#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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions