fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / machine / necv70 / necv70.tex
blob9c1530411e642135777a41478e7913ef07e8a950
1 @node machine,,syscalls,Top
2 @chapter NEC V70 Specific Functions
4 The NEC V70 has machine instructions for fast IEEE floating-point
5 arithmetic, including operations normally provided by the library.
7 When you use the @file{/usr/include/fastmath.h} header file, the
8 names of several library math functions are redefined to call the
9 @code{fastmath} routine (using the corresponding V70 machine instructions)
10 whenever possible.
12 For example,
13 @example
15 #include <fastmath.h>
17 double sqsin(x)
18 double x;
20 return sin(x*x);
23 @end example
24 expands into the code
25 @example
27 @dots{}
28 double sqsin(x)
29 double x;
31 return fast_sin(x*x);
34 @end example
36 The library has an entry @code{fast_sin} which uses the machine
37 instruction @code{fsin.l} to perform the operation. Note that the
38 built-in instructions cannot call @code{matherr} or set @code{errno}
39 in the same way that the C coded functions do. Refer to a V70
40 instruction manual to see how errors are generated and handled.
42 Also, the library provides true @code{float} entry points. The
43 @code{fast_sinf} entry point really performs a @code{fsin.s}
44 operation. Because of this, the instructions are only useful when
45 using code compiled with an ANSI C compiler. The prototypes
46 and definitions for the floating-point versions of the math library
47 routines are only defined if compiling a module with an ANSI C
48 compiler.
50 @page
51 @section Entry points
52 The functions provided by @file{fastmath.h} are
53 @example
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 */
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 */
97 @end example