Changes between Version 5 and Version 6 of Commentary/Libraries/Integer


Ignore:
Timestamp:
Jun 27, 2012 10:17:44 PM (22 months ago)
Author:
igloo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Libraries/Integer

    v5 v6  
    2626 
    2727However, there is a special case for `Integer`s that are within the range of `Int` when the `integer-gmp` implementation is being used; in that case, we use the `S#` constructor (via `integerGmpSDataCon` in [[GhcFile(compiler/prelude/TysWiredIn.lhs)]]) to break the abstraction and directly create the datastructure. 
     28 
     29Most of the functions in the Integer implementation are marked `NOINLINE`. This is because inlining them is generally not beneficial (any constant folding is already handled by the built-in rules), and in fact can be harmful: In the GMP representation, each argument can be one of two constructors (`S#` and `J#`), which leads to 2 branches. When you have a number of `Integer` arithmetic operations, you can get an exponential code explosion if they all get inlined.