[sldev] [VWR] Vectorization on i386?

Callum Lerwick seg at haxxed.com
Mon Dec 3 12:02:23 PST 2007


On Mon, 2007-12-03 at 12:19 +0000, Tofu Linden wrote:
> > My testing so far has not turned up such a problem. It is and has been
> > compiling in the SSE stuff for as long as it has been in there,
> > actually.
> 
> What testing?  I thought you said you couldn't get this enabled on i386?
> Which part of the problem are you failing to reproduce?

The viewer runs, and always has run on my Athlon T-bird just fine. And
I've run it on my dual PII 333 system. If it were leaking SSE code into
places it shouldn't, I would have run into it by now.

Dur, I just realized what the difference is. viewer.cpp does not have an
_sse tag, so SConstruct does NOT compile it with SSE enabled on i386,
which means llv4math.h does NOT set LL_VECTORIZE, which means the bit of
code in there than enables SSE when available is NOT compiled in.

I hope you realize all the rest of the vector stuff is either not
wrapped in LL_VECTORIZE, such as llviewerjointmesh.cpp where the
performance test is, or has _sse/_sse2/_vec tags and thus IS getting
compiled:

linden.patched/indra/newview/llviewerjointmesh_sse2.cpp:#if LL_VECTORIZE
linden.patched/indra/newview/viewer.cpp:#if LL_VECTORIZE
linden.patched/indra/newview/llviewerjointmesh_sse.cpp:#if LL_VECTORIZE

So we (or at least I, I have not disassembled an LL build yet) have in
fact been compiling in the SSE code *all along*, and have only been
missing the little bit of code that enables it at runtime when
available. This is a one liner:

--- linden.orig/indra/newview/viewer.cpp        2007-12-03 03:53:00.000000000 -0600
+++ linden.patched/indra/newview/viewer.cpp     2007-12-03 13:12:08.000000000 -0600
@@ -4808,7 +4808,7 @@
        gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard");
        LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips");
 
-#if LL_VECTORIZE
+#if 1 || LL_VECTORIZE
        if (gSysCPU.hasAltivec())
        {
                gSavedSettings.setBOOL("VectorizeEnable", TRUE );

Bam, hello SSE:

2007-12-03T19:33:44Z INFO: update_vector_performances: Vectorization         : ENABLED
2007-12-03T19:33:44Z INFO: update_vector_performances: Vector Processor      : SSE2
2007-12-03T19:33:44Z INFO: update_vector_performances: Vectorized Skinning   : DISABLED

2007-12-03T19:36:53Z INFO: updateGeometry: run averages (1/10) vectorize
off 1.18422% : vectorize type 2 1.23795% : performance boost 7.59775%

And it still runs on the T-bird. Looks like Fedora users are getting
SSE. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20071203/474077f1/attachment.pgp


More information about the SLDev mailing list