Skip to content

Avoid using v_signmask universal intrinsic and mark it as deprecated#14916

Merged
alalek merged 2 commits intoopencv:3.4from
terfendail:wsignmask_deprecated
Jul 1, 2019
Merged

Avoid using v_signmask universal intrinsic and mark it as deprecated#14916
alalek merged 2 commits intoopencv:3.4from
terfendail:wsignmask_deprecated

Conversation

@terfendail
Copy link
Copy Markdown
Contributor

@terfendail terfendail commented Jun 27, 2019

This pullrequest changes

Avoid using v_signmask universal intrinsic and mark it as deprecated

force_builders=Custom,Linux AVX2,ARMv7,ARMv8,Linux32,Win32
buildworker:Custom=linux-3
build_image:Custom=ubuntu:18.04
CPU_BASELINE:Custom=AVX512_SKX
build_image:Custom Win=msvs2019
CPU_BASELINE:Custom Win=AVX512_SKX

@terfendail terfendail force-pushed the wsignmask_deprecated branch 2 times, most recently from 6428a30 to 682890f Compare June 27, 2019 15:14
@terfendail terfendail force-pushed the wsignmask_deprecated branch from 682890f to cdc3a68 Compare June 28, 2019 13:21
int idx = v_heading_zeros(r); // idx = 2
@endcode
*/
template <typename _Tp, int n> inline int v_find_negative(const v_reg<_Tp, n>& a)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is about these names?

  • v_find_non_zero()
  • v_scan_non_zero()
  • v_scan_forward()
  • v_scan()

inline int v_find_negative(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); }
#if CV_SIMD128_64F
inline int v_find_negative(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); }
inline int v_find_negative(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is strange that CV_SIMD128_64F blocks int64 / uint64 processing.

@terfendail terfendail force-pushed the wsignmask_deprecated branch from 7330d59 to 5218736 Compare July 1, 2019 12:34
@terfendail terfendail force-pushed the wsignmask_deprecated branch from 5218736 to d0c8520 Compare July 1, 2019 12:41
Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you 👍

@alalek alalek merged commit 9befb7a into opencv:3.4 Jul 1, 2019
@terfendail terfendail deleted the wsignmask_deprecated branch July 2, 2019 10:52
@alalek alalek mentioned this pull request Jul 2, 2019
AhiyaHiya added a commit to AhiyaHiya/opencv that referenced this pull request Jul 7, 2019
* master: (74 commits)
  Merge pull request opencv#14917 from rgarnov:gapi_planar_kernels
  Fixed initUndistortRectifyMap AVX2 implementation
  Merge pull request opencv#14959 from dvd42:onnx_clip
  videoio: eliminate build warnings (clang)
  ts: runtime check for misused 'optional' test data files
  3rdparty(itt): support AARCH64
  tensroflow support maxpoolgrad
  Fix blob detector insertion sort
  Fix crash, add assert and test
  Merge pull request opencv#14946 from andrey-golubev:obj_not_ref
  re-enable CPU_BASELINE=FP16 on Armv7 platform
  Merge pull request opencv#14828 from armenpoghosov:parmen_RANSACPointSetRegistrator_getSubset_disaster_cleanup
  Merge pull request opencv#14916 from terfendail:wsignmask_deprecated
  core: evaluate CV_Error() parameters during static scans
  dnn: fix build with Vulkan
  Merge pull request opencv#14936 from StefanBruens:crosscorr_cleanup
  Explicitly default operator= for Vec<T, n>
  Fix JS sample of dnn
  3rdparty: TBB version 2018u1 => 2019u8
  cmake: support rpath-link linker option
  ...
@ChipKerchner
Copy link
Copy Markdown
Contributor

ChipKerchner commented Aug 21, 2019

Why are we deprecating v_signmask? It's a useful instruction.

I don't agree changing the flags to a char array is the best here.

@alalek
Copy link
Copy Markdown
Member

alalek commented Aug 21, 2019

There is "wide universal intrinsics (w.u.i.)" API over SIMD128 / SIMD256 / SIMD512 (depends on current compilation flags). So we are trying to unify APIs if possible (however it doesn't work well for reductions).

v_signmask() in case of SIMD512 doesn't fit well into 32-bit int (u8 x 64 elements).

@ChipKerchner
Copy link
Copy Markdown
Contributor

BTW, IMO v_signmask should return an 'unsigned int' and not an 'int'

arnaudbrejeon pushed a commit to arnaudbrejeon/opencv that referenced this pull request Jan 23, 2020
* Avoid using v_signmask universal intrinsic and mark it as deprecated

* Renamed v_find_negative to v_scan_forward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants