MMX assembly

Started by
3 comments, last by qonjure 22 years, 10 months ago
Is it worth to rewrite my matrix routines in MMX assembly or do visual c++ already generate MMX code or better?
Advertisement
MMX is for integer code, not floating point code, so unless you use fixedpoint math...

And no, to my knowledge, MSVC doens''t use mmx.
You can use the new SIMD instructions of the Pentium III and IV which are similar to MMX except they use floating point numbers rather than integers. Have a look on www.intel.com - there is a lot of info on SIMD there.
HenryLecturer in Computer Games TechnologyUniversity of Abertay DundeeScotlandUK
OOps, I forgot to say that - no VC++ does not compile SIMD instructions you need to use the latest version of the Macro assembler MASM which I think can also be used to generate SIMD code. With SIMD code you can execute a single instruction to operate on four floating point numbers at the same time - cool for homogeneous vector calculations which have four variables x,y,z,h.
HenryLecturer in Computer Games TechnologyUniversity of Abertay DundeeScotlandUK
MS Visual C++ _CAN_ compile SIMD instructions -- you first need to download the Processor Pack from the VS website (http://www.microsoft.com/vstudio ?). It includes a set of intrinsics which define many operations which normally would require a whole pile of inline assembly (such as addition, subtration etc. of 128bit types). I think there''s also some other things like debugging and memory management stuff, but I could be wrong (I haven''t played arround with it much). It also includes the lastest MASM, so you can compile pure .asm files as well as inline assembly.

Like henryx was saying, there are also a lot of pre-definied types which fit into the 128 bit registers, as well as many operators for them (the Intrinsics). You can also define a variety of other types.

So now nobody can say they can''t use SIMD because they can''t compile for it.

Hope this helps,

Simon Wilson,
XEOS Digital Development
XEOS Digital Development - Supporting the independant and OpenSource game developers!

This topic is closed to new replies.

Advertisement