This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/38899] pessimizes function without SSE intrinsics
- From: "tbm at cyrius dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2009 19:40:26 -0000
- Subject: [Bug target/38899] pessimizes function without SSE intrinsics
- References: <bug-38899-12387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from tbm at cyrius dot com 2009-01-17 19:40 -------
Testcase:
#include <stdio.h>
#include <xmmintrin.h>
#ifndef MUL
#define MUL mul
#endif
void mul(float in1[4], float in2[4], float out[4])
{
int i;
for (i = 0; i < 4; i++)
out[i] = in1[i] * in2[i];
}
void mul2(float in1[4], float in2[4], float out[4])
{
__m128 a, b, c;
a = _mm_load_ps(in1);
b = _mm_load_ps(in2);
c = _mm_mul_ps(a, b);
_mm_store_ps(out, c);
}
int main(void)
{
float inp1[] = {
1.2, 3.5, 1.7, 2.8
};
float inp2[] = {
-0.7, 2.6, 3.3, -4.0
};
float outp[4];
MUL(inp1, inp2, outp);
printf("%f %f %f %f\n", outp[0], outp[1], outp[2], outp[3]);
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899