OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [common/] [sf_fma.c] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Copyright (C) 2002 by  Red Hat, Incorporated. All rights reserved.
2
 *
3
 * Permission to use, copy, modify, and distribute this software
4
 * is freely granted, provided that this notice is preserved.
5
 */
6
 
7
#include "fdlibm.h"
8
 
9
#ifdef __STDC__
10
        float fmaf(float x, float y, float z)
11
#else
12
        float fmaf(x,y,z)
13
        float x;
14
        float y;
15
        float z;
16
#endif
17
{
18
  /* NOTE:  The floating-point exception behavior of this is not as
19
   * required.  But since the basic function is not really done properly,
20
   * it is not worth bothering to get the exceptions right, either.  */
21
  /* Let the implementation handle this. */ /* <= NONSENSE! */
22
  /* In floating-point implementations in which double is larger than float,
23
   * computing as double should provide the desired function.  Otherwise,
24
   * the behavior will not be as specified in the standards.  */
25
  return (float) (((double) x * (double) y) + (double) z);
26
}
27
 
28
#ifdef _DOUBLE_IS_32BITS
29
 
30
#ifdef __STDC__
31
        double fma(double x, double y, double z)
32
#else
33
        double fma(x,y,z)
34
        double x;
35
        double y;
36
        double z;
37
#endif
38
{
39
  return (double) fmaf((float) x, (float) y, (float) z);
40
}
41
 
42
#endif /* defined(_DOUBLE_IS_32BITS) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.