Floating-point operations (8) in VDSP (bf561): Float Division operations

Source: Internet
Author: User

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

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

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.