summary refs log tree commit diff
path: root/sysdeps/s390/multiarch/utf16-utf32-z9.c
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.vnet.ibm.com>2017-06-27 17:09:43 +0200
committerStefan Liebler <stli@linux.vnet.ibm.com>2017-06-27 17:09:43 +0200
commit593e4da186906525e2a0bdc4d87601bd0c2625eb (patch)
treec66ef4eb008f4a5ba94ea7605827f348fdf44ea8 /sysdeps/s390/multiarch/utf16-utf32-z9.c
parent23ea69a9d6e9ab28c66a232b767a800b04eaa938 (diff)
downloadglibc-593e4da186906525e2a0bdc4d87601bd0c2625eb.tar.gz
glibc-593e4da186906525e2a0bdc4d87601bd0c2625eb.tar.xz
glibc-593e4da186906525e2a0bdc4d87601bd0c2625eb.zip
S390: Use cu42 instruction for converting from utf32 to utf16.
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
cu42 instruction.

ChangeLog:

	* sysdeps/s390/utf16-utf32-z9.c (__to_utf16_loop_vx_cu):
	Use vector and cu42 instruction.
	* sysdeps/s390/multiarch/utf16-utf32-z9.c:
	Add __to_utf16_loop_vx_cu in ifunc resolver.
Diffstat (limited to 'sysdeps/s390/multiarch/utf16-utf32-z9.c')
-rw-r--r--sysdeps/s390/multiarch/utf16-utf32-z9.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sysdeps/s390/multiarch/utf16-utf32-z9.c b/sysdeps/s390/multiarch/utf16-utf32-z9.c
index 6e64169835..ded3cc2ad9 100644
--- a/sysdeps/s390/multiarch/utf16-utf32-z9.c
+++ b/sysdeps/s390/multiarch/utf16-utf32-z9.c
@@ -37,8 +37,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 <iconv/skeleton.c>