public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] hppa: Add clear_cache expander
@ 2023-05-17 20:39 John David Anglin
  0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2023-05-17 20:39 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]

Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.

Committed to trunk.

Dave
---

Add clear_cache expander.

2023-05-17  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	* config/pa/pa.md (clear_cache): New.

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)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-17 20:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 20:39 [committed] hppa: Add clear_cache expander John David Anglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).