Skip to content

Commit ec47a0a

Browse files
committed
build: workaround for missing _mm256_setr_m128 in GCC
1 parent 74defef commit ec47a0a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/imgproc/src/corner.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,16 @@ static inline void store_interleave(float* ptr, const __m256& a, const __m256& b
113113
v_transpose4x4(v_uint32x4(a1), v_uint32x4(b1), v_uint32x4(c1), z, u0, u1, u2, u3);
114114
v_pack4x3to3x4(u0.val, u1.val, u2.val, u3.val, a1, b1, c1);
115115

116+
#if !defined(__GNUC__) || defined(__INTEL_COMPILER)
116117
_mm256_storeu_ps(ptr, _mm256_setr_m128(_mm_castsi128_ps(a0), _mm_castsi128_ps(b0)));
117118
_mm256_storeu_ps(ptr + 8, _mm256_setr_m128(_mm_castsi128_ps(c0), _mm_castsi128_ps(a1)));
118119
_mm256_storeu_ps(ptr + 16, _mm256_setr_m128(_mm_castsi128_ps(b1), _mm_castsi128_ps(c1)));
120+
#else
121+
// GCC: workaround for missing AVX intrinsic: "_mm256_setr_m128()"
122+
_mm256_storeu_ps(ptr, _mm256_insertf128_ps(_mm256_castps128_ps256(_mm_castsi128_ps(a0)), _mm_castsi128_ps(b0), 1));
123+
_mm256_storeu_ps(ptr + 8, _mm256_insertf128_ps(_mm256_castps128_ps256(_mm_castsi128_ps(c0)), _mm_castsi128_ps(a1), 1));
124+
_mm256_storeu_ps(ptr + 16, _mm256_insertf128_ps(_mm256_castps128_ps256(_mm_castsi128_ps(b1)), _mm_castsi128_ps(c1), 1));
125+
#endif
119126
}
120127
#endif // CV_AVX
121128

0 commit comments

Comments
 (0)