annotate gcc/testsuite/g++.dg/other/i386-4.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
kono
parents:
diff changeset
2 /* { dg-options "-O1 -msse2" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 #include <xmmintrin.h>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 void ConvertFloatSSE (void *inBuff, void *outBuff, int len)
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 unsigned char *inByteBuffer = reinterpret_cast < unsigned char *>(inBuff);
kono
parents:
diff changeset
9 float *outFloatBuffer = reinterpret_cast < float *>(outBuff);
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 for (int i = 0; i < len / 4; i++)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 __m128i register1 =
kono
parents:
diff changeset
14 _mm_set_epi8 (*inByteBuffer, *(inByteBuffer + 1),
kono
parents:
diff changeset
15 *(inByteBuffer + 2), 0,
kono
parents:
diff changeset
16 *(inByteBuffer + 3), *(inByteBuffer + 4),
kono
parents:
diff changeset
17 *(inByteBuffer + 5), 0,
kono
parents:
diff changeset
18 *(inByteBuffer + 6), *(inByteBuffer + 7),
kono
parents:
diff changeset
19 *(inByteBuffer + 8), 0,
kono
parents:
diff changeset
20 *(inByteBuffer + 9), *(inByteBuffer + 10),
kono
parents:
diff changeset
21 *(inByteBuffer + 11), 0);
kono
parents:
diff changeset
22 __m128i register2 = _mm_srai_epi32 (register1, 8);
kono
parents:
diff changeset
23 __m128 register3 = _mm_cvtepi32_ps (register2);
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 _mm_store_ps (outFloatBuffer, register3);
kono
parents:
diff changeset
26 outFloatBuffer += 4;
kono
parents:
diff changeset
27 inByteBuffer += 12;
kono
parents:
diff changeset
28 }
kono
parents:
diff changeset
29 }