RFR: 8274242: Implement fast-path for ASCII-compatible CharsetEncoders on x86 [v5]

Claes Redestad redestad at openjdk.java.net
Tue Sep 28 11:49:29 UTC 2021


> This patch extends the `ISO_8859_1.implEncodeISOArray` intrinsic on x86 to work also for ASCII encoding, which makes for example the `UTF_8$Encoder` perform on par with (or outperform) similarly getting charset encoded bytes from a String. The former took a small performance hit in JDK 9, and the latter improved greatly in the same release.
> 
> Extending the `EncodeIsoArray` intrinsics on other platforms should be possible, but I'm unfamiliar with the macro assembler in general and unlike the x86 intrinsic they don't use a simple vectorized mask to implement the latin-1 check. For example aarch64 seem to filter out the low bytes and then check if there's any bits set in the high bytes. Clever, but very different to the 0xFF80 2-byte mask that an ASCII test wants.

Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:

  Add fail-safe predicate to all encode_iso_array to only match non-ASCII EncodeISOArrayNodes

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5621/files
  - new: https://git.openjdk.java.net/jdk/pull/5621/files/47633cba..b4a5d105

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5621&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5621&range=03-04

  Stats: 3 lines in 3 files changed: 3 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5621.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5621/head:pull/5621

PR: https://git.openjdk.java.net/jdk/pull/5621


More information about the core-libs-dev mailing list