Last Comment Bug 783290 - IonMonkey: LMathD should allow memory operands on x86
: IonMonkey: LMathD should allow memory operands on x86
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: ---
Assigned To: Jan de Mooij [:jandem]
: general
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: IonSpeed
  Show dependency treegraph
Reported: 2012-08-16 08:34 PDT by Jan de Mooij [:jandem]
Modified: 2012-08-17 00:51 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (5.16 KB, patch)
2012-08-16 08:34 PDT, Jan de Mooij [:jandem]
dvander: review+
Details | Diff | Splinter Review

Description User image Jan de Mooij [:jandem] 2012-08-16 08:34:46 PDT
Created attachment 652462 [details] [diff] [review]

On top of bug 783272 this removes 5 more instructions from the loop in 3d-cube DrawLine:

for (; i < NumPix; i++) {
    Num += NumAdd;
    if (Num >= Den) {
        Num -= Den;
        x += IncX1;
        y += IncY1;
    x += IncX2;
    y += IncY2;

With range analysis + bug 762095 there's not much more we can optimize - we will emit something like:

0x1ca78c0:	cmpl   $0x0,0x140ba00
0x1ca78c7:	jne    0x1ca7a79
0x1ca78db:	cmp    %ecx,%edi
0x1ca78dd:	jge    0x1ca79f7
0x1ca78f8:	addsd  %xmm6,%xmm5
0x1ca7903:	ucomisd %xmm2,%xmm5
0x1ca7907:	jp     0x1ca798a
0x1ca790d:	jb     0x1ca798a
0x1ca7949:	subsd  %xmm2,%xmm5
0x1ca7954:	addsd  %xmm0,%xmm3
0x1ca795f:	addsd  %xmm1,%xmm4
0x1ca798a:	addsd  0x28(%esp),%xmm3
0x1ca79a8:	addsd  0x30(%esp),%xmm4
0x1ca79be:	add    $0x1,%edi
0x1ca79eb:	jmp    0x1ca78c0
Comment 1 User image Jan de Mooij [:jandem] 2012-08-17 00:51:36 PDT

Note You need to log in before you can comment on or make changes to this bug.