aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJanis Johnson <janis187@us.ibm.com>2001-12-07 01:42:35 +0000
committerJanis Johnson <janis@gcc.gnu.org>2001-12-07 01:42:35 +0000
commite83d297b1049d7d298aa315ae8219f6a5ddec0c7 (patch)
treebaf0c96827241d6794dcca8eb20a81c5076a34e7 /gcc/doc
parente94c6dee73d9ffdaf8bae0f9cfdde6db3e4840b1 (diff)
downloadgcc-e83d297b1049d7d298aa315ae8219f6a5ddec0c7.zip
gcc-e83d297b1049d7d298aa315ae8219f6a5ddec0c7.tar.gz
gcc-e83d297b1049d7d298aa315ae8219f6a5ddec0c7.tar.bz2
builtin-types.def (BT_FN_VOID_PTR_VAR): New.
* builtin-types.def (BT_FN_VOID_PTR_VAR): New. * builtins.def (BUILT_IN_PREFETCH): Change arguments. * builtins.c (expand_builtin_prefetch): Two arguments are now optional, with defaults for read prefetch with high degree of locality. * doc/extend.texi (__builtin_prefetch): Update documentation. * doc/md.texi (prefetch): Add documentation. From-SVN: r47741
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi9
-rw-r--r--gcc/doc/md.texi16
2 files changed, 22 insertions, 3 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 61757f0..a6853d8 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -4442,7 +4442,7 @@ if (__builtin_expect (ptr != NULL, 1))
when testing pointer or floating-point values.
@end deftypefn
-@deftypefn {Built-in Function} void __builtin_prefetch (void *@var{addr}, int @var{rw}, int @var{locality})
+@deftypefn {Built-in Function} void __builtin_prefetch (void *@var{addr}, ...)
This function is used to minimize cache-miss latency by moving data into
a cache before it is accessed.
You can insert calls to @code{__builtin_prefetch} into code for which
@@ -4452,14 +4452,17 @@ If the prefetch is done early enough before the access then the data will
be in the cache by the time it is accessed.
The value of @var{addr} is the address of the memory to prefetch.
+There are two optional arguments, @var{rw} and @var{locality}.
The value of @var{rw} is a compile-time constant one or zero; one
-means that the prefetch is preparing for a write to the memory address.
+means that the prefetch is preparing for a write to the memory address
+and zero, the default, means that the prefetch is preparing for a read.
The value @var{locality} must be a compile-time constant integer between
zero and three. A value of zero means that the data has no temporal
locality, so it need not be left in the cache after the access. A value
of three means that the data has a high degree of temporal locality and
should be left in all levels of cache possible. Values of one and two
-mean, respectively, a low or moderate degree of temporal locality.
+mean, respectively, a low or moderate degree of temporal locality. The
+default is three.
@smallexample
for (i = 0; i < n; i++)
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index f8ecb2a..23154cd 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -3015,6 +3015,22 @@ A typical @code{conditional_trap} pattern looks like
"@dots{}")
@end smallexample
+@cindex @code{prefetch} instruction pattern
+@item @samp{prefetch}
+
+This pattern, if defined, emits code for a non-faulting data prefetch
+instruction. Operand 0 is the address of the memory to prefetch. Operand 1
+is a constant 1 if the prefetch is preparing for a write to the memory
+address, or a constant 0 otherwise. Operand 2 is the expected degree of
+temporal locality of the data and is a value between 0 and 3, inclusive; 0
+means that the data has no temporal locality, so it need not be left in the
+cache after the access; 3 means that the data has a high degree of temporal
+locality and should be left in all levels of cache possible; 1 and 2 mean,
+respectively, a low or moderate degree of temporal locality.
+
+Targets that do not support write prefetches or locality hints can ignore
+the values of operands 1 and 2.
+
@cindex @code{cycle_display} instruction pattern
@item @samp{cycle_display}