SIMD optimization x64/x86: inline constant load in various instructions
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
People
(Reporter: lth, Assigned: yury)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
Looking through the code for instances of loadConstantSimd128() into a temp followed by a single use of that temp, I see several cases where it might be profitable to load the constant as part of the instruction:
For PSHUFB in MacroAssembler::permuteInt8x16
For CMPGTB in MacroAssembler::swizzleInt8x16 (see also bug 1690483)
For PXOR and bitwiseXorSimd128 (!) in MacroAssemblerX86Shared::compareInt8x16, MacroAssemblerX86Shared::compareInt16x8, MacroAssemblerX86Shared::compareInt32x4
For UNPCKLPS and SUBPD in MacroAssemblerX86Shared::unsignedConvertInt32x4ToFloat64x2
For ANDPD in MacroAssemblerX86Shared::truncSatFloat64x2ToInt32x4
For MINPD and ADDPD in MacroAssemblerX86Shared::unsignedTruncSatFloat64x2ToInt32x4
In some cases, the profitability is questionable: if the constant is 0 or ~0 then it may be faster to generate it into a temp and use the temp. But the determination about profitability should be made in the emitter itself, as indeed binarySimd128() does properly already on behalf of eg bitwiseXorSimd128() and the others. The callers just have to make sure not to use the ScratchSimd128 temp, and we can enforce this safely.
Mostly this just finishes work already started.
Assignee | ||
Comment 1•4 years ago
|
||
Bug 1691485 adds pairwise add ops (i16x8.extadd_pairwise_XXXX) that require usage of loadConstantSimd128
Assignee | ||
Comment 2•4 years ago
|
||
Bug 1691489 adds popcnt op. X86 uses loadConstantSimd128 in MacroAssemblerX86Shared::popcntInt8x16
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Depends on D108798
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
bugherder |
Comment 7•4 years ago
|
||
Comment 9•4 years ago
|
||
bugherder |
Comment 10•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:lth, maybe it's time to close this bug?
Reporter | ||
Comment 11•4 years ago
|
||
Initial work was performed by a volunteer but there are more work items here. Unassigning.
Comment 12•3 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:lth, maybe it's time to close this bug?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 14•3 years ago
|
||
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Comment 16•3 years ago
|
||
bugherder |
Assignee | ||
Comment 17•3 years ago
|
||
all done, closing
Description
•