Closed Bug 1913949 Opened 1 year ago Closed 1 year ago

Fold MInt64ToBigInt in MNot and MCompare

Categories

(Core :: JavaScript Engine: JIT, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Folding MInt64ToBigInt in MNot and MCompare will allow to use Int64 codegen during lowering.

For example:

let x = i64[0];
if (x > 100) { ... }

will then be compiled to:

[Codegen]                                 # LIR=LoadUnboxedInt64
[Codegen] movq       0x0(%rcx), %rax
[Codegen]                                 # LIR=CompareI64AndBranch:Gt
[Codegen] cmpq       $0x64, %rax
[Codegen] jle        .Lfrom84

Removing the conversion allows to generate LTestI64AndBranch instructions
for code like:

let x = i64TypedArray[i];
if (x) { ... }

This will now generate:

movq       0x0(%rcx), %rax
testq      %rax, %rax
je         .Lfrom00

This will allow to generate Int64 comparisons for elements loaded from
BigInt64 typed arrays.

For example:

let x = i64TypedArray[i];
if (x > 100) { ... }

Is now compiled to:

movq       0x0(%rcx), %rax
cmpq       $0x64, %rax
jle        .Lfrom00
Blocks: sm-jits
Severity: -- → N/A
Priority: -- → P1
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9040c09caecd Part 1: Fold MInt64ToBigInt in MNot. r=spidermonkey-reviewers,iain https://hg.mozilla.org/integration/autoland/rev/7d0c74e617ec Part 2: Fold MInt64ToBigInt in MCompare. r=spidermonkey-reviewers,iain
Regressions: 1918984
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: