public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: Define macro CLEAR_INSN_CACHE.
@ 2023-10-20  7:15 Lulu Cheng
  2023-10-23  1:28 ` chenglulu
  0 siblings, 1 reply; 2+ messages in thread
From: Lulu Cheng @ 2023-10-20  7:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, xuchenghua, Lulu Cheng

LoongArch's microstructure ensures cache consistency by hardware.
Due to out-of-order execution, ibar is required to ensure the visibility of the
store (invalidated icache) executed by this CPU before ibar (to the instance).
ibar will not invalidate the icache, so the start and end parameters are not Affect
ibar performance.

gcc/ChangeLog:

	* config/loongarch/loongarch.h (CLEAR_INSN_CACHE): New definition.
---
 gcc/config/loongarch/loongarch.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index 22912018a0d..0c15c79bc4c 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -1239,3 +1239,6 @@ struct GTY (()) machine_function
 
 #define TARGET_EXPLICIT_RELOCS \
   (la_opt_explicit_relocs == EXPLICIT_RELOCS_ALWAYS)
+
+#undef  CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(beg, end) __builtin_loongarch_ibar (0)
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re:[pushed] [PATCH] LoongArch: Define macro CLEAR_INSN_CACHE.
  2023-10-20  7:15 [PATCH] LoongArch: Define macro CLEAR_INSN_CACHE Lulu Cheng
@ 2023-10-23  1:28 ` chenglulu
  0 siblings, 0 replies; 2+ messages in thread
From: chenglulu @ 2023-10-23  1:28 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, xuchenghua

Pushed to r14-4836.

在 2023/10/20 下午3:15, Lulu Cheng 写道:
> LoongArch's microstructure ensures cache consistency by hardware.
> Due to out-of-order execution, ibar is required to ensure the visibility of the
> store (invalidated icache) executed by this CPU before ibar (to the instance).
> ibar will not invalidate the icache, so the start and end parameters are not Affect
> ibar performance.
>
> gcc/ChangeLog:
>
> 	* config/loongarch/loongarch.h (CLEAR_INSN_CACHE): New definition.
> ---
>   gcc/config/loongarch/loongarch.h | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
> index 22912018a0d..0c15c79bc4c 100644
> --- a/gcc/config/loongarch/loongarch.h
> +++ b/gcc/config/loongarch/loongarch.h
> @@ -1239,3 +1239,6 @@ struct GTY (()) machine_function
>   
>   #define TARGET_EXPLICIT_RELOCS \
>     (la_opt_explicit_relocs == EXPLICIT_RELOCS_ALWAYS)
> +
> +#undef  CLEAR_INSN_CACHE
> +#define CLEAR_INSN_CACHE(beg, end) __builtin_loongarch_ibar (0)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-23  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20  7:15 [PATCH] LoongArch: Define macro CLEAR_INSN_CACHE Lulu Cheng
2023-10-23  1:28 ` chenglulu

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).