The sp_vecrecip module calculates the reciprocal of each element in the array x and returns the output in array r. It uses 2 iterations of the Newton-Raphson method to improve the accuracy of the output generated by the RCPSP instruction generated by RCPSP is 8 bits. So after the first iteration it is 16 bits and after the second it is the full 23 bits. The formula used is:
r[n+1] = r[n](2 - v*r[n])
where v = the number whose reciprocal is to be found.
x[0], the seed value for the algorithm, is given by RCPSP.
@param x Pointer to input array.
@param y Pointer to output array.
@param nx Number of elements in arrays.
- Algorithm:
- DSPF_sp_vecrecip_cn.c is the natural C equivalent of the optimized linear assembly code without restrictions. Note that the linear assembly code is optimized and restrictions may apply.
- Assumptions:
- nx is a multiple of 4 and >= 4.
x and y are double word aligned.
- Implementation Notes:
- Interruptibility: The code is interruptible.
Endian Support: The code supports both big and little endian modes.