sse: cast _MM_HINT_* values to enum _mm_hint on GCC
_mm_prefetch is supposed to take an int, but when optimization enabled GCC uses an enum _mm_hint instead. Without optimization _mm_prefetch is defined as a macro (as it is on clang) since there is no constant propagation. Since we can't rely on all hints being defined on all platforms we define our own, which are not part of the enum _mm_hint. So, on GCC we cast each of the hints to enum _mm_hint to avoid a warning about an invalid conversion. IMHO this is technically a bug in the GCC API, but I appreciate the effort at getting the compiler to validate the input so I'm not going to complain to the GCC folks as long as this doesn't cause additional breakage. Fixes #673
Showing
Please register or sign in to comment