[project @ 2005-11-18 15:13:46 by simonmar]
authorsimonmar <unknown>
Fri, 18 Nov 2005 15:13:46 +0000 (15:13 +0000)
committersimonmar <unknown>
Fri, 18 Nov 2005 15:13:46 +0000 (15:13 +0000)
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

index 9977d57..a63b7ec 100644 (file)
@@ -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
    -------------------------------------------------------------------------- */