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/] [libc/] [machine/] [necv70/] [necv70.tex] - Diff between revs 207 and 345

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

Rev 207 Rev 345
@node machine,,syscalls,Top
@node machine,,syscalls,Top
@chapter NEC V70 Specific Functions
@chapter NEC V70 Specific Functions
 
 
The NEC V70 has machine instructions for fast IEEE floating-point
The NEC V70 has machine instructions for fast IEEE floating-point
arithmetic, including operations normally provided by the library.
arithmetic, including operations normally provided by the library.
 
 
When you use the @file{/usr/include/fastmath.h} header file, the
When you use the @file{/usr/include/fastmath.h} header file, the
names of several library math functions are redefined to call the
names of several library math functions are redefined to call the
@code{fastmath} routine (using the corresponding V70 machine instructions)
@code{fastmath} routine (using the corresponding V70 machine instructions)
whenever possible.
whenever possible.
 
 
For example,
For example,
@example
@example
 
 
#include <fastmath.h>
#include <fastmath.h>
 
 
double sqsin(x)
double sqsin(x)
double x;
double x;
@{
@{
  return sin(x*x);
  return sin(x*x);
@}
@}
 
 
@end example
@end example
expands into the code
expands into the code
@example
@example
 
 
@dots{}
@dots{}
double sqsin(x)
double sqsin(x)
double x;
double x;
@{
@{
  return fast_sin(x*x);
  return fast_sin(x*x);
@}
@}
 
 
@end example
@end example
 
 
The library has an entry @code{fast_sin} which uses the machine
The library has an entry @code{fast_sin} which uses the machine
instruction @code{fsin.l} to perform the operation.  Note that the
instruction @code{fsin.l} to perform the operation.  Note that the
built-in instructions cannot call @code{matherr} or set @code{errno}
built-in instructions cannot call @code{matherr} or set @code{errno}
in the same way that the C coded functions do.  Refer to a V70
in the same way that the C coded functions do.  Refer to a V70
instruction manual to see how errors are generated and handled.
instruction manual to see how errors are generated and handled.
 
 
Also, the library provides true @code{float} entry points.  The
Also, the library provides true @code{float} entry points.  The
@code{fast_sinf} entry point really performs a @code{fsin.s}
@code{fast_sinf} entry point really performs a @code{fsin.s}
operation.  Because of this, the instructions are only useful when
operation.  Because of this, the instructions are only useful when
using code compiled with an ANSI C compiler.  The prototypes
using code compiled with an ANSI C compiler.  The prototypes
and definitions for the floating-point versions of the math library
and definitions for the floating-point versions of the math library
routines are only defined if compiling a module with an ANSI C
routines are only defined if compiling a module with an ANSI C
compiler.
compiler.
 
 
@page
@page
@section Entry points
@section Entry points
The functions provided by @file{fastmath.h} are
The functions provided by @file{fastmath.h} are
@example
@example
 
 
 double fast_sin(double);       /*      fsin.l */
 double fast_sin(double);       /*      fsin.l */
 double fast_cos(double);       /*      fcos.l */
 double fast_cos(double);       /*      fcos.l */
 double fast_tan(double);       /*      ftan.l */
 double fast_tan(double);       /*      ftan.l */
 double fast_asin(double);      /*      fasin.l */
 double fast_asin(double);      /*      fasin.l */
 double fast_acos(double);      /*      facos.l */
 double fast_acos(double);      /*      facos.l */
 double fast_atan(double);      /*      fatan.l */
 double fast_atan(double);      /*      fatan.l */
 double fast_sinh(double);      /*      fsinh.l */
 double fast_sinh(double);      /*      fsinh.l */
 double fast_cosh(double);      /*      fcosh.l */
 double fast_cosh(double);      /*      fcosh.l */
 double fast_tanh(double);      /*      ftanh.l */
 double fast_tanh(double);      /*      ftanh.l */
 double fast_asinh(double);     /*      fasinh.l */
 double fast_asinh(double);     /*      fasinh.l */
 double fast_acosh(double);     /*      facosh.l */
 double fast_acosh(double);     /*      facosh.l */
 double fast_atanh(double);     /*      fatanh.l */
 double fast_atanh(double);     /*      fatanh.l */
 double fast_fabs(double);      /*      fabs.l */
 double fast_fabs(double);      /*      fabs.l */
 double fast_sqrt(double);      /*      fsqrt.l */
 double fast_sqrt(double);      /*      fsqrt.l */
 double fast_exp2(double);      /*      fexp2.l */
 double fast_exp2(double);      /*      fexp2.l */
 double fast_exp10(double);     /*      fexp10.l */
 double fast_exp10(double);     /*      fexp10.l */
 double fast_expe(double);      /*      fexpe.l */
 double fast_expe(double);      /*      fexpe.l */
 double fast_log10(double);     /*      flog10.l */
 double fast_log10(double);     /*      flog10.l */
 double fast_log2(double);      /*      flog2.l */
 double fast_log2(double);      /*      flog2.l */
 double fast_loge(double);      /*      floge.l */
 double fast_loge(double);      /*      floge.l */
 
 
 float fast_sinf(float);        /*      fsin.s */
 float fast_sinf(float);        /*      fsin.s */
 float fast_cosf(float);        /*      fcos.s */
 float fast_cosf(float);        /*      fcos.s */
 float fast_tanf(float);        /*      ftan.s */
 float fast_tanf(float);        /*      ftan.s */
 float fast_asinf(float);       /*      fasin.s */
 float fast_asinf(float);       /*      fasin.s */
 float fast_acosf(float);       /*      facos.s */
 float fast_acosf(float);       /*      facos.s */
 float fast_atanf(float);       /*      fatan.s */
 float fast_atanf(float);       /*      fatan.s */
 float fast_sinhf(float);       /*      fsinh.s */
 float fast_sinhf(float);       /*      fsinh.s */
 float fast_coshf(float);       /*      fcosh.s */
 float fast_coshf(float);       /*      fcosh.s */
 float fast_tanhf(float);       /*      ftanh.s */
 float fast_tanhf(float);       /*      ftanh.s */
 float fast_asinhf(float);      /*      fasinh.s */
 float fast_asinhf(float);      /*      fasinh.s */
 float fast_acoshf(float);      /*      facosh.s */
 float fast_acoshf(float);      /*      facosh.s */
 float fast_atanhf(float);      /*      fatanh.s */
 float fast_atanhf(float);      /*      fatanh.s */
 float fast_fabsf(float);       /*      fabs.s */
 float fast_fabsf(float);       /*      fabs.s */
 float fast_sqrtf(float);       /*      fsqrt.s */
 float fast_sqrtf(float);       /*      fsqrt.s */
 float fast_exp2f(float);       /*      fexp2.s */
 float fast_exp2f(float);       /*      fexp2.s */
 float fast_exp10f(float);      /*      fexp10.s */
 float fast_exp10f(float);      /*      fexp10.s */
 float fast_expef(float);       /*      fexpe.s */
 float fast_expef(float);       /*      fexpe.s */
 float fast_log10f(float);      /*      flog10.s */
 float fast_log10f(float);      /*      flog10.s */
 float fast_log2f(float);       /*      flog2.s */
 float fast_log2f(float);       /*      flog2.s */
 float fast_logef(float);       /*      floge.s */
 float fast_logef(float);       /*      floge.s */
 
 
@end example
@end example
 
 
 
 
 
 

powered by: WebSVN 2.1.0

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