[GHC] #8299: Add richer data model address arithmetic: AddrDiff and AddrInt (ie d Int_ptr_diff and Int_ptr_size)

GHC ghc-devs at haskell.org
Sun Sep 15 00:07:56 CEST 2013


#8299: Add richer data model address arithmetic: AddrDiff and AddrInt (ie d
Int_ptr_diff and Int_ptr_size)
----------------------------------------------+----------------------------
       Reporter:  carter                      |             Owner:
           Type:  feature request             |            Status:  new
       Priority:  high                        |         Milestone:  7.10.1
      Component:  Compiler                    |           Version:  7.6.3
       Keywords:                              |  Operating System:
   Architecture:  Unknown/Multiple            |  Unknown/Multiple
     Difficulty:  Project (more than a week)  |   Type of failure:
     Blocked By:                              |  None/Unknown
Related Tickets:                              |         Test Case:
                                              |          Blocking:  8287
----------------------------------------------+----------------------------
 currently GHC's internals and code gen don't provide a strong distinction
 between Ints as data, and Ints for pointer / address arithmetic. This also
 comes up as being problematical in a number of ways.

 1. We wind up having many portability issues around Int and pointer /
 address sizes.

 2. adds some inessential complexity / problems to adding new architectures
 to ghc. eg x32 ABI which has 32bit pointers and 64bit ints somewhat breaks
 current assumptions in the GHC primops (because arrays are indexed by a
 byte offset, and the valid range for those is determined by the ABI
 pointer size!)

 3. this Ints and Ptrs confusion we currently have, also means we can't
 leverage the Integer support in SIMD registers that is in most modern
 CPUs!  If we could have those two separated better, theres a lot of low
 leve optimizations we could do for Int/Word data that we currently cant
 do!

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8299>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list