Johan Tibell | 6 Dec 02:12 2012
Picon

Does GHC still support x87 floating point math?

Hi,

I'm currently trying to implement word2Double#. Other such primops
support both x87 and sse floating point math. Do we still support x87
fp math? Which compiler flag enables it?

-- Johan
Ben Lippmeier | 6 Dec 11:16 2012
Picon

Re: Does GHC still support x87 floating point math?


On 06/12/2012, at 12:12 , Johan Tibell wrote:

> I'm currently trying to implement word2Double#. Other such primops
> support both x87 and sse floating point math. Do we still support x87
> fp math? Which compiler flag enables it?

It's on by default unless you use the -sse2 flag. The x87 support is horribly slow though. I don't think
anyone would notice if you deleted the x87 code and made SSE the default, especially now that we have the
LLVM code generator. SSE has been the way to go for over 10 years now.

Ben.
Herbert Valerio Riedel | 6 Dec 12:01 2012
Picon

Re: Does GHC still support x87 floating point math?

Ben Lippmeier <benl <at> ouroborus.net> writes:

> On 06/12/2012, at 12:12 , Johan Tibell wrote:
>
>> I'm currently trying to implement word2Double#. Other such primops
>> support both x87 and sse floating point math. Do we still support x87
>> fp math? Which compiler flag enables it?
>
> It's on by default unless you use the -sse2 flag. The x87 support is
> horribly slow though. I don't think anyone would notice if you deleted
> the x87 code and made SSE the default, especially now that we have the
> LLVM code generator. SSE has been the way to go for over 10 years now.

btw, iirc GHC uses SSE2 for x86-64 code generation by default, and that
the -msse2 option has only an effect when generating x86(-32) code
Simon Marlow | 6 Dec 22:28 2012
Picon

Re: Does GHC still support x87 floating point math?

On 06/12/12 11:01, Herbert Valerio Riedel wrote:
> Ben Lippmeier <benl <at> ouroborus.net> writes:
>
>> On 06/12/2012, at 12:12 , Johan Tibell wrote:
>>
>>> I'm currently trying to implement word2Double#. Other such primops
>>> support both x87 and sse floating point math. Do we still support x87
>>> fp math? Which compiler flag enables it?
>>
>> It's on by default unless you use the -sse2 flag. The x87 support is
>> horribly slow though. I don't think anyone would notice if you deleted
>> the x87 code and made SSE the default, especially now that we have the
>> LLVM code generator. SSE has been the way to go for over 10 years now.
>
> btw, iirc GHC uses SSE2 for x86-64 code generation by default, and that
> the -msse2 option has only an effect when generating x86(-32) code

Yes, because all x86_64 CPUs support SSE2.  Chips older than P4 don't 
support it.  I imagine there aren't too many of those around that people 
want to run GHC on, and as Ben says, there's always -fllvm.

Cheers,
	Simon

Gmane