summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2023-05-17 20:34:35 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2023-05-17 20:34:35 +0000
commitef5d2d76506ad18d6d62b6ab67fbc3604395f209 (patch)
treea4a3307101b6581393168eb255bb144edf5ee4ac
parentda9140b90e6994b79e34d4df9822a4bf81c45abe (diff)
downloadgcc-ef5d2d76506ad18d6d62b6ab67fbc3604395f209.tar.gz
Add clear_cache expander.
2023-05-17 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md (clear_cache): New.
-rw-r--r--gcc/config/pa/pa.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 7b7d7f776c7..726e12768f8 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -9940,6 +9940,23 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
[(set_attr "type" "multi")
(set_attr "length" "52")])
+(define_expand "clear_cache"
+ [(match_operand 0 "pmode_register_operand")
+ (match_operand 1 "pmode_register_operand")]
+ ""
+{
+ rtx line_length = gen_reg_rtx (Pmode);
+
+ emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
+ if (TARGET_64BIT)
+ emit_insn (gen_icacheflushdi (operands[0], operands[1], line_length,
+ gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));
+ else
+ emit_insn (gen_icacheflushsi (operands[0], operands[1], line_length,
+ gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));
+ DONE;
+})
+
;; An out-of-line prologue.
(define_insn "outline_prologue_call"
[(unspec_volatile [(const_int 0)] UNSPECV_OPC)