[Bug 728129] exec_opcodes_sys test fails on Intel i7-2620M when built with clang 3.5

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Apr 15 00:17:52 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=728129
  GStreamer | orc | git

--- Comment #4 from Sebastian Dröge (slomo) <slomo at coaxion.net> 2014-04-15 07:17:47 UTC ---
The remaining problem here is the convdl and convfl code. The result of casting
a float/double to an integer is undefined if the integral part of the
float/double can't be represented by the target integer type.

gcc apparently casts everything to 0x80000000 according to the existing code,
clang to 0x00000000 or 0x80000000 depending on the phase of moon.

Adding this check to the code
> else if (tmp == 0 && (var32.f > 1.0 || var32.f < -1.0)) tmp = 0x7fffffff
fixes it for most cases. The only remaining problem is that clang returns
0x80000000 in some cases for huge negative numbers, and the check above does
not catch that
> if (tmp == 0x80000000 && !(var32.i&0x80000000)) tmp = 0x7fffffff
because the sign bit is set in the float.

We could add another check that automatically changes floats > MAX or < MIN to
0x7fffffff but even then I wouldn't be surprised if the behaviour of the
various SIMD instructions to do this conversion is different for the undefined
case.


What should we do here?

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list