aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
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/builtins.c
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/builtins.c')
-rw-r--r--gcc/builtins.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 68df170..515b752 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -727,9 +727,26 @@ expand_builtin_prefetch (arglist)
tree arg0, arg1, arg2;
rtx op0, op1, op2;
+ if (!validate_arglist (arglist, POINTER_TYPE, 0))
+ return;
+
arg0 = TREE_VALUE (arglist);
- arg1 = TREE_VALUE (TREE_CHAIN (arglist));
- arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ /* Arguments 1 and 2 are optional; argument 1 (read/write) defaults to
+ zero (read) and argument 2 (locality) defaults to 3 (high degree of
+ locality). */
+ if (TREE_CHAIN (arglist))
+ {
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ if (TREE_CHAIN (TREE_CHAIN (arglist)))
+ arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ else
+ arg2 = build_int_2 (3, 0);
+ }
+ else
+ {
+ arg1 = integer_zero_node;
+ arg2 = build_int_2 (3, 0);
+ }
/* Argument 0 is an address. */
op0 = expand_expr (arg0, NULL_RTX, Pmode, EXPAND_NORMAL);