Re[4]: [ODE] Faster ODE

Nguyen Binh Nguyen Binh <ngbinh at glassegg.com>
Mon Nov 25 18:49:03 2002


Hi ,

HH> I've been thinking about SIMD (MMX, 3DNow(!), SSE(2)) instructions for ODE -
HH> and it is quite possible that it can bring about harmony and speed. But one
HH> thing that is likely going to cause problems is the SSE(2) code.


HH> For optimal performance a number of details need to be implemented. Vectors
HH> and matrices need to be of a horizontal size that is a factor of 4 (this is
HH> implemented and the reason why, for example, a 3x3 matrix is defined as a 12
HH> TReal (3x4) structure.

    Take a look at Small Matrix Lib (SML) of Intel, you'll see that we have
    at least a way to solve this.

HH> However, the structures also have to be aligned onto 16-byte boundaries. To
HH> allow for optimal SSE(2) access (using movaps) each 128-bit memory vector
HH> that is accessed has to be alligned on a 16-byte memory boundary. This is a
HH> problem in ODE, as every math structure now is required to be 16-byte
HH> aligned; this is difficult to achieve because ODE calls/uses sub-matrices of
HH> matrices, and it may be difficult to guarantee that every sub-matrix is
>>also< correctly 16-byte aligned.

    Also, SML solved these.
    But we may consider move all matrix, vector,... of ODE to the
    matrix, vector ,... of SML. I assure it'll not be hard cause right
    now vectors,matrixs of ODE are barely a typdef TReal* .
    Moreover, in SML we have a type of dimension-variable matrix that
    has built-in LU decomposition function.

HH> Additionally SSE2 primarily adds double-float functionality to the SIMD
HH> instructions. This can help somewhat for speed in the TReal = double case,
HH> but isn't likely (just my guess) to have as tremendous a speed bonus as 4
HH> single floats that can be handled simultaneously for TReal = single.

    OK, just your guess. I'm SIMDing ODE, I'll put my benchmark when
    it finishes.

-- 
Best regards,

---------------------------------------------------------------------
   Nguyen Binh
   Software Engineer
   Glass Egg Digital Media
   Me Linh Point Tower, 10th Floor
   2 Ngo Duc Ke
   District 1, Ho Chi Minh City
   Vietnam
   Fax:  (84.8)823-8392
     www.glassegg.com
---------------------------------------------------------------------