Archived

This topic is now archived and is closed to further replies.

SIMD optimizations

This topic is 6925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I remember I read somewhere that for SIMD to work properly, each vertex should have 3 floats (or maybe a multiple of 3 flaots ... not so sure). So how do you achieve that in direct3D where you probably have to specify at least one set of texture co-ordinate in the vertex format?

Share on other sites
SIMD stands for Single Instruction, Multiple Data. It is just another way of threating data. Intel implemented this in their MMX (integer only) and ISSE (floating point)extension, AMD does this in MMX and 3DNow!

Now, what makes the SIMD instruction set so useful for 3D transforms (and lighting)? The fact that you can (amongst other things) do 4 floating point multiplies (4x32-bit float) in one instruction. Thus, when multiplying a 4-element vector with a 4x4 matrix, you can do a single row (1 coordinate) in one instruction, instead of 4. Thus, if you give only vertex data, the SIMD instruction set will already do it''s job.

For you, it means that you should just use D3D''s transform and lighting stage, and not worry about it. Should you want to write your own T&L stage, I recommend reading some docs about the ISSE instruction set. Intel has a few good interactive tutorials online.

DaBit.

Share on other sites
SIMD stands for Single Instruction, Multiple Data. It is just another way of threating data. Intel implemented this in their MMX (integer only) and ISSE (floating point)extension, AMD does this in MMX and 3DNow!

Now, what makes the SIMD instruction set so useful for 3D transforms (and lighting)? The fact that you can (amongst other things) do 4 floating point multiplies (4x32-bit float) in one instruction. Thus, when multiplying a 4-element vector with a 4x4 matrix, you can do a single row (1 coordinate) in one instruction, instead of 4. Thus, if you give only vertex data, the SIMD instruction set will already do it''s job.

For you, it means that you should just use D3D''s transform and lighting stage, and not worry about it. Should you want to write your own T&L stage, I recommend reading some docs about the ISSE instruction set. Intel has a few good interactive tutorials online.

DaBit.

I see. Thank you

• 16
• 9
• 15
• 10
• 13