NO

Author Topic: Align 16 for use with SIMD instructions doesn't work  (Read 911 times)

Offline jj2007

  • Member
  • *
  • Posts: 447
Align 16 for use with SIMD instructions doesn't work
« on: June 21, 2015, 11:14:34 AM »
Any ideas why this doesn't work as expected?

Code: [Select]
__declspec(align(16)) byte xms[512];

void XmmPrint(int index) {
  RECT rc;
//   __m128 xms[32]; // same problem
  __asm int 3;
  __asm lea eax, xms; // eax is 004090E4, clearly unaligned...
  __asm fxsave xms;

P.S.:
Perhaps I can do something about __declspec(align()) for variables later. It suspect it will take much more than "5 minutes", so not top priority at the moment...

P.P.S.: The locally defined version works: __declspec(align(16)) byte xms[512];
« Last Edit: June 21, 2015, 11:36:03 AM by jj2007 »