Floating-point operations (7) in VDSP (bf561): float multiplication operation

Source: Internet
Author: User

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

*********************************************** ***************/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.