simd branch ready for review

Geoffrey Mainland mainland at apeiron.net
Thu Jan 31 22:05:30 CET 2013


On 01/31/2013 08:40 PM, Bryan O'Sullivan wrote:
> On Thu, Jan 31, 2013 at 12:30 PM, Geoffrey Mainland <mainland at apeiron.net> wrote:
>
> 2) SSE support is processor and platform dependent. What is the proper
> way for the programmer to know what SSE primitives are available? A CPP
> define? If so, what should it be called?
>
>
> This needs a combination of compile-time and run-time information. The
> compiler can tell you what instructions it's willing to use, but you
> also have to ask the CPU at runtime what it supports, otherwise you'll
> end up with crashes when people move code from a machine that has
> SSE4.2 to a machine that has SSE2.
>
> Johan added some support for the compile-time bit recently.

Yes, I saw his patches to set CPP defines when -msee and -msse2 are
passed to GHC.

Some sort of decision about, e.g., AVX support will have to be made when
GHC is built due to the existence of GHC.PrimopWrappers.

I think you are suggesting that binaries built on a machine that
supports SSE4.2 should not *require* SSE4.2 to run just because they
were built on a machine with SSE4.2 support? I agree. However, if the
user makes a decision at GHC build time to make use of AVX instructions,
then we can't expect the resulting binaries to run on a machine that
doesn't support AVX.

How does the user specify that GHC should be built with support for AVX
primops? And how do we then tell the programmer which set(s) of primops
are available?

Geoff




More information about the ghc-devs mailing list