projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
On x86, use thread-local storage instead of stealing a reg for gct
[ghc-hetmet.git]
/
rts
/
sm
/
GCThread.h
diff --git
a/rts/sm/GCThread.h
b/rts/sm/GCThread.h
index
c563d95
..
5646edd
100644
(file)
--- a/
rts/sm/GCThread.h
+++ b/
rts/sm/GCThread.h
@@
-209,10
+209,15
@@
extern gc_thread **gc_threads;
#define SET_GCT(to) gct = (to)
#define SET_GCT(to) gct = (to)
-#if defined(sparc_HOST_ARCH)
+#if defined(sparc_HOST_ARCH) || defined(i386_HOST_ARCH)
// Don't use REG_base or R1 for gct on SPARC because they're getting clobbered
// by something else. Not sure what yet. -- BL 2009/01/03
// Don't use REG_base or R1 for gct on SPARC because they're getting clobbered
// by something else. Not sure what yet. -- BL 2009/01/03
+// Using __thread is better than stealing a register on x86, because
+// we have too few registers available. In my tests it was worth
+// about 5% in GC performance, but of course that might change as gcc
+// improves. -- SDM 2009/04/03
+
extern __thread gc_thread* gct;
#define DECLARE_GCT __thread gc_thread* gct;
extern __thread gc_thread* gct;
#define DECLARE_GCT __thread gc_thread* gct;