The processing of 1.1 VDSP to float division operation
Under VDSP, you can easily use:
float fdiv(float x, float y)
{
float r = x / y;
return r;
}
To complete the floating-point division operation, the compiler automatically converts the multiplication inside to the ___float32_div function call, which is implemented in Libdsp/fpdiv.asm, which describes the use of the function at the beginning of the file:
/******************************************************************************
Copyright (c) 2000-2008 Analog Devices Inc. IPDC BANGALORE, India.
All rights reserved
******************************************************************************
File Name:fpdiv32.asm
Module name:floating Point Division
Label Name: __float32_div
Descript The Ion:this function computes single precision signed the floating point
Division. Implemention is based on the algorithm mentioned in
the reference. Some more conditions are added at the present
algorithm to take care of various testcases.
Registers used:
operands in R0 & R1
R0-numerator (X), R1-denominator (Y)
R2-r7 and P1
*********
Special Cases:
1 If (X = = 0) return 0.0 o r-0.0 depending on sign of x,y
2) if (Y = = 0) return INF or-inf depending on sign of x,y
3) If (X = = Y) return 1.0 or-1.0 depending on sign of x,y
4) If (y = = 1) return X or-x depending on sign of x,y
5) Underflow:if (exp (x)-exp (y) < -149), return 0,
6) Overflow:if ((exp (x)-exp (y) + 126) > 254), Return NA N Or-nan
Depending on sign of x,y
Reference:computer Architecture A quantitative approach
second EDI tion
by John l Hennessy and David Patterson
!! Note-uses non-standard clobber set in compiler:
Defaultclobminuspabimandloop1regs
Remember to change the #pr Agma regs_clobbered in fpdiv.c in Softfloat if your
change this clobber set
********************************** **********************************************/