Closed Bug 1023404 Opened 6 years ago Closed 2 years ago

[meta] SIMD backend: implement SIMD operations for x86/x64


(Core :: JavaScript Engine: JIT, defect, P5)






(Reporter: bbouvier, Assigned: bbouvier)



(Keywords: meta)


(2 files, 1 obsolete file)

This bug should serve as a meta-bug for referencing all patches implementing SIMD operations.

As discussed with involved people, instructions should be grouped whenever possible, when they have similar semantics:
- with{X,Y,Z,W}
- same thing for withFlag
- add / sub / mul / div can be grouped as they all are binary arithmetic instructions
- equal / greaterThan / lessThan / notEqual
- min / max
- shiftLeft, shiftRight, shiftRightLogical
- and, or, not, xor
- lane accessors and shuffle

We should be careful and write some assertions that we are in a supported platform (in this case, x86 and x64). I will add a few blocking bugs as well as referencing others.
Just splitted up the patch from bug 1021716, as it had nothing to do there.
Attachment #8437780 - Flags: review?(sunfish)
Attachment #8437780 - Flags: review?(sunfish) → review+
Depends on: 1025100
Depends on: 1025127
Depends on: 1044256
Attached patch SimdDataSize (obsolete) — Splinter Review
There are a few places in the code where we need to memcpy / memcmp SIMD values. Let's introduce a variable that holds the current size of SIMD datum to be used in these cases.

Also adds a few names for iongraph.
Attachment #8463350 - Flags: review?(sunfish)
Carrying forward r+ from sunfish.

- renames "arity" into "length"
- SIMD => Simd
Attachment #8463352 - Flags: review+
Comment on attachment 8463350 [details] [diff] [review]

Review of attachment 8463350 [details] [diff] [review]:

::: js/src/jit/shared/Assembler-shared.h
@@ +28,5 @@
> +static const uint32_t SimdDataSize = 4 * sizeof(int32_t);
> +static_assert(SimdDataSize >= 4 * sizeof(int32_t), "SIMD data should be able to contain int32x4");
> +static_assert(SimdDataSize >= 4 * sizeof(float), "SIMD data should be able to contain float32x4");
> +static_assert(SimdDataSize >= 2 * sizeof(double), "SIMD data should be able to contain float64x2");

Would it make sense to name this Simd128DataSize? Then these could be == rather than >= and we wouldn't have to worry about unused bytes for memcmp.
Attachment #8463350 - Flags: review?(sunfish) → review+
Comment on attachment 8463350 [details] [diff] [review]

Moved to bug 1019831 for consistency and dependency requirements.
Attachment #8463350 - Attachment is obsolete: true
Depends on: 1059529
Depends on: 1059749
Depends on: 1060789
No longer depends on: 1084319
Priority: -- → P5
This one bug was open to implement the codegen for all the SIMD operators proposed by SIMD.js on x86. We can consider it done, and this should be a sufficient starting point for the wasm SIMD implementation; codegen methods will remain in the x86-shared MacroAssembler files.
Closed: 2 years ago
Resolution: --- → FIXED
Assignee: nobody → bbouvier
You need to log in before you can comment on or make changes to this bug.