all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob abd6c3fd1f07eac79426952674a5a508560775f7 1400 bytes (raw)
name: gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
From ca11b53896365c948426974cb90e8f71c70d123b Mon Sep 17 00:00:00 2001
From: Simon South <simon@simonsouth.net>
Date: Sun, 31 May 2020 20:36:43 -0400
Subject: [PATCH 1/2] Guard floating-point opcodes with explicit memory barrier

---
 src/interp/engine/interp-inlining.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/interp/engine/interp-inlining.h b/src/interp/engine/interp-inlining.h
index 3339b0e..4ee5c5a 100644
--- a/src/interp/engine/interp-inlining.h
+++ b/src/interp/engine/interp-inlining.h
@@ -78,8 +78,17 @@
    4.3, we need to insert a label, and ensure its address
    is taken (to stop it being optimised out).  However,
    this reduces performance on PowerPC by approx 1 - 2%.
+
+   With gcc 5 and newer an asm statement with a "memory"
+   clobber argument explicitly sets a memory barrier for the
+   compiler, preventing it from reordering memory accesses
+   in a way that breaks decaching.
 */
-#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
+#if (__GNUC__ > 4)
+#define DEF_GUARD_TABLE(level) /* none */
+#define GUARD(opcode, level)   __asm__("" ::: "memory");
+#define GUARD_TBLS             /* none */
+#elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
 #define DEF_GUARD_TABLE(level) DEF_HANDLER_TABLE(level, GUARD)
 #define GUARD(opcode, level)   label(opcode, level, GUARD)
 #define GUARD_TBLS             , HNDLR_TBLS(GUARD)
-- 
2.26.2


debug log:

solving abd6c3fd1f ...
found abd6c3fd1f in https://yhetil.org/guix/20200601171532.7350-2-simon@simonsouth.net/

applying [1/1] https://yhetil.org/guix/20200601171532.7350-2-simon@simonsouth.net/
diff --git a/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch b/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch
new file mode 100644
index 0000000000..abd6c3fd1f

1:39: trailing whitespace.
-- 
Checking patch gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch...
1:41: new blank line at EOF.
+
Applied patch gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 abd6c3fd1f07eac79426952674a5a508560775f7	gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.