[meta] SIMD backend: implement SIMD operations for ARM

NEW
Unassigned

Status

()

Core
JavaScript Engine: JIT
P5
normal
4 years ago
2 years ago

People

(Reporter: dougc, Unassigned)

Tracking

(Depends on: 1 bug)

unspecified
ARM
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(fennec+)

Details

Attachments

(3 attachments, 4 obsolete attachments)

(Reporter)

Description

4 years ago
This bug should serve as a meta-bug for referencing all patches implementing SIMD operations for the ARM 32-bit.
(Reporter)

Comment 1

4 years ago
* We will need a solution to the current 64 bit limitation on the float register SetType. This is blocking real progress. Might be able to make some progress on the implementation of the SIMD operations without this by using some hacks and very restrictive tests.

* Early codegen results suggest we are going to need access to all 32 double float and all 16 128-bit SIMD registers for useful performance. Even the simple mandelbrot demo is full of SIMD registers spilled to the stack in the hot loop. With only 16 double float and thus 8 128-bit SIMD registers, and with one SIMD register dedicated as a scratch, there remain only 7 SIMD registers and each takes 2 double float or 4 float32 registers. Not blocking progress, but probably performance.
Depends on: 1052384, 891211
(Reporter)

Updated

4 years ago
Blocks: 947711
(Reporter)

Comment 2

4 years ago
Created attachment 8497536 [details] [diff] [review]
Hack patch to get started.

With this hack patch it is possible to run the mandelbrot asm.js demo on the ARM simulator. The SIMD codegen is not implemented so not yet emitted, but there is some plausible lowering implemented and the register allocation looks plausible. Even with this incredible hack the mandelbrot demo still runs in the browser and the non-simd code path works.

Here are the unimplemented operations needed for the mandelbrot demo:
emitFloat32X4Move
emitInt32X4Move
visitFloat32x4
visitInt32x4
visitSimdBinaryArithFx4 Add
visitSimdBinaryArithFx4 Mul
visitSimdBinaryArithFx4 Sub
visitSimdBinaryArithIx4 Add
visitSimdBinaryCompFx4 lessThanOrEqual
visitSimdExtractElementI
visitSimdSignMaskX4
visitSimdSplatX4 MIRType_Float32x4
visitSimdValueFloat32x4
Flags: needinfo?(benj)
(Reporter)

Comment 3

4 years ago
Created attachment 8498840 [details] [diff] [review]
Hack patch to get started.

Rebase. Update for the shift operation, and add stubs for the select operation.
Attachment #8497536 - Attachment is obsolete: true
(Reporter)

Comment 4

4 years ago
Created attachment 8499627 [details] [diff] [review]
1. Move the shift operation lowering into the backends.

Moved from bug 1074867. Carrying forward r+.
Attachment #8499627 - Flags: review+
(Reporter)

Comment 5

4 years ago
Created attachment 8499630 [details] [diff] [review]
2. Move the shift operation lowering into the backends.

Moved from bug 1074867. Carrying forward r+.
Attachment #8499630 - Flags: review-
(Reporter)

Updated

4 years ago
Duplicate of this bug: 1074867
My hope is to get some time later to carry on this hack, to see the mandelbrot demo alive on the ARM simulator on a browser, if anybody else doesn't do it before. Having the mandelbrot demo working with this hack would be very helpful for generalizing regalloc / typeregistersets.
Flags: needinfo?(benj)
(Reporter)

Comment 8

4 years ago
Created attachment 8510844 [details] [diff] [review]
1. Move the insert-element lowering into the backends.

Rebase. Carry forward r+.
Attachment #8499627 - Attachment is obsolete: true
Attachment #8510844 - Flags: review+
(Reporter)

Updated

4 years ago
Attachment #8510844 - Attachment description: Move the insert-element lowering into the backends. → 1. Move the insert-element lowering into the backends.
(Reporter)

Comment 9

4 years ago
Created attachment 8510846 [details] [diff] [review]
2. move the shift operation lowering into the backends.

Rebase. Carry forward r+.
Attachment #8499630 - Attachment is obsolete: true
Attachment #8510846 - Flags: review+
(Reporter)

Comment 10

4 years ago
Created attachment 8510850 [details] [diff] [review]
3. Hack patch to start implementing SIMD operations for ARM

Rebased. Still works with the mandelbrot demo again - it compiles and generates plausible lower and register allocation but many of the SIMD code generation methods still need to be implemented.
Attachment #8498840 - Attachment is obsolete: true
(Reporter)

Updated

4 years ago
Attachment #8510850 - Attachment description: 3. Hack patch to start implementikng SIMD operations for ARM → 3. Hack patch to start implementing SIMD operations for ARM
tracking-fennec: --- → ?
We're interested in getting this into Fennec. We're tracking for 36, but understand that maybe that won't happen.
tracking-fennec: ? → 36+
tracking-fennec: 36+ → ?
tracking-fennec: ? → +
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.