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

Patch ping: _mm_move_ss SSE intrinsic causes erroneous results (PRtarget/18503)


Hello!

http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01859.html

Revision 1 of the patch was already approved, but it exposed another bug. All bugs were fixed by revision 2, which still avaits review.

Without the patch, this testcase returns different results for -O0 and -O2.

#include <xmmintrin.h>
#include <stdio.h>

__m128 bug(__m128 a, __m128 b) {
       __m128 c = _mm_sub_ps(a, b);
       return _mm_move_ss(c, a);
}

int main(void) {
       float val1 = 1.3f, val2 = 2.1f, result[4];
       __m128 error = bug(_mm_load1_ps(&val1), _mm_load1_ps(&val2));
       _mm_storeu_ps(result, error);
       printf("%f %f %f %f\n", result[0], result[1], result[2], result[3]);
       return 0;
}

Uros.


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