The processing of 1.1 vdsp to float multiplication operation
Under VDSP, you can easily use:
float mul (float x, float y)
{
float r = x * y;
return r;
}
To complete the floating-point multiplication operation, the compiler automatically converts the multiplication operation inside into a ___float32_mul function call, which is implemented in Libdsp/fpmult.asm, where the function is described at the beginning of the file:
/***************************************************************************
Copyright (c) 2000-2008 Analog Devices Inc. All rights reserved.
****************************************************************************
File name:fpmult.asm The
This function performs the bit floating point multiplication. Implemention
is based on the algorithm mentioned in the reference. Some more ConditionS
are added in the present algorithm to take care of various.
Registers used:
operands in R0 & R1
r0-x operand,
r1-y operand
r2-r7
Special Case:
1) If (x and y) = = 0, return 0,
2) OVERFLOW:IF (exp (x) + Exp (y) > 254,
return 0x7f80000 or 0XFF80
Depending upon sign of X and Y.
3) underflow:if (exp (X) + exp (y) <= -149, return 0.
Reference:computer Architecture A quantitative approach 2nd Ed.
by Jhon L Hennessy and David Patterson
!! Note-usesNon-standard clobber set in compiler:
Defaultclobminusbimandloopregs
Remember to change the #pragma regs_clob Bered in fpmult.c into softfloat if you are
change this clobber set
*********************************************** ***************/