Qt5 switching qreal from float to double on arm*
peter green
plugwash at p10link.net
Sat Nov 2 23:25:57 UTC 2013
Lisandro Damián Nicanor Pérez Meyer wrote:
> Any feedback will be kindly appreciated.
>
I've always thought there is something fundamentally wrong.
What is qreal supposed to be used for? If it's supposed to be used for
things where float would be adequate then shouldn't it be float on all
platforms? If it's supposed to be used for things where float is
inadequate then why isn't it double on all platforms?
The current situation leads to people who develop on i386 and amd64
(which is most developers) assuming that qreal is equivilent to double.
Then we try and build it on arm* and float gets used. Sometimes this is
ok because there was really no reason for the developer to be using
double precision in the first place and there were no incorrect
conversion assumptions. Sometimes this causes build failures which can
be difficult to resolve* and I bet in some cases it causes more subtule
bugs. It also goes against the principle of offering to the greatest
extent possible the same functionality on all platforms.
Making qreal double on armhf but leaving it as float on armel will mean
that canonical are no longer forced for fix bugs surrounding it. I'm
sure canonical would like that but I also suspect it may cause severe
degredation in the maintainance of QT software on those ports that stick
with qreal.
On the other hand presumablly there would be a performance hit from
switching from float to double, especially on platforms which use
software floating point (I presume that was why whoever controlled qt at
the time made qreal float on arm in the first place).
I found some older upstream discussion on what to do about float at
https://groups.google.com/forum/#!topic/qt-project-list-development/dPcP3NASY1k
I also found some discussion at
http://comments.gmane.org/gmane.comp.lib.qt.qt5-feedback/700 saying that
on coretex A8 double was significantly slower than float.
Finally has there been any discussion with other linux distros. This is
obviously something that impacts the ABI in a big way so ideally it's
not something where we want different distros doing different things.
* See scribus for an especially nasty example.
More information about the pkg-kde-talk
mailing list