Compiler Data

Within the recent Visual C++ and Intel compilers SIMD functionality has been incorporated, such as the allocation of registers and aligned stack memory.




(64-bit) memory for MMX


(128-bit) memory for single-precision floating-point


(128-bit) memory for double-precision floating-point


(128-bit) memory for streaming integer SSE2

These align stack memory through a mask.

 __m128 ta, tb;  push     ebx   mov      ebx,esp   and      esp,0FFFFFFF0h ; 16-byte alignment  movaps   xmm0,xmmword ptr [esp-20h] ; tb   movaps   xmm1,xmmword ptr [esp-10h] ; ta 

Using this same implementation, a bit of magic using unions can be utilized:

 #define MY_FLT_ARY 100 union  {   __m128 t[ MYFLT_ARY/4 ];   float ary[ MYFLT_ARY ];  }; 

The __m128 aligns the stack memory, which the float takes advantage of since it is the same size , and maps to the same location compliments of the nameless union declaration.

There are other methodologies, but these should get you rolling for now.


Use assertions in your code to trap errors early in the development process.

32.64-Bit 80X86 Assembly Language Architecture
32/64-Bit 80x86 Assembly Language Architecture
ISBN: 1598220020
EAN: 2147483647
Year: 2003
Pages: 191

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: