From 456dc6d6c193f693661409609dc28d5ad9d8c984 Mon Sep 17 00:00:00 2001 From: "Ben.Lippmeier@anu.edu.au" Date: Tue, 31 Mar 2009 05:19:00 +0000 Subject: [PATCH] SPARC NCG: HpLim is now always stored on the stack, not in a register This fixes the out of memory errors we were getting on sparc after the following patch: Fri Mar 13 03:45:16 PDT 2009 Simon Marlow * Instead of a separate context-switch flag, set HpLim to zero Ignore-this: 6c5bbe1ce2c5ef551efe98f288483b0 This reduces the latency between a context-switch being triggered and the thread returning to the scheduler, which in turn should reduce the cost of the GC barrier when there are many cores. --- compiler/nativeGen/SPARC/Regs.hs | 7 ++++--- includes/MachRegs.h | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/nativeGen/SPARC/Regs.hs b/compiler/nativeGen/SPARC/Regs.hs index 7911958..b129d44 100644 --- a/compiler/nativeGen/SPARC/Regs.hs +++ b/compiler/nativeGen/SPARC/Regs.hs @@ -188,12 +188,14 @@ freeReg regno -- %l6(r22) - %l7(r23) are allocable -------------- -- %i0(r24) - %i5(r29) - -- are STG regs Sp, Base, SpLim, Hp, HpLim, R6 + -- are STG regs Sp, Base, SpLim, Hp, R6 24 -> fastBool False 25 -> fastBool False 26 -> fastBool False 27 -> fastBool False - 28 -> fastBool False + + -- %i5(r28) is allocable -------------------------- + 29 -> fastBool False -- %i6(r30) @@ -263,7 +265,6 @@ globalRegMaybe gg Sp -> Just (RealReg 24) -- %i0 SpLim -> Just (RealReg 26) -- %i2 Hp -> Just (RealReg 27) -- %i3 - HpLim -> Just (RealReg 28) -- %i4 BaseReg -> Just (RealReg 25) -- %i1 diff --git a/includes/MachRegs.h b/includes/MachRegs.h index f51f782..593989d 100644 --- a/includes/MachRegs.h +++ b/includes/MachRegs.h @@ -543,6 +543,10 @@ /* ----------------------------------------------------------------------------- The Sun SPARC register mapping + !! IMPORTANT: if you change this register mapping you must also update + compiler/nativeGen/SPARC/Regs.hs. That file handles the + mapping for the NCG. This one only affects via-c code. + The SPARC register (window) story: Remember, within the Haskell Threaded World, we essentially ``shut down'' the register-window mechanism---the window doesn't move at all while in this World. It @@ -590,11 +594,11 @@ %i1 Base %i2 SpLim %i3 Hp + %i4 alloc %i5 R6 %i6 C frame ptr %i7 C ret addr - The paired nature of the floating point registers causes complications for the native code generator. For convenience, we pretend that the first 22 fp regs %f0 .. %f21 are actually 11 double regs, and the remaining 10 are -- 1.7.10.4