Closed Bug 646321 Opened 9 years ago Closed 9 years ago

qcms: Avoid unnecessary conversion to double

Categories

(Core :: GFX: Color Management, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Details

Attachments

(1 file)

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
http://hg.mozilla.org/mozilla-central/rev/bd338849a167
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Assignee: nobody → jmuizelaar
You need to log in before you can comment on or make changes to this bug.