From a37b5daa6bc7fbcbbc229b2549a161fa15023f41 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Tue, 27 Jun 2017 17:09:43 +0200 Subject: S390: Use cu21 instruction for converting from utf16 to utf8. This patch adds an ifunc variant to use the cu instruction on arch12 CPUs. This new ifunc variant can be built if binutils support z13 vector instructions. At runtime, HWCAP_S390_VXE decides if we can use the cu21 instruction. ChangeLog: * sysdeps/s390/utf8-utf16-z9.c (__to_utf8_loop_vx_cu): Use vector and cu21 instruction. * sysdeps/s390/multiarch/utf8-utf16-z9.c: Add __to_utf8_loop_vx_cu in ifunc resolver. --- sysdeps/s390/multiarch/utf8-utf16-z9.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sysdeps/s390/multiarch') diff --git a/sysdeps/s390/multiarch/utf8-utf16-z9.c b/sysdeps/s390/multiarch/utf8-utf16-z9.c index b55ef1aaec..1252281e4b 100644 --- a/sysdeps/s390/multiarch/utf8-utf16-z9.c +++ b/sysdeps/s390/multiarch/utf8-utf16-z9.c @@ -41,8 +41,10 @@ s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP, : FROM_LOOP_DEFAULT); s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP, - (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) - ? TO_LOOP_VX - : TO_LOOP_DEFAULT); + (HAVE_TO_VX_CU && (hwcap & HWCAP_S390_VXE)) + ? TO_LOOP_VX_CU + : (HAVE_TO_VX && (hwcap & HWCAP_S390_VX)) + ? TO_LOOP_VX + : TO_LOOP_DEFAULT); #include -- cgit v1.2.3-70-g09d2