I have to calculate some floating point divisions. I saw that some manufacturers have implemented some floating point reciprocal approximations.

Do you provide some features to do that with sharc architecture ?

I have to calculate some floating point divisions. I saw that some manufacturers have implemented some floating point reciprocal approximations.

Do you provide some features to do that with sharc architecture ?

Hi Zanzibar,

The SHARC processor supports the RECIPS instruction which can be used to calculate the reciprocal. The PRM provides an algorithm to calculate the division using this instruction. Please refer the below information on page 516 of the ADSP-2136x PRM for more details:

The following code performs floating-point division using an iterative convergence algorithm. The result is accurate to one LSB in whichever

format mode, 32-bit or 40-bit, is set. The following inputs are required:

F0=numerator, F12=denominator, F11=2.0. The quotient is returned in F0. (The two indented instructions can be removed if only a ±1 LSB accurate

single-precision result is necessary.) Note that, in the algorithm example’s comments, references to R0, R1, R2, and R3 do not refer to

data registers. Rather, they refer to variables in the algorithm.

F0=RECIPS F12, F7=F0; /* Get 8-bit seed R0=1/D */

F12=F0*F12; /* D' = D*R0 */

F7=F0*F7, F0=F11-F12; /* F0=R1=2-D', F7=N*R0 */

F12=F0*F12; /* F12=D'-D'*R1 */

F7=F0*F7, F0=F11-F12; /* F7=N*R0*R1, F0=R2=2-D' */

F12=F0*F12; /* F12=D'=D'*R2 */

F7=F0*F7, F0=F11-F12; /* F7=N*R0*R1*R2, F0=R3=2-D' */

F0=F0*F7; /* F7=N*R0*R1*R2*R3 */

To make this code segment a subroutine, add an RTS(DB) clause to the third-to-last instruction.

Best Regards,

Jeyanthi

Hi Zanzibar,

The SHARC processor supports the RECIPS instruction which can be used to calculate the reciprocal. The PRM provides an algorithm to calculate the division using this instruction. Please refer the below information on page 516 of the ADSP-2136x PRM for more details:

The following code performs floating-point division using an iterative convergence algorithm. The result is accurate to one LSB in whichever

format mode, 32-bit or 40-bit, is set. The following inputs are required:

F0=numerator, F12=denominator, F11=2.0. The quotient is returned in F0. (The two indented instructions can be removed if only a ±1 LSB accurate

single-precision result is necessary.) Note that, in the algorithm example’s comments, references to R0, R1, R2, and R3 do not refer to

data registers. Rather, they refer to variables in the algorithm.

F0=RECIPS F12, F7=F0; /* Get 8-bit seed R0=1/D */

F12=F0*F12; /* D' = D*R0 */

F7=F0*F7, F0=F11-F12; /* F0=R1=2-D', F7=N*R0 */

F12=F0*F12; /* F12=D'-D'*R1 */

F7=F0*F7, F0=F11-F12; /* F7=N*R0*R1, F0=R2=2-D' */

F12=F0*F12; /* F12=D'=D'*R2 */

F7=F0*F7, F0=F11-F12; /* F7=N*R0*R1*R2, F0=R3=2-D' */

F0=F0*F7; /* F7=N*R0*R1*R2*R3 */

To make this code segment a subroutine, add an RTS(DB) clause to the third-to-last instruction.

Best Regards,

Jeyanthi