Closed Bug 1905609 Opened 11 months ago Closed 11 months ago

Clean-up various floating point conversion methods

Categories

(Core :: JavaScript Engine: JIT, task)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(19 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Perform some clean-up in preparation for bug 1835034.

Add liveVolatileRegs to avoid some code duplication.

Add liveVolatileRegs to avoid some code duplication.

The issue mentioned in the comment no longer applies to CacheIR. See also bug 836000.

Depends on D215327

And avoid code duplication in MToFPInstruction sub-classes.

Depends on D215329

Also remove DISPATCH_FLOATING_POINT_OP macro.

Depends on D215331

And change GenerateJitEntry to avoid using ScratchTagScopeRelease.

Depends on D215332

Code-gen changes:

  • ARM32 loaded 1.0 into the output register and conditionally subtracted the
    output with itself to compute 0.0. The new code-gen uses int32-to-float
    conversions instead.

  • MIPS had an extra call to convertBoolToInt32 before convertInt32ToFloat32.
    It's unclear why this was performed, because JS::TrueValue and JS::FalseValue
    don't have any extra bits set which require convertBoolToInt32.

  • LOONG64 and RISCV code was copied from MIPS, so it also had the extra call to
    convertBoolToInt32.

Depends on D215334

Directly read from payloadOrValueReg to match convertValueToFloatingPoint,
which also saves a move in X64 and ARM64.

Depends on D215336

Depends on D215337

64, RISCV, and MIPS64 performed an additional unboxInt32 to first
move the value into a scratch register. This doesn't look necessary,
for example ARM64 directly converted the value into a double.

Depends on D215338

64, RISCV, and MIPS64 performed an additional unboxInt32 to first
move the value into a scratch register. This doesn't look necessary,
for example ARM64 directly converted the value into a double.

Depends on D215338

64, RISCV, and MIPS64 performed an additional unboxInt32 to first
move the value into a scratch register. This doesn't look necessary,
for example ARM64 directly converted the value into a double.

Depends on D215338

Blocks: 1835034
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5c9d6193adbf Part 1: Add CacheIRCompiler::liveVolatileRegs() method. r=jandem https://hg.mozilla.org/integration/autoland/rev/938c62c4b746 Part 2: Remove an outdated restriction. r=jandem https://hg.mozilla.org/integration/autoland/rev/5958fa2e4e82 Part 3: Use scratch register when available. r=jandem https://hg.mozilla.org/integration/autoland/rev/e436cecf3988 Part 4: Remove unused MToFPInstruction::ConversionKind. r=jandem https://hg.mozilla.org/integration/autoland/rev/3b9b53aa8e11 Part 5: Remove unused IntConversionInputKind::NumbersOrBoolsOnly. r=jandem https://hg.mozilla.org/integration/autoland/rev/6ae199d650a2 Part 6: Merge code to convert JS::Value to Float32/Double. r=jandem https://hg.mozilla.org/integration/autoland/rev/1fb1c737d9df Part 7: Remove {bool,int32}ValueToDouble calls from GenerateJitEntry. r=jandem https://hg.mozilla.org/integration/autoland/rev/1f59cc9362d7 Part 8: Replace int32ValueTo{Float32,Double} with direct calls to convertInt32To{Float32,Double}. r=jandem https://hg.mozilla.org/integration/autoland/rev/2333bfe3a36b Part 9: Replace boolValueTo{Float32,Double} with direct calls to convertInt32To{Float32,Double}. r=jandem https://hg.mozilla.org/integration/autoland/rev/62e3c8983d41 Part 10: Merge Int32 and Bool codepaths in convertValueToFloatingPoint. r=jandem https://hg.mozilla.org/integration/autoland/rev/29a868060e95 Part 11: Avoid an extra move in MacroAssembler::convertInt32ValueToDouble. r=jandem https://hg.mozilla.org/integration/autoland/rev/39f29404d94d Part 12: Clean-up fuzzilli codegen. r=jandem https://hg.mozilla.org/integration/autoland/rev/00d1a13b7fb4 Part 13: Share MacroAssembler::ensureDouble. r=jandem https://hg.mozilla.org/integration/autoland/rev/c788f13a3a12 Part 14: Rename convertValueToFloat to convertValueToFloat32. r=jandem https://hg.mozilla.org/integration/autoland/rev/9efa1f43808a apply code formatting via Lando
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: