Skip to content

Commit b45403e

Browse files
committed
Merge pull request opencv#10102 from seiko2plus:coreVsxPacksFix
2 parents 3e33820 + 56bda89 commit b45403e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/core/include/opencv2/core/vsx_utils.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,8 @@ FORCE_INLINE(rt) fnm(const rg& a, const rg& b) \
254254

255255
FORCE_INLINE(vec_bdword2) vec_nor(const vec_bdword2& a, const vec_bdword2& b)
256256
{ return vec_bdword2_c(__builtin_vec_nor(vec_dword2_c(a), vec_dword2_c(b))); }
257-
#endif // __GNUG__ < 6
258257

259-
#if __GNUG__ < 5
260-
// vec_xxpermdi in gcc4 missing little-endian supports just like clang
261-
# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ ((c & 1) << 1 | c >> 1)))
262-
// vec_packs doesn't support double words in gcc4
258+
// vec_packs doesn't support double words in gcc4 and old versions of gcc5
263259
# undef vec_packs
264260
VSX_REDIRECT_2RG(vec_char16, vec_short8, vec_packs, __builtin_vec_packs)
265261
VSX_REDIRECT_2RG(vec_uchar16, vec_ushort8, vec_packs, __builtin_vec_packs)
@@ -268,6 +264,11 @@ FORCE_INLINE(rt) fnm(const rg& a, const rg& b) \
268264

269265
VSX_IMPL_2VRG_F(vec_int4, vec_dword2, "vpksdss %0,%2,%1", vec_packs)
270266
VSX_IMPL_2VRG_F(vec_uint4, vec_udword2, "vpkudus %0,%2,%1", vec_packs)
267+
#endif // __GNUG__ < 6
268+
269+
#if __GNUG__ < 5
270+
// vec_xxpermdi in gcc4 missing little-endian supports just like clang
271+
# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ ((c & 1) << 1 | c >> 1)))
271272
#else
272273
# define vec_permi vec_xxpermdi
273274
#endif // __GNUG__ < 5

0 commit comments

Comments
 (0)