This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Where the fact that -msse2 has to be used with -O documented?


On Mon, 21 Jan 2013, Peng Yu wrote:

The following commands showed that -msse2 has to be used with -O (or
its variants -O1, -O2, etc.) But I don't find this documented in the
gcc manual. Does anybody know where this is documented? Thanks!

It is just luck that makes it sometimes work.


#include <xmmintrin.h>
#include <stdio.h>

int main() {
 float p[4]={1,2,3,4};
 __m128 a = _mm_load_ps(p);

_mm_load_ps requires a 16-byte alignment.


 float p1[4];
 _mm_store_ps(p1, a);
 for(int i=0; i < 4; i++) {
   printf("%g\n", p1[i]);
 }
}

-- Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]