Fix powerpc software sqrtf (bug 17967).
[glibc.git] / manual / platform.texi
blob872e32ecb3136ed5aacb84550f7fbb68044e044d
1 @node Platform, Contributors, Maintenance, Top
2 @c %MENU% Describe all platform-specific facilities provided
3 @appendix Platform-specific facilities
5 @Theglibc{} can provide machine-specific functionality.
7 @menu
8 * PowerPC::           Facilities Specific to the PowerPC Architecture
9 @end menu
11 @node PowerPC
12 @appendixsec PowerPC-specific Facilities
14 Facilities specific to PowerPC that are not specific to a particular
15 operating system are declared in @file{sys/platform/ppc.h}.
17 @deftypefun {uint64_t} __ppc_get_timebase (void)
18 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
19 Read the current value of the Time Base Register.
21 The @dfn{Time Base Register} is a 64-bit register that stores a monotonically
22 incremented value updated at a system-dependent frequency that may be
23 different from the processor frequency.  More information is available in
24 @cite{Power ISA 2.06b - Book II - Section 5.2}.
26 @code{__ppc_get_timebase} uses the processor's time base facility directly
27 without requiring assistance from the operating system, so it is very
28 efficient.
29 @end deftypefun
31 @deftypefun {uint64_t} __ppc_get_timebase_freq (void)
32 @safety{@prelim{}@mtunsafe{@mtuinit{}}@asunsafe{@asucorrupt{:init}}@acunsafe{@acucorrupt{:init}}}
33 @c __ppc_get_timebase_freq=__get_timebase_freq @mtuinit @acsfd
34 @c  __get_clockfreq @mtuinit @asucorrupt:init @acucorrupt:init @acsfd
35 @c    the initialization of the static timebase_freq is not exactly
36 @c    safe, because hp_timing_t cannot be atomically set up.
37 @c   syscall:get_tbfreq ok
38 @c   open dup @acsfd
39 @c   read dup ok
40 @c   memcpy dup ok
41 @c   memmem dup ok
42 @c   close dup @acsfd
43 Read the current frequency at which the Time Base Register is updated.
45 This frequency is not related to the processor clock or the bus clock.
46 It is also possible that this frequency is not constant.  More information is
47 available in @cite{Power ISA 2.06b - Book II - Section 5.2}.
48 @end deftypefun
50 The following functions provide hints about the usage of resources that are
51 shared with other processors.  They can be used, for example, if a program
52 waiting on a lock intends to divert the shared resources to be used by other
53 processors.  More information is available in @cite{Power ISA 2.06b - Book II -
54 Section 3.2}.
56 @deftypefun {void} __ppc_yield (void)
57 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
58 Provide a hint that performance will probably be improved if shared resources
59 dedicated to the executing processor are released for use by other processors.
60 @end deftypefun
62 @deftypefun {void} __ppc_mdoio (void)
63 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
64 Provide a hint that performance will probably be improved if shared resources
65 dedicated to the executing processor are released until all outstanding storage
66 accesses to caching-inhibited storage have been completed.
67 @end deftypefun
69 @deftypefun {void} __ppc_mdoom (void)
70 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
71 Provide a hint that performance will probably be improved if shared resources
72 dedicated to the executing processor are released until all outstanding storage
73 accesses to cacheable storage for which the data is not in the cache have been
74 completed.
75 @end deftypefun
77 @deftypefun {void} __ppc_set_ppr_med (void)
78 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
79 Set the Program Priority Register to medium value (default).
81 The @dfn{Program Priority Register} (PPR) is a 64-bit register that controls
82 the program's priority.  By adjusting the PPR value the programmer may
83 improve system throughput by causing the system resources to be used
84 more efficiently, especially in contention situations.
85 The three unprivileged states available are covered by the functions
86 @code{__ppc_set_ppr_med} (medium -- default), @code{__ppc_set_ppc_low} (low)
87 and @code{__ppc_set_ppc_med_low} (medium low).  More information
88 available in @cite{Power ISA 2.06b - Book II - Section 3.1}.
89 @end deftypefun
91 @deftypefun {void} __ppc_set_ppr_low (void)
92 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
93 Set the Program Priority Register to low value.
94 @end deftypefun
96 @deftypefun {void} __ppc_set_ppr_med_low (void)
97 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
98 Set the Program Priority Register to medium low value.
99 @end deftypefun