Add RISC-V HAL implementation for fastAtan32f/fastAtan64f#26853
Add RISC-V HAL implementation for fastAtan32f/fastAtan64f#26853asmorkalov merged 1 commit intoopencv:4.xfrom
Conversation
| namespace cv::cv_hal_rvv { | ||
|
|
||
| namespace detail { | ||
| // ref: mathfuncs_core.simd.hpp |
There was a problem hiding this comment.
Could you add reference to the computation method, name, formula, whatever to identify the approach? Constants meaning and other arithmetic details will be more obvious with such details.
There was a problem hiding this comment.
This implementation didn't introduce any new math approach, the constants were simply polynomial coefficients copied from
opencv/modules/core/src/mathfuncs_core.simd.hpp
Lines 36 to 39 in 08a24ba
Presumably it's a 7th degree polynomial approximation for Arctan(x) where x in [0, 1], the optimal coefficients can be evaluated using Remez algorithm I guess?
Should I add this in my code comment, or add them to mathfuncs_core.simd.hpp
| // ref: mathfuncs_core.simd.hpp | |
| // ref: mathfuncs_core.simd.hpp, 7th degree polynomial form Remez algorithm? |
|
@horror-proton, thank you! @asmorkalov, @mshabunin, I don't quite like that we have many small .h files, but this is not a problem of this PR, it just follows the current style. Maybe we should revise and make more manageable. |
Current universal intrinsic implementation of
fastAtan32f_inmathfuncs_core.simd.hppdoes not work for RVV (CV_SIMD_SCALABLE) so it falls back to scalar method.This pull request adds an HAL implementation as a workaround allowing it to benefit form RVV vectorization.
Tested on Spacemit X60 cpu:
gcc version 14.2.1
clang version 19.1.7
All of which were compiled with
-O2enabled.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.