[PATCH xserver] Fix FP3232 related issues.
daniel at fooishbar.org
Tue Oct 4 08:43:26 PDT 2011
2011/10/4 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <michel.daenzer at amd.com>
> Make check has been broken since commit
> f32c827d513c44f07e1d0fbcc0c96cef18c9a4d9 ('Input: Fix frac calculation on
> [Raw]DeviceEvent conversion').
> * Use floor() instead of trunc() in order to achieve the inverse of
> FP3232.integral + FP3232.frac / (1ULL << 32)
> even for negative floating point numbers.
> * Use (1ULL << 32) instead of (1 << 16) * (1 << 16) in order to save one
> floating point multiplication.
> * Fix up test code.
As discussed recently, the * (1 << 16) * (1 << 16) was a fix for
32-bit systems which can't get their head around large numbers; even
so, see the thread where Jeremy, Peter and myself discuss creating a
helper function for this using ldexp().
More information about the xorg-devel