当前位置:七道奇文章资讯编程技术VC/C++编程
日期:2011-03-22 13:54:00  来源:本站整理

Vdsp(bf561)中的浮点运算(7):float乘法运算[VC/C++编程]

赞助商链接



  本文“Vdsp(bf561)中的浮点运算(7):float乘法运算[VC/C++编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

1.1 Vdsp对float乘法运算的处理

在vdsp下,可以很简单地用:

float mul (float x, float y)
{
float r = x * y;
return r;
}

来完成浮点乘法运算,编译器自动将里面的乘法操作转换为___float32_mul的函数调用,这个函数的调用实目前libdsp/fpmult.asm中,在这个文件的开首阐明了这个函数的用法:

/***************************************************************************
Copyright (c) 2000-2008 Analog Devices Inc. All rights reserved.

****************************************************************************
File name :  fpmult.asm

This function performs 32 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 testcases.

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 0xFF80000
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- Uses non-standard clobber set in compiler:
DefaultClobMinusBIMandLoopRegs

Remember to change the #pragma regs_clobbered in fpmult.c in softfloat if you
change this clobber set

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


  以上是“Vdsp(bf561)中的浮点运算(7):float乘法运算[VC/C++编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:

  • Vdsp(bf561)中的浮点运算(7):float乘法运算
  • Vdsp(bf561)中的浮点运算(8):float除法运算
  • Vdsp(bf561)中的浮点运算(9):long double和float的对比
  • <b>Vdsp(bf561)中的浮点运算(10):fract16范例表示</b>
  • Vdsp(bf561)中的浮点运算(11):fract16与float的转换
  • Vdsp(bf561)中的浮点运算(12):fract16加减运算
  • <b>Vdsp(bf561)中的浮点运算(13):fract16乘法运算</b>
  • <b>Vdsp(bf561)中的浮点运算(14):fract16除法</b>
  • Vdsp(bf561)中的浮点运算(15):vdsp库的一个BUG
  • Vdsp(bf561)中的浮点运算(16):fract2x16范例
  • Vdsp(bf561)中的浮点运算(3):FLT_MIN
  • <b>Vdsp(bf561)中的浮点运算(4):FLT_MAX</b>
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .