This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/14941] i386.md strangeness in sse2_movsd
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2004 15:44:15 -0000
- Subject: [Bug target/14941] i386.md strangeness in sse2_movsd
- References: <20040413142230.14941.davide.rossetti@roma1.infn.it>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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