Closed
Bug 1011539
Opened 11 years ago
Closed 11 years ago
IonMonkey: Implement Sub Recover Instruction
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: nbp, Assigned: sankha)
References
(Blocks 1 open bug)
Details
(Whiteboard: [good first bug][mentor=nbp][lang=c++])
Attachments
(2 files, 1 obsolete file)
5.75 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
267.85 KB,
image/png
|
Details |
Implement RSub in js/src/jit/Recover.cpp.
See Bug 1003801 comment 0 for explanation.
Comment 1•11 years ago
|
||
Hi Nicolas,
I would like to work on this as my first bug. I have successfully built SpiderMonkey and ran jit-tests on the js shell with all pass. What should be my next steps?
Thanks for the opportunity!
Sincerely,
Amol
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8424456 -
Flags: review?(nicolas.b.pierron)
Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8424456 [details] [diff] [review]
patchv1
Review of attachment 8424456 [details] [diff] [review]:
-----------------------------------------------------------------
Have you checked the result of iongraph?
Can you also attach the png which highlight that RSub are correctly flagged as recover instruction in the rsub_float function.
::: js/src/jit-test/tests/ion/dce-with-rinstructions.js
@@ +117,5 @@
> +var uceFault_sub_float = eval(uneval(uceFault).replace('uceFault', 'uceFault_sub_float'));
> +function rsub_float(i) {
> + var t = Math.fround(1/3);
> + var fi = Math.fround(i);
> + var x = Math.fround(Math.fround(Math.fround(Math.fround(t - fi) + t) - fi) + t);
Can we make this test only depend on RSub and not RAdd, otherwise as RAdd is correct, we would not be able to check any error in the result of the substraction.
@@ +119,5 @@
> + var t = Math.fround(1/3);
> + var fi = Math.fround(i);
> + var x = Math.fround(Math.fround(Math.fround(Math.fround(t - fi) + t) - fi) + t);
> + if (uceFault_sub_float(i) || uceFault_sub_float(i))
> + assertEq(x, -197);
Comment with details operations.
@@ +133,5 @@
> radd_float(i);
> radd_string(i);
> radd_object(i);
> + rsub_number(i);
> + rsub_float(i);
Add rsub_object too.
Attachment #8424456 -
Flags: review?(nicolas.b.pierron)
Reporter | ||
Comment 4•11 years ago
|
||
(In reply to amol.com from comment #1)
> I would like to work on this as my first bug. I have successfully built
> SpiderMonkey and ran jit-tests on the js shell with all pass. What should be
> my next steps?
Great, if you don't mind I will let you work on RMod (Bug 1012632), which is basically the same idea, except that this is for the modulo operator.
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → sankha93
Comment 5•11 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #3)
>
> ::: js/src/jit-test/tests/ion/dce-with-rinstructions.js
> @@ +117,5 @@
> > +var uceFault_sub_float = eval(uneval(uceFault).replace('uceFault', 'uceFault_sub_float'));
> > +function rsub_float(i) {
> > + var t = Math.fround(1/3);
> > + var fi = Math.fround(i);
> > + var x = Math.fround(Math.fround(Math.fround(Math.fround(t - fi) + t) - fi) + t);
>
> Can we make this test only depend on RSub and not RAdd, otherwise as RAdd is
> correct, we would not be able to check any error in the result of the
> substraction.
>
> @@ +119,5 @@
> > + var t = Math.fround(1/3);
> > + var fi = Math.fround(i);
> > + var x = Math.fround(Math.fround(Math.fround(Math.fround(t - fi) + t) - fi) + t);
> > + if (uceFault_sub_float(i) || uceFault_sub_float(i))
> > + assertEq(x, -197);
>
> Comment with details operations.
>
Would the following be a reasonable test for avoiding the RAdd? Or the numbers look too ugly?
var x = Math.fround(Math.fround(Math.fround(Math.fround(fi - t) - t) - fi) - t);
if (uceFault_sub_float(i) || uceFault_sub_float(i))
assertEq(x, -1.0000051259994507); /* != -1.0000000298023224 (when computed with double subtractions) */
Reporter | ||
Comment 6•11 years ago
|
||
Note that Sankha is currently assigned & working on this bug, he will come back to it tonight.
(In reply to Inanc Seylan from comment #5)
> (In reply to Nicolas B. Pierron [:nbp] from comment #3)
> >
> > ::: js/src/jit-test/tests/ion/dce-with-rinstructions.js
> > @@ +117,5 @@
> > > +var uceFault_sub_float = eval(uneval(uceFault).replace('uceFault', 'uceFault_sub_float'));
> > > +function rsub_float(i) {
> > > + var t = Math.fround(1/3);
> > > + var fi = Math.fround(i);
> > > + var x = Math.fround(Math.fround(Math.fround(Math.fround(t - fi) + t) - fi) + t);
> >
> > Can we make this test only depend on RSub and not RAdd, otherwise as RAdd is
> > correct, we would not be able to check any error in the result of the
> > substraction.
>
> Would the following be a reasonable test for avoiding the RAdd? Or the
> numbers look too ugly?
>
> var x = Math.fround(Math.fround(Math.fround(Math.fround(fi - t) - t) - fi) -
> t);
> if (uceFault_sub_float(i) || uceFault_sub_float(i))
> assertEq(x, -1.0000051259994507); /* != -1.0000000298023224 (when
> computed with double subtractions) */
This is the way to go as these do not depend on RAdd, and only sequences of float operations can highlight the differences between float and double computations. So by alternating RAdd and RSub, might have masked the missing truncations.
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #8424456 -
Attachment is obsolete: true
Attachment #8428867 -
Flags: review?(nicolas.b.pierron)
Assignee | ||
Comment 8•11 years ago
|
||
This PNG shows the sub instruction in gray like resume points.
Reporter | ||
Comment 9•11 years ago
|
||
Comment on attachment 8428867 [details] [diff] [review]
patch v2
Review of attachment 8428867 [details] [diff] [review]:
-----------------------------------------------------------------
This sounds good.
Attachment #8428867 -
Flags: review?(nicolas.b.pierron) → review+
Assignee | ||
Comment 10•11 years ago
|
||
Keywords: checkin-needed
Comment 11•11 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•