Using an union (encapsulated in a struct) to bypass conversions for neon data types

前端 未结 3 1968
失恋的感觉
失恋的感觉 2020-12-04 00:57

I made my first approach with vectorization intrinsics with SSE, where there is basically only one data type __m128i. Switching to Neon I found the data types a

3条回答
  •  甜味超标
    2020-12-04 01:20

    According to the C++ Standard, this data type is nearly useless (and certainly so for the purpose you intend). That's because reading from an inactive member of a union is undefined behavior.

    It is possible, however, that your compiler promises to make this work. However, you haven't asked about any particular compiler, so it is impossible to comment further on that.

提交回复
热议问题