This is the mail archive of the gcc-bugs@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]

[Bug target/38899] pessimizes function without SSE intrinsics



------- 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


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