Skip to content

[x86] __m128 etc. memory alignment fix

Summary

This merge request makes a small change to the __m64, __m128 and __m256 internal types by changing them to vectors (calling carraydef.create_vector instead of carraydef.create). This ensures they are correctly aligned in memory (8 bytes for __m64, 16 bytes for __m128 and 32 bytes for __m256) instead of sharing the alignment with the element type.

Some supporting functions have also been modified to accommodate this.

System

  • Operating system: Windows
  • Processor architecture: i386, x86-64

What is the current bug behavior?

The __m64, __m128 and __m256 types have the wrong memory alignment as defined by Microsoft and so aren't directly portable to external functions that use those types in, for example, Microsoft Visual C++.

What is the behavior after applying this patch?

The __m64, __m128 and __m256 types are now aligned to 8 bytes, 16 bytes and 32 bytes respectively.

Merge request reports