[GHC] #7014: RULES for bitwise logic and shift primops

GHC cvs-ghc at haskell.org
Fri Jul 6 18:17:24 CEST 2012


#7014: RULES for bitwise logic and shift primops
---------------------------------+------------------------------------------
    Reporter:  akio              |       Owner:  pcapriotti      
        Type:  feature request   |      Status:  patch           
    Priority:  normal            |   Milestone:  7.6.1           
   Component:  Compiler          |     Version:  7.4.2           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by pcapriotti):

 The attached patches adds identity rules for shift and bitwise operations
 to
 `PrelRules`, as well as similar rules from `GHC.Base`.

 I also refactored `PrelRules` a little to remove some duplication.

 We're still missing rules like:

     x and# (complement 0) ==> x
     x or# (complement 0) ==> complement 0

 since I'm not sure how we can match `complement 0` in `MachWord`. We could
 convert to `Word`, but that is wrong for cross-compilation.

 There were already other places where it is assumed that target == host,
 however, so maybe it's ok to add another one?

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



More information about the Glasgow-haskell-bugs mailing list