diff options
author | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-07 01:42:35 +0000 |
---|---|---|
committer | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-07 01:42:35 +0000 |
commit | 26a5cadbe2e258b572d11c71e0c01ea1950ee6e0 (patch) | |
tree | baf0c96827241d6794dcca8eb20a81c5076a34e7 /gcc/builtins.c | |
parent | 40c47dd71efa49b66faf8d564a7437b7f5ed7091 (diff) | |
download | ppe42-gcc-26a5cadbe2e258b572d11c71e0c01ea1950ee6e0.tar.gz ppe42-gcc-26a5cadbe2e258b572d11c71e0c01ea1950ee6e0.zip |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 68df170b600..515b75220a1 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); |