------- Additional Comments From uros at kss-loka dot si  2004-11-30 15:44 
-------
This is similar problem as PR18503. The vec_merge selector is wrong, and
sse2_movsd pattern could be combined into other patterns in the wrong way.
This testcase, adapted from PR18503 for V2DF will show the problem. The results
will be different with and without -02.

#include <emmintrin.h>
#include <stdio.h>

static __m128 bug(__m128 a, __m128 b) {
        __m128 c = _mm_sub_pd(a, b);
        return _mm_move_sd(c, a);
}

int main(void) {
        double val1 = 1.3, val2 = 2.1, result[2];
        __m128 error = bug(_mm_load1_pd(&val1), _mm_load1_pd(&val2));
        _mm_storeu_pd(result, error);
        printf("%f %f\n", result[0], result[1]);
        return 0;
}

This bug (and several others) should be fixed by:
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01859.html

Uros.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14941

Reply via email to