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/] [s_fma.c] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/*
/*
FUNCTION
FUNCTION
<<fma>>, <<fmaf>>--floating multiply add
<<fma>>, <<fmaf>>--floating multiply add
INDEX
INDEX
        fma
        fma
INDEX
INDEX
        fmaf
        fmaf
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double fma(double <[x]>, double <[y]>, double <[z]>);
        double fma(double <[x]>, double <[y]>, double <[z]>);
        float fmaf(float <[x]>, float <[y]>, float <[z]>);
        float fmaf(float <[x]>, float <[y]>, float <[z]>);
 
 
DESCRIPTION
DESCRIPTION
The <<fma>> functions compute (<[x]> * <[y]>) + <[z]>, rounded as one ternary
The <<fma>> functions compute (<[x]> * <[y]>) + <[z]>, rounded as one ternary
operation:  they compute the value (as if) to infinite precision and round once
operation:  they compute the value (as if) to infinite precision and round once
to the result format, according to the rounding mode characterized by the value
to the result format, according to the rounding mode characterized by the value
of FLT_ROUNDS.  That is, they are supposed to do this:  see below.
of FLT_ROUNDS.  That is, they are supposed to do this:  see below.
 
 
RETURNS
RETURNS
The <<fma>> functions return (<[x]> * <[y]>) + <[z]>, rounded as one ternary
The <<fma>> functions return (<[x]> * <[y]>) + <[z]>, rounded as one ternary
operation.
operation.
 
 
BUGS
BUGS
This implementation does not provide the function that it should, purely
This implementation does not provide the function that it should, purely
returning "(<[x]> * <[y]>) + <[z]>;" with no attempt at all to provide the
returning "(<[x]> * <[y]>) + <[z]>;" with no attempt at all to provide the
simulated infinite precision intermediates which are required.  DO NOT USE THEM.
simulated infinite precision intermediates which are required.  DO NOT USE THEM.
 
 
If double has enough more precision than float, then <<fmaf>> should provide
If double has enough more precision than float, then <<fmaf>> should provide
the expected numeric results, as it does use double for the calculation.  But
the expected numeric results, as it does use double for the calculation.  But
since this is not the case for all platforms, this manual cannot determine
since this is not the case for all platforms, this manual cannot determine
if it is so for your case.
if it is so for your case.
 
 
PORTABILITY
PORTABILITY
ANSI C, POSIX.
ANSI C, POSIX.
 
 
*/
*/
 
 
#include "fdlibm.h"
#include "fdlibm.h"
 
 
#ifndef _DOUBLE_IS_32BITS
#ifndef _DOUBLE_IS_32BITS
 
 
#ifdef __STDC__
#ifdef __STDC__
        double fma(double x, double y, double z)
        double fma(double x, double y, double z)
#else
#else
        double fma(x,y)
        double fma(x,y)
        double x;
        double x;
        double y;
        double y;
        double z;
        double z;
#endif
#endif
{
{
  /* Implementation defined. */
  /* Implementation defined. */
  return (x * y) + z;
  return (x * y) + z;
}
}
 
 
#endif /* _DOUBLE_IS_32BITS */
#endif /* _DOUBLE_IS_32BITS */
 
 

powered by: WebSVN 2.1.0

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