[sldev] SSE/Vector stuff

Dirk Moerenhout blakar at gmail.com
Sat Jul 7 18:30:40 PDT 2007


Missing that _M_IX86_FP doesn't exist for VS2003 would happen to most
of us. I just got lucky that I spotted it while browsing the info.

I turned of my vertex shaders and let the program do a full run of
tests. The SSE2 code was notably faster and got picked correctly.
Seems to work fine when compiled with VS2005.

For VS2003 you'll just have to assume people compile with correct arch
cause I don't see a good way to detect arch during the compile. In the
end if they don't set the correct arch it simply will not compile at
all in such a case as it'll error out on the intrinsics.

Dirk aka Blakar Ogre

On 7/7/07, Dzonatas <dzonatas at dzonux.net> wrote:
> Dirk Moerenhout wrote:
> > Strange thing is that as far as I know LL is still building using VS
> > 2003 and VS 2003 does not have the _M_IX86_FP macro so even if you
> > compile with /arch:SSE2 in VS2003 you'll not get SSE2 support.
> ...
> Your right! It does say that here:
> http://msdn2.microsoft.com/en-us/library/e54ke6de(vs.80).aspx  Thanks
> for pointing that out!
>
> I use VS2005 Express which of course the only thing I can afford at the
> time, so my docs defaulted to that version. My bad? Yep, I guess I
> deserve the street for that one...?
>
> Since it will auto-detect under VS2005, the workaround is to detect the
> compiler version (being VS2003) in the _sse and _sse2 files and set
> _M_IX86_FP accordingly before it includes any of the  LLV4 headers.
>
> That should explain why some of the benchmarks came up negative even
> when it should be positive despite cache pollution.
>
>
> --
> Power to Change the Void
>


More information about the SLDev mailing list