Closed
Bug 888237
Opened 11 years ago
Closed 11 years ago
IonMonkey: (ARM) Use hardware divide instruction to calculate modulus
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 file)
12.54 KB,
patch
|
mjrosenb
:
review+
|
Details | Diff | Splinter Review |
Following on from bug 872824, we can use the divide instruction to calculate modulus too, on appropriate hardware.
Assignee | ||
Comment 1•11 years ago
|
||
Very similar to the divide case. Uses the combination of divide and then multiply-subtract to calculate the modulus.
Attachment #777179 -
Flags: review?(mrosenberg)
Comment 2•11 years ago
|
||
Comment on attachment 777179 [details] [diff] [review]
Proposed change
Review of attachment 777179 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/ion/arm/CodeGenerator-arm.cpp
@@ +706,5 @@
> + // save the lhs in case we end up with a 0 that should be a -0.0 because lhs < 0.
> + masm.ma_mov(lhs, callTemp);
> +
> + Label done;
> + if (!modICommon(mir, lhs, rhs, output, ins->snapshot(), done))
I suspect that we can eliminate this. The ARM ARM says that INT_MIN / -1 produces INT_MIN, and INT_MIN - (INT_MIN * -1) == INT_MIN + INT_MIN == 0, which is the result that we want. The following negative checks should ensure that a non-truncated result bails, and truncated results become 0.
Attachment #777179 -
Flags: review?(mrosenberg) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•