Closed
Bug 918163
Opened 11 years ago
Closed 11 years ago
IonMonkey: specialize MMathFunction for Float32
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: bbouvier, Assigned: bbouvier)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
So that Math.fround(cos(Math.fround(1)) uses cosf and not cos.
Comment 1•11 years ago
|
||
OOC, will the float analysis recognize literals that are exactly representable as floats like 1 or 1.5 as float producers?
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #1)
> OOC, will the float analysis recognize literals that are exactly
> representable as floats like 1 or 1.5 as float producers?
Yes.
Assignee | ||
Comment 3•11 years ago
|
||
Here are some specializations for some math functions. It looks like the other ones are not standard, so some stub implementations should be made in jsmath and the build system should detect which one are to implement.
Attachment #807555 -
Flags: review?(sstangl)
Comment 4•11 years ago
|
||
Comment on attachment 807555 [details] [diff] [review]
Some maths functions
Review of attachment 807555 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good!
::: js/src/jit/CodeGenerator.cpp
@@ +3815,5 @@
> + void *funptr = NULL;
> + switch (ins->mir()->function()) {
> + case MMathFunction::Log:
> + funptr = JS_FUNC_TO_DATA_PTR(void *, logf);
> + break;
This would look better condensed to a single line:
|case MMathFunction::Log: funptr = ...; break;|
@@ +3849,5 @@
> + case MMathFunction::ASinH:
> + case MMathFunction::ATanH:
> + case MMathFunction::Sign:
> + case MMathFunction::Trunc:
> + case MMathFunction::Cbrt:
It isn't necessary to list the unhandled cases explicitly -- "default" is fine.
Attachment #807555 -
Flags: review?(sstangl) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Thanks for the quick review!
Carrying forward r+
Attachment #807555 -
Attachment is obsolete: true
Attachment #808004 -
Flags: review+
Comment 6•11 years ago
|
||
See errors compiling with the above patch:
js/src/jit/MIR.h:3513:31: error: expected template-name before ‘<’ token
js/src/jit/MIR.h:3513:31: error: expected ‘{’ before ‘<’ token
js/src/jit/MIR.h:3513:31: error: expected unqualified-id before ‘<’ token
In file included from js/src/jit/MIRGenerator.h:13:0,
from js/src/jit/MIRGraph.h:16,
from js/src/vm/ForkJoin.cpp:22:
Assignee | ||
Comment 7•11 years ago
|
||
RuntimePolicy was renamed into FloatingPointPolicy in bug 913282, which hasn't landed yet.
Attachment #808004 -
Attachment is obsolete: true
Attachment #808818 -
Flags: review+
Assignee | ||
Comment 8•11 years ago
|
||
Douglas, I checked on ARM qemu and it seems to work correctly. Could you test on some real ARM devices, please? It's a huge win and that would be nice to get it landed.
Flags: needinfo?(dtc-moz)
Comment 9•11 years ago
|
||
(In reply to Benjamin Bouvier [:bbouvier] (not online until 10/16) from comment #8)
> Douglas, I checked on ARM qemu and it seems to work correctly. Could you
> test on some real ARM devices, please? It's a huge win and that would be
> nice to get it landed.
This patch seems to have been included in the fuzzing patch in bug 913282
and testing is so far positive.
Flags: needinfo?(dtc-moz)
Assignee | ||
Comment 10•11 years ago
|
||
Douglas, thanks for your feedback. I re-checked locally and tests still pass. I think this patch can now land.
Attachment #808818 -
Attachment is obsolete: true
Attachment #818273 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 11•11 years ago
|
||
This bug landed with the wrong number (918613)
Comment 12•11 years ago
|
||
Indeed. Ben, try to be more careful in the future :)
https://hg.mozilla.org/mozilla-central/rev/e1226725f674
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Assignee | ||
Comment 13•11 years ago
|
||
Oops! Sorry about that, I'll double check every time from now.
Assignee | ||
Comment 14•11 years ago
|
||
Comment 15•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•