newlib-cygwin/newlib/libc/machine/necv70/necv70.tex

100 lines
3.0 KiB
TeX
Raw Normal View History

2000-02-18 03:39:52 +08:00
@node machine,,syscalls,Top
@chapter NEC V70 Specific Functions
2003-10-20 Bob Wilson <bob.wilson@acm.org> * libc/locale/locale.c: Use double quotes in code. * libc/locale/locale.tex: Likewise. * libc/libc.texinfo: Hyphenate "floating-point". * libc/machine/necv70/necv70.tex: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/sscanf.c: Likewise. * libc/stdlib/atof.c: Likewise. * libc/stdlib/ldtoa.c: Fix comment typo. * libc/stdlib/div.c: Use @ifnottex instead of @ifinfo. * libc/stdlib/ldiv.c: Likewise. * libm/common/s_expm1.c: Likewise. * libm/common/s_ilogb.c: Hyphenate "floating-point". Use "nonzero". * libm/common/s_infinity: Hyphenate "double- and single-precision". * libm/common/s_nan.c: Likewise. Also correct the FUNCTION summary. * libm/common/s_nextafter.c: Fix typo. Hyphenate "double-precision" and "floating-point". * libm/common/s_scalbn.c: Correct the FUNCTION summary. * libm/math/e_pow.c: Fix comment typo. * libm/math/math.tex: Hyphenate "single-precision" and "floating-point". * libm/math/s_asinh.c: Use @ifnottex instead of @ifinfo. * libm/math/s_atan.c: Likewise. * libm/math/s_frexp.c: Likewise. Also use "nonzero". * libm/math/s_isnan.c: Hyphenate "single-precision" and "floating-point". Use "nonzero". * libm/math/s_ldexp.c: Use @ifnottex instead of @ifinfo. * libm/math/w_acos.c: Likewise. * libm/math/w_acosh.c: Likewise. * libm/math/w_asin.c: Likewise. * libm/math/w_atan2.c: Likewise. * libm/math/w_atanh.c: Likewise. * libm/math/w_cosh.c: Likewise. * libm/math/w_exp.c: Likewise. * libm/math/w_exp2.c: Likewise. Add missing @end and missing @tex version of 2^x in the description. * libm/math/w_fmod.c: Use @ifnottex instead of @ifinfo. * libm/math/w_gamma.c: Likewise. * libm/math/w_hypot.c: Likewise. * libm/math/w_j0.c: Likewise. * libm/math/w_sinh.c: Likewise. * libm/math/w_pow.c: Replace "exp1.0nt" with "exponent". * libm/mathfp/mathfp.tex: Hyphenate "single-precision" and "floating-point". * libm/mathfp/e_acosh.c: Use @ifnottex instead of @ifinfo. * libm/mathfp/e_atanh.c: Likewise. * libm/mathfp/e_hypot.c: Likewise. * libm/mathfp/er_lgamma.c: Likewise. * libm/mathfp/s_acos.c: Likewise. * libm/mathfp/s_asine.c: Likewise. * libm/mathfp/s_asinh.c: Likewise. * libm/mathfp/s_atan.c: Likewise. * libm/mathfp/s_atan2.c: Likewise. * libm/mathfp/s_atangent.c: Likewise. * libm/mathfp/s_cosh.c: Likewise. * libm/mathfp/s_exp.c: Likewise. * libm/mathfp/s_fmod.c: Likewise. * libm/mathfp/s_frexp.c: Likewise. Also use "nonzero". * libm/mathfp/s_isnan.c: Hyphenate "single-precision" and "floating-point". Use "nonzero". * libm/math/s_pow.c: Replace "exp1.0nt" with "exponent". * libm/mathfp/s_ldexp.c: Use @ifnottex instead of @ifinfo. * libm/mathfp/s_sineh.c: Likewise. * libm/mathfp/w_jn.c: Likewise.
2003-10-21 02:46:38 +08:00
The NEC V70 has machine instructions for fast IEEE floating-point
arithmetic, including operations normally provided by the library.
2000-02-18 03:39:52 +08:00
When you use the @file{/usr/include/fastmath.h} header file, the
names of several library math functions are redefined to call the
@code{fastmath} routine (using the corresponding V70 machine instructions)
whenever possible.
For example,
@example
#include <fastmath.h>
double sqsin(x)
double x;
@{
return sin(x*x);
@}
@end example
expands into the code
@example
@dots{}
double sqsin(x)
double x;
@{
return fast_sin(x*x);
@}
@end example
The library has an entry @code{fast_sin} which uses the machine
instruction @code{fsin.l} to perform the operation. Note that the
built-in instructions cannot set @code{errno}
2000-02-18 03:39:52 +08:00
in the same way that the C coded functions do. Refer to a V70
instruction manual to see how errors are generated and handled.
Also, the library provides true @code{float} entry points. The
@code{fast_sinf} entry point really performs a @code{fsin.s}
operation. Because of this, the instructions are only useful when
using code compiled with an ANSI C compiler. The prototypes
2003-10-20 Bob Wilson <bob.wilson@acm.org> * libc/locale/locale.c: Use double quotes in code. * libc/locale/locale.tex: Likewise. * libc/libc.texinfo: Hyphenate "floating-point". * libc/machine/necv70/necv70.tex: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/sscanf.c: Likewise. * libc/stdlib/atof.c: Likewise. * libc/stdlib/ldtoa.c: Fix comment typo. * libc/stdlib/div.c: Use @ifnottex instead of @ifinfo. * libc/stdlib/ldiv.c: Likewise. * libm/common/s_expm1.c: Likewise. * libm/common/s_ilogb.c: Hyphenate "floating-point". Use "nonzero". * libm/common/s_infinity: Hyphenate "double- and single-precision". * libm/common/s_nan.c: Likewise. Also correct the FUNCTION summary. * libm/common/s_nextafter.c: Fix typo. Hyphenate "double-precision" and "floating-point". * libm/common/s_scalbn.c: Correct the FUNCTION summary. * libm/math/e_pow.c: Fix comment typo. * libm/math/math.tex: Hyphenate "single-precision" and "floating-point". * libm/math/s_asinh.c: Use @ifnottex instead of @ifinfo. * libm/math/s_atan.c: Likewise. * libm/math/s_frexp.c: Likewise. Also use "nonzero". * libm/math/s_isnan.c: Hyphenate "single-precision" and "floating-point". Use "nonzero". * libm/math/s_ldexp.c: Use @ifnottex instead of @ifinfo. * libm/math/w_acos.c: Likewise. * libm/math/w_acosh.c: Likewise. * libm/math/w_asin.c: Likewise. * libm/math/w_atan2.c: Likewise. * libm/math/w_atanh.c: Likewise. * libm/math/w_cosh.c: Likewise. * libm/math/w_exp.c: Likewise. * libm/math/w_exp2.c: Likewise. Add missing @end and missing @tex version of 2^x in the description. * libm/math/w_fmod.c: Use @ifnottex instead of @ifinfo. * libm/math/w_gamma.c: Likewise. * libm/math/w_hypot.c: Likewise. * libm/math/w_j0.c: Likewise. * libm/math/w_sinh.c: Likewise. * libm/math/w_pow.c: Replace "exp1.0nt" with "exponent". * libm/mathfp/mathfp.tex: Hyphenate "single-precision" and "floating-point". * libm/mathfp/e_acosh.c: Use @ifnottex instead of @ifinfo. * libm/mathfp/e_atanh.c: Likewise. * libm/mathfp/e_hypot.c: Likewise. * libm/mathfp/er_lgamma.c: Likewise. * libm/mathfp/s_acos.c: Likewise. * libm/mathfp/s_asine.c: Likewise. * libm/mathfp/s_asinh.c: Likewise. * libm/mathfp/s_atan.c: Likewise. * libm/mathfp/s_atan2.c: Likewise. * libm/mathfp/s_atangent.c: Likewise. * libm/mathfp/s_cosh.c: Likewise. * libm/mathfp/s_exp.c: Likewise. * libm/mathfp/s_fmod.c: Likewise. * libm/mathfp/s_frexp.c: Likewise. Also use "nonzero". * libm/mathfp/s_isnan.c: Hyphenate "single-precision" and "floating-point". Use "nonzero". * libm/math/s_pow.c: Replace "exp1.0nt" with "exponent". * libm/mathfp/s_ldexp.c: Use @ifnottex instead of @ifinfo. * libm/mathfp/s_sineh.c: Likewise. * libm/mathfp/w_jn.c: Likewise.
2003-10-21 02:46:38 +08:00
and definitions for the floating-point versions of the math library
2000-02-18 03:39:52 +08:00
routines are only defined if compiling a module with an ANSI C
compiler.
@page
@section Entry points
The functions provided by @file{fastmath.h} are
@example
double fast_sin(double); /* fsin.l */
double fast_cos(double); /* fcos.l */
double fast_tan(double); /* ftan.l */
double fast_asin(double); /* fasin.l */
double fast_acos(double); /* facos.l */
double fast_atan(double); /* fatan.l */
double fast_sinh(double); /* fsinh.l */
double fast_cosh(double); /* fcosh.l */
double fast_tanh(double); /* ftanh.l */
double fast_asinh(double); /* fasinh.l */
double fast_acosh(double); /* facosh.l */
double fast_atanh(double); /* fatanh.l */
double fast_fabs(double); /* fabs.l */
double fast_sqrt(double); /* fsqrt.l */
double fast_exp2(double); /* fexp2.l */
double fast_exp10(double); /* fexp10.l */
double fast_expe(double); /* fexpe.l */
double fast_log10(double); /* flog10.l */
double fast_log2(double); /* flog2.l */
double fast_loge(double); /* floge.l */
float fast_sinf(float); /* fsin.s */
float fast_cosf(float); /* fcos.s */
float fast_tanf(float); /* ftan.s */
float fast_asinf(float); /* fasin.s */
float fast_acosf(float); /* facos.s */
float fast_atanf(float); /* fatan.s */
float fast_sinhf(float); /* fsinh.s */
float fast_coshf(float); /* fcosh.s */
float fast_tanhf(float); /* ftanh.s */
float fast_asinhf(float); /* fasinh.s */
float fast_acoshf(float); /* facosh.s */
float fast_atanhf(float); /* fatanh.s */
float fast_fabsf(float); /* fabs.s */
float fast_sqrtf(float); /* fsqrt.s */
float fast_exp2f(float); /* fexp2.s */
float fast_exp10f(float); /* fexp10.s */
float fast_expef(float); /* fexpe.s */
float fast_log10f(float); /* flog10.s */
float fast_log2f(float); /* flog2.s */
float fast_logef(float); /* floge.s */
@end example