[GHC] #6135: Unboxed Booleans

GHC cvs-ghc at haskell.org
Sun Apr 14 13:08:15 CEST 2013


#6135: Unboxed Booleans
---------------------------------+------------------------------------------
    Reporter:  benl              |       Owner:  jstolarek       
        Type:  feature request   |      Status:  patch           
    Priority:  normal            |   Milestone:  7.8.1           
   Component:  Compiler          |     Version:  7.4.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:  #605              |  
---------------------------------+------------------------------------------

Comment(by jstolarek):

 I'm having some problems and I admit I could use some hint on what to do.
 I'm able to build the stage1 compiler, but every program compiled with it
 segfaults immediately. Looks like the approach I used to add the new
 prototype primops does not extend easily to modifying the existing
 primops. Here's the summary of what I did:

   * I changed primop definitions to return Int#
 ([[GhcFile(compiler/prelude/primops.txt.pp)]]) and modified genprimopcode
 accordingly ([[GhcFile(utils/genprimopcode/Syntax.hs)]])
   * I modified Compare primop info to return Int# instead of Bool
 ([[GhcFile(compiler/prelude/PrimOp.lhs)]])
   * I fixed the automatic deriving of Eq and Ord typeclasses
 ([[GhcFile(compiler/typecheck/TcGenDeriv.lhs)]])
   * I removed all the comparison primop Core rules, so they wouldn't get
 in the way ([[GhcFile( compiler/prelude/PrelRules.lhs)]]). Once I get
 things working I will create new rules.
   * Once I realized that I'm getting segfaults I commented out some
 !MachOp rules in ([[GhcFile(compiler/cmm/CmmMachOp.hs)]]) (namely
 functions isComparisonMachOp and maybeInvertComparison) to make sure that
 problems are not caused by them.
   * I added primop wrappers in ghc-prim library and I modified base, ghc-
 prim and integer-gmp libraries to use those wrappers.

 I pushed these changes to github. The diffs are here:
 [https://github.com/jstolarek/ghc/commit/b5be2fb1083d16239024849b60a4b3009e67afd9
 GHC], [https://github.com/jstolarek/packages-
 base/commit/c484bcee5898257ceceecd9c354eadc376075e9c base],
 [https://github.com/jstolarek/packages-ghc-
 prim/commit/26096ff8875d8a6b1158078799cf394c654bdc50 ghc-prim],
 [https://github.com/jstolarek/packages-integer-
 gmp/commit/101bbc83ae632c8d2a1cd08bc9b68532f8e50a6a integer-gmp]. If
 anyone would be willing to look at them and suggest me where I went wrong
 I would be grateful. I know I need to make some more changes in ghc-prim
 library in GHC.!IntWord64 module and cbits, but I'm leaving that for now.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6135#comment:45>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list