[GHC] #15983: Built-in support for half-floats

GHC ghc-devs at haskell.org
Sat Dec 1 21:47:20 UTC 2018


#15983: Built-in support for half-floats
-------------------------------------+-------------------------------------
           Reporter:  lerkok         |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:  8.6.3
          Component:  Compiler       |           Version:  8.6.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Half-floats (16-bit floating point values with 1-bit sign, 5-bits of
 exponent, and 10 bits of mantissa) are becoming more and more common in
 this new era of data-centric programming: Almost all GPUs have native
 support, and most CPU's are starting to support them natively in their
 instruction set.

 It would be great if GHC can lead the way and have half-floats as a
 natively supported data-type as well, just like Float and Double.

 I'm aware of Edward's http://hackage.haskell.org/package/half package; so
 that could be a starting point; though we'd eventually want GHC to
 generate native code. Note that LLVM does support half-floats, so a viable
 path can be using LLVM when available and software-FFI/implementation
 otherwise. Eventually the native code generator can add support as well.

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


More information about the ghc-tickets mailing list