[GHC] #3353: Add CLDouble support
GHC
cvs-ghc at haskell.org
Fri Apr 23 07:38:39 EDT 2010
#3353: Add CLDouble support
---------------------------------+------------------------------------------
Reporter: igloo | Owner:
Type: bug | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version: 6.12.1
Keywords: | Difficulty: Unknown
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
Patch: 0 |
---------------------------------+------------------------------------------
Comment(by simonmar):
Replying to [comment:7 igloo]:
> `CLDouble` needs to be the same as the C `long double` type, so things
don't go wrong when using the FFI with long doubles.
Right, and adding a long double primitive type to GHC is not at all
trivial. I thought about doing an implementation in Haskell using the
FFI, but that wouldn't work because the key thing you need to be able to
do with a `CLDouble` is pass it to a foreign function, and for that we
need support in the native code generator. The primitives could be
implemented using the FFI like we do for the 64-bit integral types on a
32-bit platform (although that's not entirely satisfactory).
As a workaround, code that needs `CLDouble` can go via a C wrapper that
takes a `CLDouble *`. Avoid manipulating `CLDouble` directly in Haskell,
just talk in terms of pointers to `CLDouble`.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3353#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list