S390: Optimize utf16-utf32 module

System Internals / glibc - Stefan Liebler [linux.vnet.ibm.com] - 25 May 2016 10:18 UTC

This patch reworks the s390 specific module to convert between utf16 and utf32. Now ifunc is used to choose either the c or etf3eh (with convert utf instruction) variants at runtime. Furthermore a new vector variant for z13 is introduced which will be build and chosen if vector support is available at build / runtime.

In case of converting utf 32 to utf16, the vector variant optimizes input of 2byte utf16 characters. The convert utf instruction is used if an utf16 surrogate is found.

For the other direction utf16 to utf32, the cu24 instruction can't be re-enabled, because it does not report an error, if the input-stream consists of a single low surrogate utf16 char (e.g. 0xdc00). This applies to the newest z13, too. Thus there is only the c or the new vector variant, which can handle utf16 surrogate characters.

This patch also fixes some whitespace errors. Furthermore, the etf3eh variant is handling the "UTF-xx//IGNORE" case now. Before they ignored the ignore-case and always stopped at an error.

ChangeLog:

- sysdeps/s390/s390-64/utf16-utf32-z9.c: Use ifunc to select c, etf3eh or new vector loop-variant.

6896776 S390: Optimize utf16-utf32 module.
ChangeLog | 5 +
sysdeps/s390/s390-64/utf16-utf32-z9.c | 471 ++++++++++++++++++++++++++-------
2 files changed, 384 insertions(+), 92 deletions(-)

Upstream: sourceware.org


  • Share