Closed Bug 646321 Opened 9 years ago Closed 9 years ago
qcms: Avoid unnecessary conversion to double
No description provided.
Attachment #522914 - Flags: review?(bjacob)
Comment on attachment 522914 [details] [diff] [review] Avoid unnecessary conversion to double Is this performance-critical? If yes, then, since 65536 is a power of two, you can optimize this as a * (1/65536.f). In general the compiler is not allowed to perform this optimization since it can affect precision, so, in order to optimize that, the compiler would have to check if float literals are power-of-two integers: not sure how many compilers do that for float literals.
Attachment #522914 - Flags: review?(bjacob) → review+
The code is not performance critical. However, gcc does catch this and does a*(1/65536.f). LLVM does not catch it and I filed a bug http://llvm.org/bugs/show_bug.cgi?id=9587
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.