@@ -4261,7 +4261,9 @@ int normHamming(const uchar* a, int n)
4261
4261
_r0 = _mm256_add_epi32 (_r0, _mm256_shuffle_epi32 (_r0, 2 ));
4262
4262
result = _mm256_extract_epi32_ (_mm256_add_epi32 (_r0, _mm256_permute2x128_si256 (_r0, _r0, 1 )), 0 );
4263
4263
}
4264
- #elif CV_POPCNT
4264
+ #endif // CV_AVX2
4265
+
4266
+ #if CV_POPCNT
4265
4267
if (checkHardwareSupport (CV_CPU_POPCNT))
4266
4268
{
4267
4269
# if defined CV_POPCNT_U64
@@ -4275,17 +4277,20 @@ int normHamming(const uchar* a, int n)
4275
4277
result += CV_POPCNT_U32 (*(uint*)(a + i));
4276
4278
}
4277
4279
}
4278
- #elif CV_SIMD128
4280
+ #endif // CV_POPCNT
4281
+
4282
+ #if CV_SIMD128
4279
4283
if (hasSIMD128 ())
4280
4284
{
4281
4285
v_uint32x4 t = v_setzero_u32 ();
4282
4286
for (; i <= n - v_uint8x16::nlanes; i += v_uint8x16::nlanes)
4283
4287
{
4284
4288
t += v_popcount (v_load (a + i));
4285
4289
}
4286
- result = v_reduce_sum (t);
4290
+ result + = v_reduce_sum (t);
4287
4291
}
4288
- #endif
4292
+ #endif // CV_SIMD128
4293
+
4289
4294
for (; i <= n - 4 ; i += 4 )
4290
4295
{
4291
4296
result += popCountTable[a[i]] + popCountTable[a[i+1 ]] +
@@ -4327,7 +4332,9 @@ int normHamming(const uchar* a, const uchar* b, int n)
4327
4332
_r0 = _mm256_add_epi32 (_r0, _mm256_shuffle_epi32 (_r0, 2 ));
4328
4333
result = _mm256_extract_epi32_ (_mm256_add_epi32 (_r0, _mm256_permute2x128_si256 (_r0, _r0, 1 )), 0 );
4329
4334
}
4330
- #elif CV_POPCNT
4335
+ #endif // CV_AVX2
4336
+
4337
+ #if CV_POPCNT
4331
4338
if (checkHardwareSupport (CV_CPU_POPCNT))
4332
4339
{
4333
4340
# if defined CV_POPCNT_U64
@@ -4341,17 +4348,20 @@ int normHamming(const uchar* a, const uchar* b, int n)
4341
4348
result += CV_POPCNT_U32 (*(uint*)(a + i) ^ *(uint*)(b + i));
4342
4349
}
4343
4350
}
4344
- #elif CV_SIMD128
4351
+ #endif // CV_POPCNT
4352
+
4353
+ #if CV_SIMD128
4345
4354
if (hasSIMD128 ())
4346
4355
{
4347
4356
v_uint32x4 t = v_setzero_u32 ();
4348
4357
for (; i <= n - v_uint8x16::nlanes; i += v_uint8x16::nlanes)
4349
4358
{
4350
4359
t += v_popcount (v_load (a + i) ^ v_load (b + i));
4351
4360
}
4352
- result = v_reduce_sum (t);
4361
+ result + = v_reduce_sum (t);
4353
4362
}
4354
- #endif
4363
+ #endif // CV_SIMD128
4364
+
4355
4365
for (; i <= n - 4 ; i += 4 )
4356
4366
{
4357
4367
result += popCountTable[a[i] ^ b[i]] + popCountTable[a[i+1 ] ^ b[i+1 ]] +
0 commit comments