aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-07-05 07:59:14 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-07-05 07:59:14 +0000
commitf2cf13bd7c00ec7d12e7bddfefeb5eea84a14f74 (patch)
tree595f8a5160947bc2430984eba6a62c7e4c24e2ea
parent10169a8b991800c73cbe6dbfdcf7761aac3e542c (diff)
downloadgcc-f2cf13bd7c00ec7d12e7bddfefeb5eea84a14f74.zip
gcc-f2cf13bd7c00ec7d12e7bddfefeb5eea84a14f74.tar.gz
gcc-f2cf13bd7c00ec7d12e7bddfefeb5eea84a14f74.tar.bz2
target-insns.def (clear_cache): New targetm instruction pattern.
gcc/ * target-insns.def (clear_cache): New targetm instruction pattern. * builtins.c (expand_builtin___clear_cache): Use it instead of HAVE_*/gen_* interface. From-SVN: r225430
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/builtins.c27
-rw-r--r--gcc/target-insns.def1
3 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eca124b..a0fa974 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
+ * target-insns.def (clear_cache): New targetm instruction pattern.
+ * builtins.c (expand_builtin___clear_cache): Use it instead of
+ HAVE_*/gen_* interface.
+
+2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
+
* target-insns.def (allocate_stack, check_stack, probe_stack)
(probe_stack_address, split_stack_prologue, split_stack_space_check):
New targetm instruction patterns.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 3110d0a..f5923b1 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4807,20 +4807,22 @@ expand_builtin_copysign (tree exp, rtx target, rtx subtarget)
/* Expand a call to __builtin___clear_cache. */
static rtx
-expand_builtin___clear_cache (tree exp ATTRIBUTE_UNUSED)
+expand_builtin___clear_cache (tree exp)
{
-#ifndef HAVE_clear_cache
+ if (!targetm.code_for_clear_cache)
+ {
#ifdef CLEAR_INSN_CACHE
- /* There is no "clear_cache" insn, and __clear_cache() in libgcc
- does something. Just do the default expansion to a call to
- __clear_cache(). */
- return NULL_RTX;
+ /* There is no "clear_cache" insn, and __clear_cache() in libgcc
+ does something. Just do the default expansion to a call to
+ __clear_cache(). */
+ return NULL_RTX;
#else
- /* There is no "clear_cache" insn, and __clear_cache() in libgcc
- does nothing. There is no need to call it. Do nothing. */
- return const0_rtx;
+ /* There is no "clear_cache" insn, and __clear_cache() in libgcc
+ does nothing. There is no need to call it. Do nothing. */
+ return const0_rtx;
#endif /* CLEAR_INSN_CACHE */
-#else
+ }
+
/* We have a "clear_cache" insn, and it will handle everything. */
tree begin, end;
rtx begin_rtx, end_rtx;
@@ -4834,7 +4836,7 @@ expand_builtin___clear_cache (tree exp ATTRIBUTE_UNUSED)
return const0_rtx;
}
- if (HAVE_clear_cache)
+ if (targetm.have_clear_cache ())
{
struct expand_operand ops[2];
@@ -4846,11 +4848,10 @@ expand_builtin___clear_cache (tree exp ATTRIBUTE_UNUSED)
create_address_operand (&ops[0], begin_rtx);
create_address_operand (&ops[1], end_rtx);
- if (maybe_expand_insn (CODE_FOR_clear_cache, 2, ops))
+ if (maybe_expand_insn (targetm.code_for_clear_cache, 2, ops))
return const0_rtx;
}
return const0_rtx;
-#endif /* HAVE_clear_cache */
}
/* Given a trampoline address, make sure it satisfies TRAMPOLINE_ALIGNMENT. */
diff --git a/gcc/target-insns.def b/gcc/target-insns.def
index 28d3151..2a9b23b 100644
--- a/gcc/target-insns.def
+++ b/gcc/target-insns.def
@@ -37,6 +37,7 @@ DEF_TARGET_INSN (builtin_setjmp_setup, (rtx x0))
DEF_TARGET_INSN (canonicalize_funcptr_for_compare, (rtx x0, rtx x1))
DEF_TARGET_INSN (casesi, (rtx x0, rtx x1, rtx x2, rtx x3, rtx x4))
DEF_TARGET_INSN (check_stack, (rtx x0))
+DEF_TARGET_INSN (clear_cache, (rtx x0, rtx x1))
DEF_TARGET_INSN (epilogue, (void))
DEF_TARGET_INSN (exception_receiver, (void))
DEF_TARGET_INSN (jump, (rtx x0))