From cbd29e0a23bb8e15033edae123d6c8fbe9740c97 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 18 Nov 2005 15:13:46 +0000 Subject: [PATCH] [project @ 2005-11-18 15:13:46 by simonmar] Add wcStore(), a write-combining store if supported (I tried using it in the update code and only succeeded in making things slower, but it might come in handy in the future) --- ghc/includes/Stg.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ghc/includes/Stg.h b/ghc/includes/Stg.h index 9977d57..a63b7ec 100644 --- a/ghc/includes/Stg.h +++ b/ghc/includes/Stg.h @@ -367,6 +367,24 @@ INLINE_HEADER StgInt64 PK_Int64(W_ p_src[]) #endif /* ----------------------------------------------------------------------------- + Write-combining store + -------------------------------------------------------------------------- */ + +INLINE_HEADER void +wcStore (StgPtr p, StgWord w) +{ +#ifdef x86_64_HOST_ARCH + __asm__( + "movnti\t%1, %0" + : "=m" (*p) + : "r" (w) + ); +#else + *p = w; +#endif +} + +/* ----------------------------------------------------------------------------- Integer multiply with overflow -------------------------------------------------------------------------- */ -- 1.7.10.4