Closed Bug 1490602 Opened 6 years ago Closed 5 years ago

Use encoding_rs::mem for conversions between UTF-16 and Latin1 in SpiderMonkey

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1578339

People

(Reporter: hsivonen, Unassigned)

References

Details

encoding_rs::mem contains SIMD-accelerated implemenations (among other things) for
 1) Asking if a buffer of potentially-invalid UTF-16 is entirely in the Latin1 range (i.e. every code unit is < 0x100).
 2) Converting from Latin1 to UTF-16 (i.e. zero-extending each byte to a 16-bit code unit)
 3) Converting from Latin1-range UTF-16 to Latin1. (i.e. if 16-bit code unit is < 0x100, the result is a sequence of bytes with the upper zero half of each 16-bit unit omitted; if there are code units that are not in the Latin1 range, the behavior is memory-safe but the output is bogus in an instruction set-dependent way)

Currently, these are SIMD-accelerated for x86+SSE2, x86_64, aarch64 and ARMv7/Thumbv7+NEON. The structure of the code should make it easy to extend to support POWER or MIPS MSA as Rust's support for these becomes ready.

To benefit from SIMD performance without duplicating work, it would make sense for SpiderMonkey to use the operations provided by encoding_rs::mem. (See the dependency chain of this bug for tasks that need to be taken care of first.)
Priority: -- → P3

Looks like I keep filing duplicates of bugs I've filed myself.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.