|
|
fa3bfd |
From f69ff8906aeb1c4fd762bc9964f8a261963c30d5 Mon Sep 17 00:00:00 2001
|
|
|
fa3bfd |
From: Stefan Liebler <stli@linux.vnet.ibm.com>
|
|
|
fa3bfd |
Date: Thu, 27 Jul 2017 10:53:58 +0200
|
|
|
fa3bfd |
Subject: [PATCH 05/10] S390: Move utf8-utf32-z9.c to multiarch folder and use
|
|
|
fa3bfd |
s390_libc_ifunc_expr macro.
|
|
|
fa3bfd |
|
|
|
fa3bfd |
upstream-commit 5ea9ce3749007348a8d12e8eef9e0ccc6fd90aec
|
|
|
fa3bfd |
|
|
|
fa3bfd |
The utf8-utf32-z9.c iconv module is using ifunc and thus the ifunc part should
|
|
|
fa3bfd |
be in multiarch folder. Otherwise ifunc is used even if you configure
|
|
|
fa3bfd |
with --disable-multi-arch.
|
|
|
fa3bfd |
|
|
|
fa3bfd |
This patch moves the ifunc resolvers to the new file
|
|
|
fa3bfd |
sysdeps/s390/multiarch/utf8-utf32-z9.c. The resolvers are now implemented
|
|
|
fa3bfd |
with s390_libc_ifunc_expr macro instead of using gcc attribute ifunc directly.
|
|
|
fa3bfd |
|
|
|
fa3bfd |
The ifunc versions are implemented in sysdeps/s390/utf8-utf32-z9.c.
|
|
|
fa3bfd |
Each version is only implemented if needed or supported. Therefore there is
|
|
|
fa3bfd |
a block at beginning of the file which selects the versions which should be
|
|
|
fa3bfd |
defined depending on support for multiarch, vector-support and used minimum
|
|
|
fa3bfd |
architecture level. This block defines HAVE_[FROM|TO]_[C|CU|VX] to 1 or 0.
|
|
|
fa3bfd |
The code below is rearranged and surrounded
|
|
|
fa3bfd |
by #if HAVE_[FROM|TO]_[C|CU|VX] == 1. There is no functional change.
|
|
|
fa3bfd |
|
|
|
fa3bfd |
The cu instructions are z9 zarch instructions. As the major distros are
|
|
|
fa3bfd |
already using the newer z196 as architecture level set, those instructions
|
|
|
fa3bfd |
can be used as fallback version instead of the c-code. This behaviour is
|
|
|
fa3bfd |
decided at compile time via HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT.
|
|
|
fa3bfd |
|
|
|
fa3bfd |
ChangeLog:
|
|
|
fa3bfd |
|
|
|
fa3bfd |
* sysdeps/s390/multiarch/utf8-utf32-z9.c: New File.
|
|
|
fa3bfd |
* sysdeps/s390/utf8-utf32-z9.c: Move ifunc resolvers to multiarch
|
|
|
fa3bfd |
folder and define ifunc versions depending on HAVE_[FROM|TO]_[C|CU|VX].
|
|
|
fa3bfd |
(HAVE_FROM_C, HAVE_FROM_CU, HAVE_FROM_VX, HAVE_TO_C, HAVE_TO_VX,
|
|
|
fa3bfd |
FROM_LOOP_DEFAULT, FROM_LOOP_C, FROM_LOOP_CU, FROM_LOOP_VX,
|
|
|
fa3bfd |
TO_LOOP_DEFAULT, TO_LOOP_C, TO_LOOP_VX): New Define.
|
|
|
fa3bfd |
---
|
|
|
fa3bfd |
sysdeps/s390/multiarch/utf8-utf32-z9.c | 48 ++++++++
|
|
|
fa3bfd |
sysdeps/s390/utf8-utf32-z9.c | 215 +++++++++++++++++----------------
|
|
|
fa3bfd |
2 files changed, 160 insertions(+), 103 deletions(-)
|
|
|
fa3bfd |
create mode 100644 sysdeps/s390/multiarch/utf8-utf32-z9.c
|
|
|
fa3bfd |
|
|
|
fa3bfd |
diff --git a/sysdeps/s390/multiarch/utf8-utf32-z9.c b/sysdeps/s390/multiarch/utf8-utf32-z9.c
|
|
|
fa3bfd |
new file mode 100644
|
|
|
fa3bfd |
index 0000000..faf1f46
|
|
|
fa3bfd |
--- /dev/null
|
|
|
fa3bfd |
+++ b/sysdeps/s390/multiarch/utf8-utf32-z9.c
|
|
|
fa3bfd |
@@ -0,0 +1,48 @@
|
|
|
fa3bfd |
+/* Conversion between UTF-8 and UTF-32 - multiarch s390 version.
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+ Copyright (C) 2017 Free Software Foundation, Inc.
|
|
|
fa3bfd |
+ This file is part of the GNU C Library.
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
fa3bfd |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
fa3bfd |
+ License as published by the Free Software Foundation; either
|
|
|
fa3bfd |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
fa3bfd |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
fa3bfd |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
fa3bfd |
+ Lesser General Public License for more details.
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
fa3bfd |
+ License along with the GNU C Library; if not, see
|
|
|
fa3bfd |
+ <http://www.gnu.org/licenses/>. */
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#include <sysdeps/s390/utf8-utf32-z9.c>
|
|
|
fa3bfd |
+#include <ifunc-resolve.h>
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#undef FROM_LOOP
|
|
|
fa3bfd |
+#define FROM_LOOP __from_utf8_loop
|
|
|
fa3bfd |
+#undef TO_LOOP
|
|
|
fa3bfd |
+#define TO_LOOP __to_utf8_loop
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#define _SINGLE_NAME(NAME) NAME##_single
|
|
|
fa3bfd |
+#define SINGLE_NAME(NAME) _SINGLE_NAME(NAME)
|
|
|
fa3bfd |
+strong_alias (SINGLE_NAME (FROM_LOOP_DEFAULT), SINGLE_NAME (FROM_LOOP))
|
|
|
fa3bfd |
+strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP))
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+/* Generate ifunc'ed loop functions for FROM/TO_LOOP. */
|
|
|
fa3bfd |
+s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP,
|
|
|
fa3bfd |
+ (HAVE_FROM_VX && (hwcap & HWCAP_S390_VX))
|
|
|
fa3bfd |
+ ? FROM_LOOP_VX
|
|
|
fa3bfd |
+ : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ZARCH
|
|
|
fa3bfd |
+ && hwcap & HWCAP_S390_HIGH_GPRS
|
|
|
fa3bfd |
+ && hwcap & HWCAP_S390_ETF3EH))
|
|
|
fa3bfd |
+ ? FROM_LOOP_CU
|
|
|
fa3bfd |
+ : FROM_LOOP_DEFAULT);
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+s390_libc_ifunc_expr (TO_LOOP_DEFAULT, TO_LOOP,
|
|
|
fa3bfd |
+ (HAVE_TO_VX && (hwcap & HWCAP_S390_VX))
|
|
|
fa3bfd |
+ ? TO_LOOP_VX
|
|
|
fa3bfd |
+ : TO_LOOP_DEFAULT);
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#include <iconv/skeleton.c>
|
|
|
fa3bfd |
diff --git a/sysdeps/s390/utf8-utf32-z9.c b/sysdeps/s390/utf8-utf32-z9.c
|
|
|
fa3bfd |
index efae745..e06d11e 100644
|
|
|
fa3bfd |
--- a/sysdeps/s390/utf8-utf32-z9.c
|
|
|
fa3bfd |
+++ b/sysdeps/s390/utf8-utf32-z9.c
|
|
|
fa3bfd |
@@ -27,8 +27,35 @@
|
|
|
fa3bfd |
#include <dlfcn.h>
|
|
|
fa3bfd |
#include <stdint.h>
|
|
|
fa3bfd |
#include <unistd.h>
|
|
|
fa3bfd |
-#include <dl-procinfo.h>
|
|
|
fa3bfd |
#include <gconv.h>
|
|
|
fa3bfd |
+#include <string.h>
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+/* Select which versions should be defined depending on support
|
|
|
fa3bfd |
+ for multiarch, vector and used minimum architecture level. */
|
|
|
fa3bfd |
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
|
|
|
fa3bfd |
+# define HAVE_FROM_C 0
|
|
|
fa3bfd |
+# define FROM_LOOP_DEFAULT FROM_LOOP_CU
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define HAVE_FROM_C 1
|
|
|
fa3bfd |
+# define FROM_LOOP_DEFAULT FROM_LOOP_C
|
|
|
fa3bfd |
+#endif
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#define HAVE_TO_C 1
|
|
|
fa3bfd |
+#define TO_LOOP_DEFAULT TO_LOOP_C
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT || defined USE_MULTIARCH
|
|
|
fa3bfd |
+# define HAVE_FROM_CU 1
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define HAVE_FROM_CU 0
|
|
|
fa3bfd |
+#endif
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#if defined HAVE_S390_VX_ASM_SUPPORT && defined USE_MULTIARCH
|
|
|
fa3bfd |
+# define HAVE_FROM_VX 1
|
|
|
fa3bfd |
+# define HAVE_TO_VX 1
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define HAVE_FROM_VX 0
|
|
|
fa3bfd |
+# define HAVE_TO_VX 0
|
|
|
fa3bfd |
+#endif
|
|
|
fa3bfd |
|
|
|
fa3bfd |
#if defined HAVE_S390_VX_GCC_SUPPORT
|
|
|
fa3bfd |
# define ASM_CLOBBER_VR(NR) , NR
|
|
|
fa3bfd |
@@ -48,8 +75,8 @@
|
|
|
fa3bfd |
#define MIN_NEEDED_FROM 1
|
|
|
fa3bfd |
#define MAX_NEEDED_FROM 6
|
|
|
fa3bfd |
#define MIN_NEEDED_TO 4
|
|
|
fa3bfd |
-#define FROM_LOOP __from_utf8_loop
|
|
|
fa3bfd |
-#define TO_LOOP __to_utf8_loop
|
|
|
fa3bfd |
+#define FROM_LOOP FROM_LOOP_DEFAULT
|
|
|
fa3bfd |
+#define TO_LOOP TO_LOOP_DEFAULT
|
|
|
fa3bfd |
#define FROM_DIRECTION (dir == from_utf8)
|
|
|
fa3bfd |
#define ONE_DIRECTION 0
|
|
|
fa3bfd |
|
|
|
fa3bfd |
@@ -303,12 +330,9 @@ gconv_end (struct __gconv_step *data)
|
|
|
fa3bfd |
STANDARD_FROM_LOOP_ERR_HANDLER (i); \
|
|
|
fa3bfd |
}
|
|
|
fa3bfd |
|
|
|
fa3bfd |
-/* This hardware routine uses the Convert UTF8 to UTF32 (cu14) instruction. */
|
|
|
fa3bfd |
-#define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu14 %0, %1, 1"))
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
+#if HAVE_FROM_C == 1
|
|
|
fa3bfd |
/* The software routine is copied from gconv_simple.c. */
|
|
|
fa3bfd |
-#define BODY_FROM_C \
|
|
|
fa3bfd |
+# define BODY_FROM_C \
|
|
|
fa3bfd |
{ \
|
|
|
fa3bfd |
/* Next input byte. */ \
|
|
|
fa3bfd |
uint32_t ch = *inptr; \
|
|
|
fa3bfd |
@@ -408,7 +432,50 @@ gconv_end (struct __gconv_step *data)
|
|
|
fa3bfd |
outptr += sizeof (uint32_t); \
|
|
|
fa3bfd |
}
|
|
|
fa3bfd |
|
|
|
fa3bfd |
-#define HW_FROM_VX \
|
|
|
fa3bfd |
+/* These definitions apply to the UTF-8 to UTF-32 direction. The
|
|
|
fa3bfd |
+ software implementation for UTF-8 still supports multibyte
|
|
|
fa3bfd |
+ characters up to 6 bytes whereas the hardware variant does not. */
|
|
|
fa3bfd |
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
+# define FROM_LOOP_C __from_utf8_loop_c
|
|
|
fa3bfd |
+# define LOOPFCT FROM_LOOP_C
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+# define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+# define STORE_REST STORE_REST_COMMON
|
|
|
fa3bfd |
+# define UNPACK_BYTES UNPACK_BYTES_COMMON
|
|
|
fa3bfd |
+# define CLEAR_STATE CLEAR_STATE_COMMON
|
|
|
fa3bfd |
+# define BODY BODY_FROM_C
|
|
|
fa3bfd |
+# include <iconv/loop.c>
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define FROM_LOOP_C NULL
|
|
|
fa3bfd |
+#endif /* HAVE_FROM_C != 1 */
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#if HAVE_FROM_CU == 1
|
|
|
fa3bfd |
+/* This hardware routine uses the Convert UTF8 to UTF32 (cu14) instruction. */
|
|
|
fa3bfd |
+# define BODY_FROM_ETF3EH BODY_FROM_HW (HARDWARE_CONVERT ("cu14 %0, %1, 1"))
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+/* Generate loop-function with hardware utf-convert instruction. */
|
|
|
fa3bfd |
+# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
+# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
+# define FROM_LOOP_CU __from_utf8_loop_etf3eh
|
|
|
fa3bfd |
+# define LOOPFCT FROM_LOOP_CU
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+# define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+# define STORE_REST STORE_REST_COMMON
|
|
|
fa3bfd |
+# define UNPACK_BYTES UNPACK_BYTES_COMMON
|
|
|
fa3bfd |
+# define CLEAR_STATE CLEAR_STATE_COMMON
|
|
|
fa3bfd |
+# define BODY BODY_FROM_ETF3EH
|
|
|
fa3bfd |
+# include <iconv/loop.c>
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define FROM_LOOP_CU NULL
|
|
|
fa3bfd |
+#endif /* HAVE_FROM_CU != 1 */
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#if HAVE_FROM_VX == 1
|
|
|
fa3bfd |
+# define HW_FROM_VX \
|
|
|
fa3bfd |
{ \
|
|
|
fa3bfd |
register const unsigned char* pInput asm ("8") = inptr; \
|
|
|
fa3bfd |
register size_t inlen asm ("9") = inend - inptr; \
|
|
|
fa3bfd |
@@ -500,45 +567,14 @@ gconv_end (struct __gconv_step *data)
|
|
|
fa3bfd |
inptr = pInput; \
|
|
|
fa3bfd |
outptr = pOutput; \
|
|
|
fa3bfd |
}
|
|
|
fa3bfd |
-#define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX)
|
|
|
fa3bfd |
+# define BODY_FROM_VX BODY_FROM_HW (HW_FROM_VX)
|
|
|
fa3bfd |
|
|
|
fa3bfd |
-/* These definitions apply to the UTF-8 to UTF-32 direction. The
|
|
|
fa3bfd |
- software implementation for UTF-8 still supports multibyte
|
|
|
fa3bfd |
- characters up to 6 bytes whereas the hardware variant does not. */
|
|
|
fa3bfd |
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
-#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
-#define LOOPFCT __from_utf8_loop_c
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#define STORE_REST STORE_REST_COMMON
|
|
|
fa3bfd |
-#define UNPACK_BYTES UNPACK_BYTES_COMMON
|
|
|
fa3bfd |
-#define CLEAR_STATE CLEAR_STATE_COMMON
|
|
|
fa3bfd |
-#define BODY BODY_FROM_C
|
|
|
fa3bfd |
-#include <iconv/loop.c>
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-/* Generate loop-function with hardware utf-convert instruction. */
|
|
|
fa3bfd |
-#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
-#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
-#define LOOPFCT __from_utf8_loop_etf3eh
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#define STORE_REST STORE_REST_COMMON
|
|
|
fa3bfd |
-#define UNPACK_BYTES UNPACK_BYTES_COMMON
|
|
|
fa3bfd |
-#define CLEAR_STATE CLEAR_STATE_COMMON
|
|
|
fa3bfd |
-#define BODY BODY_FROM_ETF3EH
|
|
|
fa3bfd |
-#include <iconv/loop.c>
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#if defined HAVE_S390_VX_ASM_SUPPORT
|
|
|
fa3bfd |
-/* Generate loop-function with hardware vector instructions. */
|
|
|
fa3bfd |
+/* Generate loop-function with hardware vector and utf-convert instructions. */
|
|
|
fa3bfd |
# define MIN_NEEDED_INPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
# define MAX_NEEDED_INPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
# define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
-# define LOOPFCT __from_utf8_loop_vx
|
|
|
fa3bfd |
+# define FROM_LOOP_VX __from_utf8_loop_vx
|
|
|
fa3bfd |
+# define LOOPFCT FROM_LOOP_VX
|
|
|
fa3bfd |
|
|
|
fa3bfd |
# define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
|
|
|
fa3bfd |
@@ -547,33 +583,13 @@ gconv_end (struct __gconv_step *data)
|
|
|
fa3bfd |
# define CLEAR_STATE CLEAR_STATE_COMMON
|
|
|
fa3bfd |
# define BODY BODY_FROM_VX
|
|
|
fa3bfd |
# include <iconv/loop.c>
|
|
|
fa3bfd |
-#endif
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-/* Generate ifunc'ed loop function. */
|
|
|
fa3bfd |
-__typeof(__from_utf8_loop_c)
|
|
|
fa3bfd |
-__attribute__ ((ifunc ("__from_utf8_loop_resolver")))
|
|
|
fa3bfd |
-__from_utf8_loop;
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-static void *
|
|
|
fa3bfd |
-__from_utf8_loop_resolver (unsigned long int dl_hwcap)
|
|
|
fa3bfd |
-{
|
|
|
fa3bfd |
-#if defined HAVE_S390_VX_ASM_SUPPORT
|
|
|
fa3bfd |
- if (dl_hwcap & HWCAP_S390_VX)
|
|
|
fa3bfd |
- return __from_utf8_loop_vx;
|
|
|
fa3bfd |
- else
|
|
|
fa3bfd |
-#endif
|
|
|
fa3bfd |
- if (dl_hwcap & HWCAP_S390_ZARCH && dl_hwcap & HWCAP_S390_HIGH_GPRS
|
|
|
fa3bfd |
- && dl_hwcap & HWCAP_S390_ETF3EH)
|
|
|
fa3bfd |
- return __from_utf8_loop_etf3eh;
|
|
|
fa3bfd |
- else
|
|
|
fa3bfd |
- return __from_utf8_loop_c;
|
|
|
fa3bfd |
-}
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single)
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define FROM_LOOP_VX NULL
|
|
|
fa3bfd |
+#endif /* HAVE_FROM_VX != 1 */
|
|
|
fa3bfd |
|
|
|
fa3bfd |
+#if HAVE_TO_C == 1
|
|
|
fa3bfd |
/* The software routine mimics the S/390 cu41 instruction. */
|
|
|
fa3bfd |
-#define BODY_TO_C \
|
|
|
fa3bfd |
+# define BODY_TO_C \
|
|
|
fa3bfd |
{ \
|
|
|
fa3bfd |
uint32_t wc = *((const uint32_t *) inptr); \
|
|
|
fa3bfd |
\
|
|
|
fa3bfd |
@@ -657,8 +673,22 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single)
|
|
|
fa3bfd |
inptr += 4; \
|
|
|
fa3bfd |
}
|
|
|
fa3bfd |
|
|
|
fa3bfd |
+/* Generate loop-function with software routing. */
|
|
|
fa3bfd |
+# define MIN_NEEDED_INPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
+# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
+# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
+# define TO_LOOP_C __to_utf8_loop_c
|
|
|
fa3bfd |
+# define LOOPFCT TO_LOOP_C
|
|
|
fa3bfd |
+# define BODY BODY_TO_C
|
|
|
fa3bfd |
+# define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
+# include <iconv/loop.c>
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define TO_LOOP_C NULL
|
|
|
fa3bfd |
+#endif /* HAVE_TO_C != 1 */
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+#if HAVE_TO_VX == 1
|
|
|
fa3bfd |
/* The hardware routine uses the S/390 vector instructions. */
|
|
|
fa3bfd |
-#define BODY_TO_VX \
|
|
|
fa3bfd |
+# define BODY_TO_VX \
|
|
|
fa3bfd |
{ \
|
|
|
fa3bfd |
size_t inlen = inend - inptr; \
|
|
|
fa3bfd |
size_t outlen = outend - outptr; \
|
|
|
fa3bfd |
@@ -820,43 +850,22 @@ strong_alias (__from_utf8_loop_c_single, __from_utf8_loop_single)
|
|
|
fa3bfd |
STANDARD_TO_LOOP_ERR_HANDLER (4); \
|
|
|
fa3bfd |
}
|
|
|
fa3bfd |
|
|
|
fa3bfd |
-/* Generate loop-function with software routing. */
|
|
|
fa3bfd |
-#define MIN_NEEDED_INPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
-#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
-#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
-#define LOOPFCT __to_utf8_loop_c
|
|
|
fa3bfd |
-#define BODY BODY_TO_C
|
|
|
fa3bfd |
-#define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
-#include <iconv/loop.c>
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#if defined HAVE_S390_VX_ASM_SUPPORT
|
|
|
fa3bfd |
-/* Generate loop-function with hardware vector and utf-convert instructions. */
|
|
|
fa3bfd |
+/* Generate loop-function with hardware vector instructions. */
|
|
|
fa3bfd |
# define MIN_NEEDED_INPUT MIN_NEEDED_TO
|
|
|
fa3bfd |
# define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
|
|
|
fa3bfd |
# define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
|
|
|
fa3bfd |
-# define LOOPFCT __to_utf8_loop_vx
|
|
|
fa3bfd |
+# define TO_LOOP_VX __to_utf8_loop_vx
|
|
|
fa3bfd |
+# define LOOPFCT TO_LOOP_VX
|
|
|
fa3bfd |
# define BODY BODY_TO_VX
|
|
|
fa3bfd |
# define LOOP_NEED_FLAGS
|
|
|
fa3bfd |
# include <iconv/loop.c>
|
|
|
fa3bfd |
+#else
|
|
|
fa3bfd |
+# define TO_LOOP_VX NULL
|
|
|
fa3bfd |
+#endif /* HAVE_TO_VX != 1 */
|
|
|
fa3bfd |
+
|
|
|
fa3bfd |
+/* This file also exists in sysdeps/s390/multiarch/ which
|
|
|
fa3bfd |
+ generates ifunc resolvers for FROM/TO_LOOP functions
|
|
|
fa3bfd |
+ and includes iconv/skeleton.c afterwards. */
|
|
|
fa3bfd |
+#if ! defined USE_MULTIARCH
|
|
|
fa3bfd |
+# include <iconv/skeleton.c>
|
|
|
fa3bfd |
#endif
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-/* Generate ifunc'ed loop function. */
|
|
|
fa3bfd |
-__typeof(__to_utf8_loop_c)
|
|
|
fa3bfd |
-__attribute__ ((ifunc ("__to_utf8_loop_resolver")))
|
|
|
fa3bfd |
-__to_utf8_loop;
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-static void *
|
|
|
fa3bfd |
-__to_utf8_loop_resolver (unsigned long int dl_hwcap)
|
|
|
fa3bfd |
-{
|
|
|
fa3bfd |
-#if defined HAVE_S390_VX_ASM_SUPPORT
|
|
|
fa3bfd |
- if (dl_hwcap & HWCAP_S390_VX)
|
|
|
fa3bfd |
- return __to_utf8_loop_vx;
|
|
|
fa3bfd |
- else
|
|
|
fa3bfd |
-#endif
|
|
|
fa3bfd |
- return __to_utf8_loop_c;
|
|
|
fa3bfd |
-}
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-strong_alias (__to_utf8_loop_c_single, __to_utf8_loop_single)
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-
|
|
|
fa3bfd |
-#include <iconv/skeleton.c>
|
|
|
fa3bfd |
--
|
|
|
fa3bfd |
1.8.3.1
|
|
|
fa3bfd |
|