source: trunk/libs/newlib/src/newlib/libc/machine/necv70/necv70.tex @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 3.0 KB
Line 
1@node machine,,syscalls,Top
2@chapter NEC V70 Specific Functions
3
4The NEC V70 has machine instructions for fast IEEE floating-point
5arithmetic, including operations normally provided by the library. 
6
7When you use the @file{/usr/include/fastmath.h} header file, the
8names of several library math functions are redefined to call the
9@code{fastmath} routine (using the corresponding V70 machine instructions)
10whenever possible.
11
12For example,
13@example
14
15#include <fastmath.h>
16
17double sqsin(x)
18double x;
19@{
20  return sin(x*x);
21@}
22
23@end example
24expands into the code
25@example
26
27@dots{}
28double sqsin(x)
29double x;
30@{
31  return fast_sin(x*x);
32@}
33
34@end example
35
36The library has an entry @code{fast_sin} which uses the machine
37instruction @code{fsin.l} to perform the operation.  Note that the
38built-in instructions cannot call @code{matherr} or set @code{errno}
39in the same way that the C coded functions do.  Refer to a V70
40instruction manual to see how errors are generated and handled.
41
42Also, the library provides true @code{float} entry points.  The
43@code{fast_sinf} entry point really performs a @code{fsin.s}
44operation.  Because of this, the instructions are only useful when
45using code compiled with an ANSI C compiler.  The prototypes
46and definitions for the floating-point versions of the math library
47routines are only defined if compiling a module with an ANSI C
48compiler.
49
50@page
51@section Entry points
52The functions provided by @file{fastmath.h} are
53@example
54
55 double fast_sin(double);       /*      fsin.l */
56 double fast_cos(double);       /*      fcos.l */
57 double fast_tan(double);       /*      ftan.l */
58 double fast_asin(double);      /*      fasin.l */
59 double fast_acos(double);      /*      facos.l */
60 double fast_atan(double);      /*      fatan.l */
61 double fast_sinh(double);      /*      fsinh.l */
62 double fast_cosh(double);      /*      fcosh.l */
63 double fast_tanh(double);      /*      ftanh.l */
64 double fast_asinh(double);     /*      fasinh.l */
65 double fast_acosh(double);     /*      facosh.l */
66 double fast_atanh(double);     /*      fatanh.l */
67 double fast_fabs(double);      /*      fabs.l */
68 double fast_sqrt(double);      /*      fsqrt.l */
69 double fast_exp2(double);      /*      fexp2.l */
70 double fast_exp10(double);     /*      fexp10.l */
71 double fast_expe(double);      /*      fexpe.l */
72 double fast_log10(double);     /*      flog10.l */
73 double fast_log2(double);      /*      flog2.l */
74 double fast_loge(double);      /*      floge.l */
75
76 float fast_sinf(float);        /*      fsin.s */
77 float fast_cosf(float);        /*      fcos.s */
78 float fast_tanf(float);        /*      ftan.s */
79 float fast_asinf(float);       /*      fasin.s */
80 float fast_acosf(float);       /*      facos.s */
81 float fast_atanf(float);       /*      fatan.s */
82 float fast_sinhf(float);       /*      fsinh.s */
83 float fast_coshf(float);       /*      fcosh.s */
84 float fast_tanhf(float);       /*      ftanh.s */
85 float fast_asinhf(float);      /*      fasinh.s */
86 float fast_acoshf(float);      /*      facosh.s */
87 float fast_atanhf(float);      /*      fatanh.s */
88 float fast_fabsf(float);       /*      fabs.s */
89 float fast_sqrtf(float);       /*      fsqrt.s */
90 float fast_exp2f(float);       /*      fexp2.s */
91 float fast_exp10f(float);      /*      fexp10.s */
92 float fast_expef(float);       /*      fexpe.s */
93 float fast_log10f(float);      /*      flog10.s */
94 float fast_log2f(float);       /*      flog2.s */
95 float fast_logef(float);       /*      floge.s */
96
97@end example
98
99
Note: See TracBrowser for help on using the repository browser.