[GHC] #7902: Add support for byte endianness swapping exposed as a primops

GHC ghc-devs at haskell.org
Sun Jun 16 09:45:34 CEST 2013


#7902: Add support for byte endianness swapping exposed as a primops
------------------------------------------+---------------------------------
  Reporter:  tab                          |          Owner:                  
      Type:  feature request              |         Status:  new             
  Priority:  normal                       |      Milestone:                  
 Component:  Compiler                     |        Version:  7.7             
Resolution:                               |       Keywords:  bswap endianness
        Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown                 |     Difficulty:  Unknown         
  Testcase:  codeGen/should_run/cgrun072  |      Blockedby:                  
  Blocking:                               |        Related:                  
------------------------------------------+---------------------------------

Comment(by tab):

 Attached is an incremental patch to fix the 32bit x86 build. I've verified
 the 32 bits works and that 64 bits still build and work too.

 along with the patch, there's a change of byteSwap64 primops from
 GenPrimOp to Monadic type. I don't think it change anything, but i believe
 the latter is the correct one in this case.

 It's inspired by #7976, and i've verified that there's no overlap going on
 in registers:
 * my (limited) understanding of codeGen seem iselExpr64 would create a new
 register pair all the time.
 * Empirically generating arbitrary haskell code and checking the
 disassembled code.

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



More information about the ghc-tickets mailing list