or1k-*-linux-gnu
powerpc-*-linux-gnu Hardware or software floating point, BE only.
powerpc64*-*-linux-gnu Big-endian and little-endian.
- s390-*-linux-gnu
s390x-*-linux-gnu
riscv32-*-linux-gnu
riscv64-*-linux-gnu
#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */
#define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description. */
-#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
+#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves. This was
+ used in now removed s390-32 arch. */
#define NT_S390_TIMER 0x301 /* s390 timer register */
#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
/* Valid values for the e_flags field. */
-#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */
+#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed.
+ This was used in now removed s390-32
+ arch. */
/* Additional s390 relocs */
/* Guess whether integer division by zero raises signal SIGFPE.
Set to 1 only if you know for sure. In case of doubt, set to 0. */
# if defined __alpha__ || defined __arm__ || defined __i386__ \
- || defined __m68k__ || defined __s390__
+ || defined __m68k__ || defined __s390x__
# define INTDIV0_RAISES_SIGFPE 1
# else
# define INTDIV0_RAISES_SIGFPE 0
all platforms.
It is also provided for @code{_Float128} and @code{_Float64x} on
powerpc64le (PowerPC 64-bits little-endian), x86_64, x86,
-aarch64, alpha, loongarch, mips64, riscv, s390 and sparc.
+aarch64, alpha, loongarch, mips64, riscv, s390x and sparc.
@menu
* Mathematical Constants:: Precise numeric values for often-used
if (path == NULL)
{
printf ("Repeated allocation (%zu bytes): %m\n", path_len);
- /* On 31-bit s390 the malloc will always fail as we do not have
- so much memory, and we want to mark the test unsupported.
- Likewise on systems with little physical memory the test will
+ /* On systems with little physical memory the test will
fail and should be unsupported. */
return EXIT_UNSUPPORTED;
}
}
compat_symbol (libc, __old_strpbrk_c3, __strpbrk_c3, GLIBC_2_1_1);
-# if defined __mc68020__ || defined __s390__ || defined __i386__
+# if defined __mc68020__ || defined __s390x__ || defined __i386__
# define _STRING_INLINE_unaligned 1
# else
# define _STRING_INLINE_unaligned 0
static void __attribute__ ((constructor))
init (void)
{
- /* These compat symbols exists on alpha, i386, m67k , powerpc, s390,
- sparc. at the same GLIBC_2.1 version. */
+ /* These compat symbols exists on alpha, i386, m67k , powerpc, sparc
+ at the same GLIBC_2.1 version. */
readdir64_compat = dlvsym (RTLD_DEFAULT, "readdir64", "GLIBC_2.1");
readdir64_r_compat = dlvsym (RTLD_DEFAULT, "readdir64_r", "GLIBC_2.1");
}
typedef char La_s390_vr[16];
#endif
-#if __ELF_NATIVE_CLASS == 32
-
-/* Registers for entry into PLT on s390-32. */
-typedef struct La_s390_32_regs
-{
- uint32_t lr_r2;
- uint32_t lr_r3;
- uint32_t lr_r4;
- uint32_t lr_r5;
- uint32_t lr_r6;
- double lr_fp0;
- double lr_fp2;
-# if defined HAVE_S390_VX_ASM_SUPPORT
- La_s390_vr lr_v24;
- La_s390_vr lr_v25;
- La_s390_vr lr_v26;
- La_s390_vr lr_v27;
- La_s390_vr lr_v28;
- La_s390_vr lr_v29;
- La_s390_vr lr_v30;
- La_s390_vr lr_v31;
-# endif
-} La_s390_32_regs;
-
-/* Return values for calls from PLT on s390-32. */
-typedef struct La_s390_32_retval
-{
- uint32_t lrv_r2;
- uint32_t lrv_r3;
- double lrv_fp0;
-# if defined HAVE_S390_VX_ASM_SUPPORT
- La_s390_vr lrv_v24;
-# endif
-} La_s390_32_retval;
-
-
-__BEGIN_DECLS
-
-extern Elf32_Addr la_s390_32_gnu_pltenter (Elf32_Sym *__sym,
- unsigned int __ndx,
- uintptr_t *__refcook,
- uintptr_t *__defcook,
- La_s390_32_regs *__regs,
- unsigned int *__flags,
- const char *__symname,
- long int *__framesizep);
-extern unsigned int la_s390_32_gnu_pltexit (Elf32_Sym *__sym,
- unsigned int __ndx,
- uintptr_t *__refcook,
- uintptr_t *__defcook,
- const La_s390_32_regs *__inregs,
- La_s390_32_retval *__outregs,
- const char *symname);
-
-__END_DECLS
-
-#else
-
/* Registers for entry into PLT on s390-64. */
typedef struct La_s390_64_regs
{
const char *__symname);
__END_DECLS
-
-#endif
/* We save registers 6-15. */
long int __gregs[10];
-# if __WORDSIZE == 64
- /* We save fpu registers f8 - f15. */
long __fpregs[8];
-# else
- /* We save fpu registers 4 and 6. */
- long __fpregs[4];
-# endif
} __jmp_buf[1];
#endif
void testvecinsn ()
{
__asm__ (".machine \"z13\" \n\t"
- ".machinemode \"zarch_nohighgprs\" \n\t"
"vistrbs %%v16,%%v17 \n\t"
"locghie %%r1,0" : :);
}
void testinsn (char *buf)
{
__asm__ (".machine \"arch13\" \n\t"
- ".machinemode \"zarch_nohighgprs\" \n\t"
"lghi %%r0,16 \n\t"
"mvcrl 0(%0),32(%0) \n\t"
"vstrs %%v20,%%v20,%%v20,%%v20,0,2"
void testvecinsn ()
{
__asm__ (".machine \"z13\" \n\t"
- ".machinemode \"zarch_nohighgprs\" \n\t"
"vistrbs %%v16,%%v17 \n\t"
"locghie %%r1,0" : :);
}
void testinsn (char *buf)
{
__asm__ (".machine \"arch13\" \n\t"
- ".machinemode \"zarch_nohighgprs\" \n\t"
"lghi %%r0,16 \n\t"
"mvcrl 0(%0),32(%0) \n\t"
"vstrs %%v20,%%v20,%%v20,%%v20,0,2"
cpu_features->hwcap = GLRO(dl_hwcap);
/* We want just 1 double word to be returned. */
- if (__glibc_likely ((cpu_features->hwcap & HWCAP_S390_STFLE)
- && (cpu_features->hwcap & HWCAP_S390_ZARCH)
- && (cpu_features->hwcap & HWCAP_S390_HIGH_GPRS)))
+ if (__glibc_likely ((cpu_features->hwcap & HWCAP_S390_STFLE)))
{
unsigned long long stfle_bits[4] = { 0 };
register unsigned long reg0 __asm__("0") = 3;
__asm__ __volatile__(".machine push" "\n\t"
".machine \"z9-109\"" "\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
"stfle %0" "\n\t"
".machine pop" "\n"
: "=QS" (stfle_bits[0]),
2) __tls_get_offset returns the offset of the requested variable to
the thread descriptor instead of a pointer to the variable.
*/
-# ifdef __s390x__
__asm__("\n\
.text\n\
.globl __tls_get_offset\n\
la %r2,0(%r2,%r12)\n\
jg __tls_get_addr\n\
");
-# elif defined __s390__
-__asm__("\n\
- .text\n\
- .globl __tls_get_offset\n\
- .type __tls_get_offset, @function\n\
- .align 4\n\
-__tls_get_offset:\n\
- basr %r3,0\n\
-0: la %r2,0(%r2,%r12)\n\
- l %r4,1f-0b(%r3)\n\
- b 0(%r4,%r3)\n\
-1: .long __tls_get_addr - 0b\n\
-");
-# endif
# else /* IS_IN (rtld) */
extern void *__tls_get_addr_internal (tls_index *ti);
# endif /* !IS_IN (rtld) */
-/* Private floating point rounding and exceptions handling. 390/s390x version.
+/* Private floating point rounding and exceptions handling. s390x version.
Copyright (C) 2019-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
-/* We only support s390x as on s390 a long long int refers to a register pair
- of two 4byte registers instead of a 8byte register which is produced by the
- instruction.
- Note: On s390 this instruction would only be used if build with -mzarch. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# include <math.h>
# include <libm-alias-double.h>
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
-/* We only support s390x as on s390 a long long int refers to a register pair
- of two 4byte registers instead of a 8byte register which is produced by the
- instruction.
- Note: On s390 this instruction would only be used if build with -mzarch. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# include <math.h>
# include <libm-alias-float.h>
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
-/* We only support s390x as on s390 a long long int refers to a register pair
- of two 4byte registers instead of a 8byte register which is produced by the
- instruction.
- Note: On s390 this instruction would only be used if build with -mzarch. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# include <math.h>
# include <math_private.h>
# include <libm-alias-ldouble.h>
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
-/* We only support s390x as on s390 a long long int refers to a register pair
- of two 4byte registers instead of a 8byte register which is produced by the
- instruction.
- Note: On s390 this instruction would only be used if build with -mzarch. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# include <math.h>
# include <libm-alias-double.h>
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
-/* We only support s390x as on s390 a long long int refers to a register pair
- of two 4byte registers instead of a 8byte register which is produced by the
- instruction.
- Note: On s390 this instruction would only be used if build with -mzarch. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# include <math.h>
# include <libm-alias-float.h>
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#if defined __s390x__ && defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
-/* We only support s390x as on s390 a long long int refers to a register pair
- of two 4byte registers instead of a 8byte register which is produced by the
- instruction.
- Note: On s390 this instruction would only be used if build with -mzarch. */
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# include <math.h>
# include <math_private.h>
# include <libm-alias-ldouble.h>
# include <math.h>
# include <libm-alias-double.h>
-/* The sizeof (long int) differs between s390x (8byte) and s390 (4byte).
- Thus we need different instructions as the target size is encoded there.
- Note: On s390 this instruction is only used if build with -mzarch. */
-# ifdef __s390x__
-# define INSN "cgdbra"
-# else
-# define INSN "cfdbra"
-# endif
-
long int
__lrint (double x)
{
Note: a nan is also indicated by cc=3).
If the resulting value is within the target limits, redo
without suppressing the inexact exception. */
- __asm__ (INSN " %0,0,%1,4 \n\t"
+ __asm__ ("cgdbra %0,0,%1,4 \n\t"
"jo 1f \n\t"
- INSN " %0,0,%1,0 \n\t"
+ "cgdbra %0,0,%1,0 \n\t"
"1:"
: "=&d" (y) : "f" (x) : "cc");
return y;
# include <math.h>
# include <libm-alias-float.h>
-/* The sizeof (long int) differs between s390x (8byte) and s390 (4byte).
- Thus we need different instructions as the target size is encoded there.
- Note: On s390 this instruction is only used if build with -mzarch. */
-# ifdef __s390x__
-# define INSN "cgebra"
-# else
-# define INSN "cfebra"
-# endif
-
long int
__lrintf (float x)
{
Note: a nan is also indicated by cc=3).
If the resulting value is within the target limits, redo
without suppressing the inexact exception. */
- __asm__ (INSN " %0,0,%1,4 \n\t"
+ __asm__ ("cgebra %0,0,%1,4 \n\t"
"jo 1f \n\t"
- INSN " %0,0,%1,0 \n\t"
+ "cgebra %0,0,%1,0 \n\t"
"1:"
: "=&d" (y) : "f" (x) : "cc");
return y;
# include <math_private.h>
# include <libm-alias-ldouble.h>
-/* The sizeof (long int) differs between s390x (8byte) and s390 (4byte).
- Thus we need different instructions as the target size is encoded there.
- Note: On s390 this instruction is only used if build with -mzarch. */
-# ifdef __s390x__
-# define INSN "cgxbra"
-# else
-# define INSN "cfxbra"
-# endif
-
long int
__lrintl (_Float128 x)
{
Note: a nan is also indicated by cc=3).
If the resulting value is within the target limits, redo
without suppressing the inexact exception. */
- __asm__ (INSN " %0,0,%1,4 \n\t"
+ __asm__ ("cgxbra %0,0,%1,4 \n\t"
"jo 1f \n\t"
- INSN " %0,0,%1,0 \n\t"
+ "cgxbra %0,0,%1,0 \n\t"
"1:"
: "=&d" (y) : "f" (x) : "cc");
return y;
# include <math.h>
# include <libm-alias-double.h>
-/* The sizeof (long int) differs between s390x (8byte) and s390 (4byte).
- Thus we need different instructions as the target size is encoded there.
- Note: On s390 this instruction is only used if build with -mzarch. */
-# ifdef __s390x__
-# define INSN "cgdbra"
-# else
-# define INSN "cfdbra"
-# endif
-
long int
__lround (double x)
{
/* The z196 zarch "convert to fixed" (cgdbra) instruction is rounding
x to the nearest integer with "ties away from 0" rounding mode
(M3-field: 1) where inexact exceptions are suppressed (M4-field: 4). */
- __asm__ (INSN " %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
+ __asm__ ("cgdbra %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
return y;
}
libm_alias_double (__lround, lround)
# include <math.h>
# include <libm-alias-float.h>
-/* The sizeof (long int) differs between s390x (8byte) and s390 (4byte).
- Thus we need different instructions as the target size is encoded there.
- Note: On s390 this instruction is only used if build with -mzarch. */
-# ifdef __s390x__
-# define INSN "cgebra"
-# else
-# define INSN "cfebra"
-# endif
-
long int
__lroundf (float x)
{
/* The z196 zarch "convert to fixed" (cgebra) instruction is rounding
x to the nearest integer with "ties away from 0" rounding mode
(M3-field: 1) where inexact exceptions are suppressed (M4-field: 4). */
- __asm__ (INSN " %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
+ __asm__ ("cgebra %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
return y;
}
libm_alias_float (__lround, lround)
# include <math_private.h>
# include <libm-alias-ldouble.h>
-/* The sizeof (long int) differs between s390x (8byte) and s390 (4byte).
- Thus we need different instructions as the target size is encoded there.
- Note: On s390 this instruction is only used if build with -mzarch. */
-# ifdef __s390x__
-# define INSN "cgxbra"
-# else
-# define INSN "cfxbra"
-# endif
-
long int
__lroundl (_Float128 x)
{
/* The z196 zarch "convert to fixed" (cgxbra) instruction is rounding
x to the nearest integer with "ties away from 0" rounding mode
(M3-field: 1) where inexact exceptions are suppressed (M4-field: 4). */
- __asm__ (INSN " %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
+ __asm__ ("cgxbra %0,1,%1,4" : "=d" (y) : "f" (x) : "cc");
return y;
}
libm_alias_ldouble (__lround, lround)
#if defined HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT
# define MEMCHR_DEFAULT MEMCHR_Z13
-# define HAVE_MEMCHR_Z900_G5 0
+# define HAVE_MEMCHR_Z900 0
# define HAVE_MEMCHR_Z13 1
#else
-# define MEMCHR_DEFAULT MEMCHR_Z900_G5
-# define HAVE_MEMCHR_Z900_G5 1
+# define MEMCHR_DEFAULT MEMCHR_Z900
+# define HAVE_MEMCHR_Z900 1
# define HAVE_MEMCHR_Z13 HAVE_MEMCHR_IFUNC_AND_VX_SUPPORT
#endif
-#if HAVE_MEMCHR_Z900_G5
-# define MEMCHR_Z900_G5 __memchr_default
+#if HAVE_MEMCHR_Z900
+# define MEMCHR_Z900 __memchr_default
#else
-# define MEMCHR_Z900_G5 NULL
+# define MEMCHR_Z900 NULL
#endif
#if HAVE_MEMCHR_Z13
#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# define MEMCMP_DEFAULT MEMCMP_Z196
-# define HAVE_MEMCMP_Z900_G5 0
+# define HAVE_MEMCMP_Z900 0
# define HAVE_MEMCMP_Z10 0
# define HAVE_MEMCMP_Z196 1
#elif defined HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT
# define MEMCMP_DEFAULT MEMCMP_Z10
-# define HAVE_MEMCMP_Z900_G5 0
+# define HAVE_MEMCMP_Z900 0
# define HAVE_MEMCMP_Z10 1
# define HAVE_MEMCMP_Z196 HAVE_MEMCMP_IFUNC
#else
-# define MEMCMP_DEFAULT MEMCMP_Z900_G5
-# define HAVE_MEMCMP_Z900_G5 1
+# define MEMCMP_DEFAULT MEMCMP_Z900
+# define HAVE_MEMCMP_Z900 1
# define HAVE_MEMCMP_Z10 HAVE_MEMCMP_IFUNC
# define HAVE_MEMCMP_Z196 HAVE_MEMCMP_IFUNC
#endif
-#if HAVE_MEMCMP_Z900_G5
-# define MEMCMP_Z900_G5 __memcmp_default
+#if HAVE_MEMCMP_Z900
+# define MEMCMP_Z900 __memcmp_default
#else
-# define MEMCMP_Z900_G5 NULL
+# define MEMCMP_Z900 NULL
#endif
#if HAVE_MEMCMP_Z10
#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# define MEMCPY_DEFAULT MEMCPY_Z196
# define MEMPCPY_DEFAULT MEMPCPY_Z196
-# define HAVE_MEMCPY_Z900_G5 0
+# define HAVE_MEMCPY_Z900 0
# define HAVE_MEMCPY_Z10 0
# define HAVE_MEMCPY_Z196 1
#elif defined HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT
# define MEMCPY_DEFAULT MEMCPY_Z10
# define MEMPCPY_DEFAULT MEMPCPY_Z10
-# define HAVE_MEMCPY_Z900_G5 0
+# define HAVE_MEMCPY_Z900 0
# define HAVE_MEMCPY_Z10 1
# define HAVE_MEMCPY_Z196 HAVE_MEMCPY_IFUNC
#else
-# define MEMCPY_DEFAULT MEMCPY_Z900_G5
-# define MEMPCPY_DEFAULT MEMPCPY_Z900_G5
-# define HAVE_MEMCPY_Z900_G5 1
+# define MEMCPY_DEFAULT MEMCPY_Z900
+# define MEMPCPY_DEFAULT MEMPCPY_Z900
+# define HAVE_MEMCPY_Z900 1
# define HAVE_MEMCPY_Z10 HAVE_MEMCPY_IFUNC
# define HAVE_MEMCPY_Z196 HAVE_MEMCPY_IFUNC
#endif
# define HAVE_MEMMOVE_ARCH13 HAVE_MEMMOVE_IFUNC_AND_ARCH13_SUPPORT
#endif
-#if HAVE_MEMCPY_Z900_G5
-# define MEMCPY_Z900_G5 __memcpy_default
-# define MEMPCPY_Z900_G5 __mempcpy_default
+#if HAVE_MEMCPY_Z900
+# define MEMCPY_Z900 __memcpy_default
+# define MEMPCPY_Z900 __mempcpy_default
#else
-# define MEMCPY_Z900_G5 NULL
-# define MEMPCPY_Z900_G5 NULL
+# define MEMCPY_Z900 NULL
+# define MEMPCPY_Z900 NULL
#endif
#if HAVE_MEMCPY_Z10
#if defined HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
# define MEMSET_DEFAULT MEMSET_Z196
-# define HAVE_MEMSET_Z900_G5 0
+# define HAVE_MEMSET_Z900 0
# define HAVE_MEMSET_Z10 0
# define HAVE_MEMSET_Z196 1
#elif defined HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT
# define MEMSET_DEFAULT MEMSET_Z10
-# define HAVE_MEMSET_Z900_G5 0
+# define HAVE_MEMSET_Z900 0
# define HAVE_MEMSET_Z10 1
# define HAVE_MEMSET_Z196 HAVE_MEMSET_IFUNC
#else
-# define MEMSET_DEFAULT MEMSET_Z900_G5
-# define HAVE_MEMSET_Z900_G5 1
+# define MEMSET_DEFAULT MEMSET_Z900
+# define HAVE_MEMSET_Z900 1
# define HAVE_MEMSET_Z10 HAVE_MEMSET_IFUNC
# define HAVE_MEMSET_Z196 HAVE_MEMSET_IFUNC
#endif
# define HAVE_MEMSET_MVCLE 0
#endif
-#if HAVE_MEMSET_Z900_G5
-# define MEMSET_Z900_G5 __memset_default
+#if HAVE_MEMSET_Z900
+# define MEMSET_Z900 __memset_default
#else
-# define MEMSET_Z900_G5 NULL
+# define MEMSET_Z900 NULL
#endif
#if HAVE_MEMSET_Z10
#if defined HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT
# define STRCMP_DEFAULT STRCMP_Z13
-# define HAVE_STRCMP_Z900_G5 0
+# define HAVE_STRCMP_Z900 0
# define HAVE_STRCMP_Z13 1
#else
-# define STRCMP_DEFAULT STRCMP_Z900_G5
-# define HAVE_STRCMP_Z900_G5 1
+# define STRCMP_DEFAULT STRCMP_Z900
+# define HAVE_STRCMP_Z900 1
# define HAVE_STRCMP_Z13 HAVE_STRCMP_IFUNC_AND_VX_SUPPORT
#endif
-#if HAVE_STRCMP_Z900_G5
-# define STRCMP_Z900_G5 __strcmp_default
+#if HAVE_STRCMP_Z900
+# define STRCMP_Z900 __strcmp_default
#else
-# define STRCMP_Z900_G5 NULL
+# define STRCMP_Z900 NULL
#endif
#if HAVE_STRCMP_Z13
#if defined HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT
# define STRCPY_DEFAULT STRCPY_Z13
-# define HAVE_STRCPY_Z900_G5 0
+# define HAVE_STRCPY_Z900 0
# define HAVE_STRCPY_Z13 1
#else
-# define STRCPY_DEFAULT STRCPY_Z900_G5
-# define HAVE_STRCPY_Z900_G5 1
+# define STRCPY_DEFAULT STRCPY_Z900
+# define HAVE_STRCPY_Z900 1
# define HAVE_STRCPY_Z13 HAVE_STRCPY_IFUNC_AND_VX_SUPPORT
#endif
-#if HAVE_STRCPY_Z900_G5
-# define STRCPY_Z900_G5 __strcpy_default
+#if HAVE_STRCPY_Z900
+# define STRCPY_Z900 __strcpy_default
#else
-# define STRCPY_Z900_G5 NULL
+# define STRCPY_Z900 NULL
#endif
#if HAVE_STRCPY_Z13
#if defined HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT
# define STRNCPY_DEFAULT STRNCPY_Z13
-# define HAVE_STRNCPY_Z900_G5 0
+# define HAVE_STRNCPY_Z900 0
# define HAVE_STRNCPY_Z13 1
#else
-# define STRNCPY_DEFAULT STRNCPY_Z900_G5
-# define HAVE_STRNCPY_Z900_G5 1
+# define STRNCPY_DEFAULT STRNCPY_Z900
+# define HAVE_STRNCPY_Z900 1
# define HAVE_STRNCPY_Z13 HAVE_STRNCPY_IFUNC_AND_VX_SUPPORT
#endif
-#if HAVE_STRNCPY_Z900_G5
-# define STRNCPY_Z900_G5 __strncpy_default
+#if HAVE_STRNCPY_Z900
+# define STRNCPY_Z900 __strncpy_default
#else
-# define STRNCPY_Z900_G5 NULL
+# define STRNCPY_Z900 NULL
#endif
#if HAVE_STRNCPY_Z13
#define MIN_NEEDED_FROM 1
#define MIN_NEEDED_TO 1
-# if defined __s390x__
-# define BRANCH_ON_COUNT(REG,LBL) "brctg %" #REG "," #LBL "\n\t"
-# else
-# define BRANCH_ON_COUNT(REG,LBL) "brct %" #REG "," #LBL "\n\t"
-# endif
-
#define TR_LOOP(TABLE) \
{ \
size_t length = (inend - inptr < outend - outptr \
" tr 0(256,%[R_OUT]),0(%[R_TBL])\n\t" \
" la %[R_IN],256(%[R_IN])\n\t" \
" la %[R_OUT],256(%[R_OUT])\n\t" \
- BRANCH_ON_COUNT ([R_LI], 0b) \
+ " brctg %[R_LI],0b\n\t" \
: /* outputs */ [R_IN] "+a" (inptr) \
, [R_OUT] "+a" (outptr), [R_LI] "+d" (blocks) \
: /* inputs */ [R_TBL] "a" (TABLE) \
((void *) (address) < (void *) demangle ((jmpbuf)->__gregs[__JB_GPR15]))
-/* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual
- %r15. */
+/* On s390x, CFA is always 160 bytes above actual %r15. */
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, \
(void *) (_Unwind_GetCFA (_context) \
#include <elf.h>
#include <cpu-features.h>
-struct La_s390_32_regs;
-struct La_s390_32_retval;
struct La_s390_64_regs;
struct La_s390_64_retval;
#define ARCH_PLTENTER_MEMBERS \
- Elf32_Addr (*s390_32_gnu_pltenter) (Elf32_Sym *, unsigned int, \
- uintptr_t *, \
- uintptr_t *, \
- struct La_s390_32_regs *, \
- unsigned int *, const char *name, \
- long int *framesizep); \
Elf64_Addr (*s390_64_gnu_pltenter) (Elf64_Sym *, unsigned int, \
uintptr_t *, \
uintptr_t *, \
long int *framesizep)
#define ARCH_PLTEXIT_MEMBERS \
- unsigned int (*s390_32_gnu_pltexit) (Elf32_Sym *, unsigned int, \
- uintptr_t *, uintptr_t *, \
- const struct La_s390_32_regs *, \
- struct La_s390_32_retval *, \
- const char *); \
unsigned int (*s390_64_gnu_pltexit) (Elf64_Sym *, unsigned int, \
uintptr_t *, uintptr_t *, \
const struct La_s390_64_regs *, \
-#if __WORDSIZE == 64
struct link_map_machine
- {
- Elf64_Addr plt; /* Address of .plt + 0x2e */
- const Elf64_Rela *jmprel; /* Address of first JMP_SLOT reloc */
- };
-#else
-struct link_map_machine
- {
- Elf32_Addr plt; /* Address of .plt + 0x2c */
- const Elf32_Rela *jmprel; /* Address of first JMP_SLOT reloc */
- };
-#endif
+{
+ Elf64_Addr plt; /* Address of .plt + 0x2e */
+ const Elf64_Rela *jmprel; /* Address of first JMP_SLOT reloc */
+};
-/* Vector optimized 32/64 bit S/390 version of memccpy.
+/* Vector optimized 64 bit S/390 version of memccpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(MEMCCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r5,%r5
-# endif /* !defined __s390x__ */
vlvgp %v31,%r6,%r7 /* Save registers. */
clgije %r5,0,.Lnf_end /* If len == 0 then exit. */
-/* Vector optimized 32/64 bit S/390 version of memchr.
+/* Vector optimized 64 bit S/390 version of memchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
-v18=c replicated
*/
ENTRY(MEMCHR_Z13)
-
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgije %r4,0,.Lnf_end /* If len == 0 then exit. */
weak_alias (__memchr, memchr)
# endif
-# if ! HAVE_MEMCHR_Z900_G5 && defined SHARED && IS_IN (libc)
+# if ! HAVE_MEMCHR_Z900 && defined SHARED && IS_IN (libc)
strong_alias (MEMCHR_Z13, __GI_memchr)
# endif
#endif
-/* Search a character in a block of memory. 31/64 bit S/390 version.
+/* Search a character in a block of memory. 64 bit S/390 version.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
#include "sysdep.h"
#include "asm-syntax.h"
-#if HAVE_MEMCHR_Z900_G5
-# if defined __s390x__
-# define SLGR slgr
-# define LGHI lghi
-# define NGR ngr
-# define LGR lgr
-# else
-# define SLGR slr
-# define LGHI lhi
-# define NGR nr
-# define LGR lr
-# endif /* ! defined __s390x__ */
-
+#if HAVE_MEMCHR_Z900
.text
-ENTRY(MEMCHR_Z900_G5)
- LGHI %r0,0xff
- NGR %r0,%r3
- LGR %r1,%r2
-# if ! defined __s390x__
- tmlh %r4,32768
- jo 3f /* Jump away if n >= 0x80000000 */
-# endif
+ENTRY(MEMCHR_Z900)
+ lghi %r0,0xff
+ ngr %r0,%r3
+ lgr %r1,%r2
la %r2,0(%r4,%r1)
0: srst %r2,%r1
jo 0b
brc 13,1f
- SLGR %r2,%r2
+ slgr %r2,%r2
1: br %r14
-# if ! defined __s390x__
- /* On s390 (31bit), the pointer to the first byte after s (stored in
- r2) always wraps around with n >= 0x80000000 and can lead to stop
- searching before end of s. Thus just use r2=0 in this case.
- If r2 < r1, the srst instruction stops searching with cc=2 "not
- found" when wrapping around from top address to zero. */
-3: SLGR %r2,%r2
- j 0b
-# endif
-END(MEMCHR_Z900_G5)
+END(MEMCHR_Z900)
# if ! HAVE_MEMCHR_IFUNC
-strong_alias (MEMCHR_Z900_G5, __memchr)
+strong_alias (MEMCHR_Z900, __memchr)
weak_alias (__memchr, memchr)
# endif
# if defined SHARED && IS_IN (libc)
-strong_alias (MEMCHR_Z900_G5, __GI_memchr)
+strong_alias (MEMCHR_Z900, __GI_memchr)
# endif
#endif
# undef memchr
# include <ifunc-resolve.h>
-# if HAVE_MEMCHR_Z900_G5
-extern __typeof (__redirect_memchr) MEMCHR_Z900_G5 attribute_hidden;
+# if HAVE_MEMCHR_Z900
+extern __typeof (__redirect_memchr) MEMCHR_Z900 attribute_hidden;
# endif
# if HAVE_MEMCHR_Z13
-/* memcmp - compare two memory blocks. 31/64 bit S/390 version.
+/* memcmp - compare two memory blocks. 64 bit S/390 version.
Copyright (C) 2012-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
.text
-#if HAVE_MEMCMP_Z900_G5
-# if defined __s390x__
-# define LTGR ltgr
-# define AGHI aghi
-# define BRCTG brctg
-# else
-# define LTGR ltr
-# define AGHI ahi
-# define BRCTG brct
-# endif /* ! defined __s390x__ */
-ENTRY(MEMCMP_Z900_G5)
-# if defined __s390x__
+#if HAVE_MEMCMP_Z900
+ENTRY(MEMCMP_Z900)
.machine "z900"
-# else
- .machine "g5"
- basr %r5,0
-.L_Z900_G5_16:
-# define Z900_G5_EX_D .L_Z900_G5_15-.L_Z900_G5_16
-# endif /* ! defined __s390x__ */
- LTGR %r4,%r4
- je .L_Z900_G5_4
- AGHI %r4,-1
-# if defined __s390x__
+ ltgr %r4,%r4
+ je .L_Z900_4
+ aghi %r4,-1
srlg %r1,%r4,8
- larl %r5,.L_Z900_G5_15
-# define Z900_G5_EX_D 0
-# else
- lr %r1,%r4
- srl %r1,8
-# endif /* ! defined __s390x__ */
- LTGR %r1,%r1
- jne .L_Z900_G5_12
-.L_Z900_G5_3:
- ex %r4,Z900_G5_EX_D(%r5)
-.L_Z900_G5_4:
+ larl %r5,.L_Z900_15
+ ltgr %r1,%r1
+ jne .L_Z900_12
+.L_Z900_3:
+ ex %r4,0(%r5)
+.L_Z900_4:
ipm %r2
-# if defined __s390x__
sllg %r2,%r2,34
srag %r2,%r2,62
-# else
- sll %r2,2
- sra %r2,30
-# endif /* ! defined __s390x__ */
br %r14
-.L_Z900_G5_12:
+.L_Z900_12:
clc 0(256,%r3),0(%r2)
- jne .L_Z900_G5_4
+ jne .L_Z900_4
la %r3,256(%r3)
la %r2,256(%r2)
- BRCTG %r1,.L_Z900_G5_12
- j .L_Z900_G5_3
-.L_Z900_G5_15:
+ brctg %r1,.L_Z900_12
+ j .L_Z900_3
+.L_Z900_15:
clc 0(1,%r3),0(%r2)
-END(MEMCMP_Z900_G5)
-# undef LTGR
-# undef AGHI
-# undef BRCTG
-#endif /* HAVE_MEMCMP_Z900_G5 */
+END(MEMCMP_Z900)
+#endif /* HAVE_MEMCMP_Z900 */
#if HAVE_MEMCMP_Z10
ENTRY(MEMCMP_Z10)
.machine "z10"
- .machinemode "zarch_nohighgprs"
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
ltgr %r4,%r4
je .L_Z10_4
aghi %r4,-1
#if HAVE_MEMCMP_Z196
ENTRY(MEMCMP_Z196)
.machine "z196"
- .machinemode "zarch_nohighgprs"
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
ltgr %r4,%r4
je .L_Z196_4
aghi %r4,-1
# undef memcmp
# include <ifunc-resolve.h>
-# if HAVE_MEMCMP_Z900_G5
-extern __typeof (__redirect_memcmp) MEMCMP_Z900_G5 attribute_hidden;
+# if HAVE_MEMCMP_Z900
+extern __typeof (__redirect_memcmp) MEMCMP_Z900 attribute_hidden;
# endif
# if HAVE_MEMCMP_Z10
#include <sysdeps/generic/memcopy.h>
-/* The s390/s390x memcpy implementations are safe to be used by memmove. */
+/* The s390x memcpy implementations are safe to be used by memmove. */
#undef MEMCPY_OK_FOR_FWD_MEMMOVE
#define MEMCPY_OK_FOR_FWD_MEMMOVE 1
-/* memcpy - copy a block from source to destination. 31/64 bit S/390 version.
+/* memcpy - copy a block from source to destination. 64 bit S/390 version.
Copyright (C) 2012-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
.text
-#if defined __s390x__
-# define LTGR ltgr
-# define CGHI cghi
-# define LGR lgr
-# define AGHI aghi
-# define BRCTG brctg
-#else
-# define LTGR ltr
-# define CGHI chi
-# define LGR lr
-# define AGHI ahi
-# define BRCTG brct
-#endif /* ! defined __s390x__ */
-
-#if HAVE_MEMCPY_Z900_G5
-ENTRY(MEMPCPY_Z900_G5)
-# if defined __s390x__
+#if HAVE_MEMCPY_Z900
+ENTRY(MEMPCPY_Z900)
.machine "z900"
-# else
- .machine "g5"
-# endif /* ! defined __s390x__ */
- LGR %r1,%r2 # Use as dest
+ lgr %r1,%r2 # Use as dest
la %r2,0(%r4,%r2) # Return dest + n
- j .L_Z900_G5_start
-END(MEMPCPY_Z900_G5)
+ j .L_Z900_start
+END(MEMPCPY_Z900)
-ENTRY(MEMCPY_Z900_G5)
-# if defined __s390x__
+ENTRY(MEMCPY_Z900)
.machine "z900"
-# else
- .machine "g5"
-# endif /* ! defined __s390x__ */
- LGR %r1,%r2 # r1: Use as dest ; r2: Return dest
-.L_Z900_G5_start:
- LTGR %r4,%r4
- je .L_Z900_G5_4
- AGHI %r4,-1
-# if defined __s390x__
+ lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
+.L_Z900_start:
+ ltgr %r4,%r4
+ je .L_Z900_4
+ aghi %r4,-1
srlg %r5,%r4,8
-# else
- lr %r5,%r4
- srl %r5,8
-# endif /* ! defined __s390x__ */
- LTGR %r5,%r5
- jne .L_Z900_G5_13
-.L_Z900_G5_3:
-# if defined __s390x__
- larl %r5,.L_Z900_G5_15
-# define Z900_G5_EX_D 0
-# else
- basr %r5,0
-.L_Z900_G5_14:
-# define Z900_G5_EX_D .L_Z900_G5_15-.L_Z900_G5_14
-# endif /* ! defined __s390x__ */
- ex %r4,Z900_G5_EX_D(%r5)
-.L_Z900_G5_4:
+ ltgr %r5,%r5
+ jne .L_Z900_13
+.L_Z900_3:
+ larl %r5,.L_Z900_15
+ ex %r4,0(%r5)
+.L_Z900_4:
br %r14
-.L_Z900_G5_13:
- CGHI %r5,4096 # Switch to mvcle for copies >1MB
+.L_Z900_13:
+ cghi %r5,4096 # Switch to mvcle for copies >1MB
jh __memcpy_mvcle
-.L_Z900_G5_12:
+.L_Z900_12:
mvc 0(256,%r1),0(%r3)
la %r1,256(%r1)
la %r3,256(%r3)
- BRCTG %r5,.L_Z900_G5_12
- j .L_Z900_G5_3
-.L_Z900_G5_15:
+ brctg %r5,.L_Z900_12
+ j .L_Z900_3
+.L_Z900_15:
mvc 0(1,%r1),0(%r3)
-END(MEMCPY_Z900_G5)
-#endif /* HAVE_MEMCPY_Z900_G5 */
+END(MEMCPY_Z900)
+#endif /* HAVE_MEMCPY_Z900 */
ENTRY(__memcpy_mvcle)
# Using as standalone function will result in unexpected
# results since the length field is incremented by 1 in order to
# compensate the changes already done in the functions above.
- LGR %r0,%r2 # backup return dest [ + n ]
- AGHI %r4,1 # length + 1
+ lgr %r0,%r2 # backup return dest [ + n ]
+ aghi %r4,1 # length + 1
LGR %r5,%r4 # source length
LGR %r4,%r3 # source address
LGR %r2,%r1 # destination address
.L_MVCLE_1:
mvcle %r2,%r4,0 # that's it, MVCLE is your friend
jo .L_MVCLE_1
- LGR %r2,%r0 # return destination address
+ lgr %r2,%r0 # return destination address
br %r14
END(__memcpy_mvcle)
-#undef LTGR
-#undef CGHI
-#undef LGR
-#undef AGHI
-#undef BRCTG
-
#if HAVE_MEMCPY_Z10
ENTRY(MEMPCPY_Z10)
.machine "z10"
- .machinemode "zarch_nohighgprs"
lgr %r1,%r2 # Use as dest
la %r2,0(%r4,%r2) # Return dest + n
j .L_Z10_start
ENTRY(MEMCPY_Z10)
.machine "z10"
- .machinemode "zarch_nohighgprs"
lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
.L_Z10_start:
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
cgije %r4,0,.L_Z10_4
aghi %r4,-1
srlg %r5,%r4,8
#if HAVE_MEMCPY_Z196
ENTRY(MEMPCPY_Z196)
.machine "z196"
- .machinemode "zarch_nohighgprs"
lgr %r1,%r2 # Use as dest
la %r2,0(%r4,%r2) # Return dest + n
j .L_Z196_start
ENTRY(MEMCPY_Z196)
.machine "z196"
- .machinemode "zarch_nohighgprs"
lgr %r1,%r2 # r1: Use as dest ; r2: Return dest
.L_Z196_start:
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
ltgr %r4,%r4
je .L_Z196_4
.L_Z196_start2:
#if HAVE_MEMMOVE_Z13
ENTRY(MEMMOVE_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-# if !defined __s390x__
- /* Note: The 31bit dst and src pointers are prefixed with zeroes. */
- llgfr %r4,%r4
- llgfr %r3,%r3
- llgfr %r2,%r2
-# endif /* !defined __s390x__ */
sgrk %r0,%r2,%r3
clgijh %r4,16,.L_MEMMOVE_Z13_LARGE
aghik %r5,%r4,-1
#if HAVE_MEMMOVE_ARCH13
ENTRY(MEMMOVE_ARCH13)
.machine "arch13"
- .machinemode "zarch_nohighgprs"
-# if ! defined __s390x__
- /* Note: The 31bit dst and src pointers are prefixed with zeroes. */
- llgfr %r4,%r4
- llgfr %r3,%r3
- llgfr %r2,%r2
-# endif /* ! defined __s390x__ */
sgrk %r5,%r2,%r3
aghik %r0,%r4,-1 /* Both vstl and mvcrl needs highest index. */
clgijh %r4,16,.L_MEMMOVE_ARCH13_LARGE
# undef memcpy
# include <ifunc-resolve.h>
-# if HAVE_MEMCPY_Z900_G5
-extern __typeof (__redirect_memcpy) MEMCPY_Z900_G5 attribute_hidden;
+# if HAVE_MEMCPY_Z900
+extern __typeof (__redirect_memcpy) MEMCPY_Z900 attribute_hidden;
# endif
# if HAVE_MEMCPY_Z10
-/* Vector optimized 32/64 bit S/390 version of memmem.
+/* Vector optimized 64 bit S/390 version of memmem.
Copyright (C) 2019-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Locate a substring. */
ENTRY(MEMMEM_ARCH13)
.machine "arch13"
- .machinemode "zarch_nohighgprs"
-# if ! defined __s390x__
- llgfr %r3,%r3
- llgfr %r5,%r5
- llgfr %r4,%r4
- llgfr %r2,%r2
-# endif /* ! defined __s390x__ */
clgrjl %r3,%r5,.Lend_no_match /* Haystack < needle? */
/* Jump to fallback if needle > 9. See also strstr-arch13.S. */
# undef __mempcpy
# include <ifunc-resolve.h>
-# if HAVE_MEMCPY_Z900_G5
-extern __typeof (__redirect___mempcpy) MEMPCPY_Z900_G5 attribute_hidden;
+# if HAVE_MEMCPY_Z900
+extern __typeof (__redirect___mempcpy) MEMPCPY_Z900 attribute_hidden;
# endif
# if HAVE_MEMCPY_Z10
-/* Vector optimized 32/64 bit S/390 version of memrchr.
+/* Vector optimized 64 bit S/390 version of memrchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(MEMRCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgije %r4,0,.Lnot_found
vlvgb %v18,%r3,0 /* Generate vector which elements are all c.
-/* Set a block of memory to some byte value. 31/64 bit S/390 version.
+/* Set a block of memory to some byte value. 64 bit S/390 version.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
.text
-#if HAVE_MEMSET_Z900_G5
-# if defined __s390x__
-# define LTGR ltgr
-# define CGHI cghi
-# define LGR lgr
-# define AGHI aghi
-# define BRCTG brctg
-# else
-# define LTGR ltr
-# define CGHI chi
-# define LGR lr
-# define AGHI ahi
-# define BRCTG brct
-# endif /* ! defined __s390x__ */
-
-ENTRY(MEMSET_Z900_G5)
-.L_Z900_G5_start:
-#if defined __s390x__
+#if HAVE_MEMSET_Z900
+ENTRY(MEMSET_Z900)
+.L_Z900_start:
.machine "z900"
-#else
- .machine "g5"
-#endif /* ! defined __s390x__ */
- LTGR %r4,%r4
- je .L_Z900_G5_4
+ ltgr %r4,%r4
+ je .L_Z900_4
stc %r3,0(%r2)
- CGHI %r4,1
- LGR %r1,%r2
- je .L_Z900_G5_4
- AGHI %r4,-2
-#if defined __s390x__
- larl %r5,.L_Z900_G5_18
+ cghi %r4,1
+ lgr %r1,%r2
+ je .L_Z900_4
+ aghi %r4,-2
+ larl %r5,.L_Z900_18
srlg %r3,%r4,8
-# define Z900_G5_EX_D 0
-#else
- basr %r5,0
-.L_Z900_G5_19:
-# define Z900_G5_EX_D .L_Z900_G5_18-.L_Z900_G5_19
- lr %r3,%r4
- srl %r3,8
-#endif /* ! defined __s390x__ */
- LTGR %r3,%r3
- jne .L_Z900_G5_14
-.L_Z900_G5_3:
- ex %r4,Z900_G5_EX_D(%r5)
-.L_Z900_G5_4:
+ ltgr %r3,%r3
+ jne .L_Z900_14
+.L_Z900_3:
+ ex %r4,0(%r5)
+.L_Z900_4:
br %r14
-.L_Z900_G5_14:
+.L_Z900_14:
mvc 1(256,%r1),0(%r1)
la %r1,256(%r1)
- BRCTG %r3,.L_Z900_G5_14
- j .L_Z900_G5_3
-.L_Z900_G5_18:
+ brctg %r3,.L_Z900_14
+ j .L_Z900_3
+.L_Z900_18:
mvc 1(1,%r1),0(%r1)
-END(MEMSET_Z900_G5)
-# undef LTGR
-# undef CGHI
-# undef LGR
-# undef AGHI
-# undef BRCTG
-#endif /* HAVE_MEMSET_Z900_G5 */
+END(MEMSET_Z900)
+#endif /* HAVE_MEMSET_Z900 */
#if HAVE_MEMSET_Z10
ENTRY(MEMSET_Z10)
.L_Z10_start:
.machine "z10"
- .machinemode "zarch_nohighgprs"
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
cgije %r4,0,.L_Z10_4
stc %r3,0(%r2)
lgr %r1,%r2
ENTRY(MEMSET_Z196)
.L_Z196_start:
.machine "z196"
- .machinemode "zarch_nohighgprs"
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,1
jl .L_Z196_4 # n == 0
stc %r3,0(%r2)
# undef memset
# include <ifunc-resolve.h>
-# if HAVE_MEMSET_Z900_G5
-extern __typeof (__redirect_memset) MEMSET_Z900_G5 attribute_hidden;
+# if HAVE_MEMSET_Z900
+extern __typeof (__redirect_memset) MEMSET_Z900 attribute_hidden;
# endif
# if HAVE_MEMSET_Z10
loop_count = 16; \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
" sllk %[R_I],%[R_LI],4\n\t" \
" ahi %[R_I],-1\n\t" \
/* Execute mvc and tr with correct len. */ \
(ch == 0 is no error, but is handled differently) */ \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for ch >= max. */ \
" vzero %%v21\n\t" \
" vleih %%v21,-24576,0\n\t" /* element 0: > */ \
check for errors (from_ucs4[ch] == 0). */ \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
" sllk %[R_I],%[R_LI],4\n\t" \
" ahi %[R_I],-1\n\t" \
/* Execute tr with correct len. */ \
# undef __gconv_transform_internal_ucs2reverse
/* Now define the functions with vector support. */
-# if defined __s390x__
-# define CONVERT_32BIT_SIZE_T(REG)
-# else
-# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
-# endif
/* Convert from ISO 646-IRV to the internal (UCS4-like) format. */
# define DEFINE_INIT 0
size_t loop_count, tmp; \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
- CONVERT_32BIT_SIZE_T ([R_LEN]) \
" vrepib %%v30,0x7f\n\t" /* For compare > 0x7f. */ \
" srlg %[R_LI],%[R_LEN],4\n\t" \
" vrepib %%v31,0x20\n\t" \
size_t loop_count, tmp, tmp2; \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
- CONVERT_32BIT_SIZE_T ([R_LEN]) \
/* Setup to check for ch > 0x7f. */ \
" vzero %%v21\n\t" \
" srlg %[R_LI],%[R_LEN],4\n\t" \
size_t loop_count;
__asm__ volatile (".machine push\n\t"
".machine \"z13\"\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
- CONVERT_32BIT_SIZE_T ([R_LEN])
" bras %[R_LI],1f\n\t"
/* Vector permute mask: */
" .long 0x03020100,0x7060504,0x0B0A0908,0x0F0E0D0C\n\t"
len = MIN (inend - inptr, outend - outptr) / 4;
__asm__ volatile (".machine push\n\t"
".machine \"z13\"\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
- CONVERT_32BIT_SIZE_T ([R_LEN])
/* Setup to check for ch > 0x7fffffff. */
" larl %[R_LI],9f\n\t"
" vlm %%v20,%%v21,0(%[R_LI])\n\t"
len = MIN (inend - inptr, outend - outptr) / 4;
__asm__ volatile (".machine push\n\t"
".machine \"z13\"\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
- CONVERT_32BIT_SIZE_T ([R_LEN])
/* Setup to check for ch > 0x7fffffff. */
" larl %[R_LI],9f\n\t"
" vlm %%v20,%%v22,0(%[R_LI])\n\t"
len = MIN ((inend - inptr) / 2, (outend - outptr) / 4); \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
- CONVERT_32BIT_SIZE_T ([R_LEN]) \
/* Setup to check for ch >= 0xd800 && ch < 0xe000. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v20,%%v21,0(%[R_TMP])\n\t" \
len = MIN ((inend - inptr) / 2, (outend - outptr) / 4); \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
- CONVERT_32BIT_SIZE_T ([R_LEN]) \
/* Setup to check for ch >= 0xd800 && ch < 0xe000. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v20,%%v22,0(%[R_TMP])\n\t" \
loop_count = (outend - outptr) / 16; \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
- CONVERT_32BIT_SIZE_T ([R_LI]) \
" larl %[R_I],3f\n\t" \
" vlm %%v20,%%v23,0(%[R_I])\n\t" \
"0: \n\t" \
loop_count = (outend - outptr) / 16; \
__asm__ volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
- CONVERT_32BIT_SIZE_T ([R_LI]) \
" larl %[R_I],3f\n\t" \
" vlm %%v20,%%v24,0(%[R_I])\n\t" \
"0: \n\t" \
-/* Enumerate available IFUNC implementations of a function. s390/s390x version.
+/* Enumerate available IFUNC implementations of a function. s390x version.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
IFUNC_IMPL_ADD (array, i, memset,
S390_IS_Z10 (stfle_bits), MEMSET_Z10)
# endif
-# if HAVE_MEMSET_Z900_G5
- IFUNC_IMPL_ADD (array, i, memset, 1, MEMSET_Z900_G5)
+# if HAVE_MEMSET_Z900
+ IFUNC_IMPL_ADD (array, i, memset, 1, MEMSET_Z900)
# endif
)
#endif /* HAVE_MEMSET_IFUNC */
IFUNC_IMPL_ADD (array, i, memcmp,
S390_IS_Z10 (stfle_bits), MEMCMP_Z10)
# endif
-# if HAVE_MEMCMP_Z900_G5
- IFUNC_IMPL_ADD (array, i, memcmp, 1, MEMCMP_Z900_G5)
+# if HAVE_MEMCMP_Z900
+ IFUNC_IMPL_ADD (array, i, memcmp, 1, MEMCMP_Z900)
# endif
)
#endif /* HAVE_MEMCMP_IFUNC */
IFUNC_IMPL_ADD (array, i, memcpy,
S390_IS_Z10 (stfle_bits), MEMCPY_Z10)
# endif
-# if HAVE_MEMCPY_Z900_G5
- IFUNC_IMPL_ADD (array, i, memcpy, 1, MEMCPY_Z900_G5)
+# if HAVE_MEMCPY_Z900
+ IFUNC_IMPL_ADD (array, i, memcpy, 1, MEMCPY_Z900)
# endif
)
IFUNC_IMPL_ADD (array, i, mempcpy,
S390_IS_Z10 (stfle_bits), MEMPCPY_Z10)
# endif
-# if HAVE_MEMCPY_Z900_G5
- IFUNC_IMPL_ADD (array, i, mempcpy, 1, MEMPCPY_Z900_G5)
+# if HAVE_MEMCPY_Z900
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1, MEMPCPY_Z900)
# endif
)
#endif /* HAVE_MEMCPY_IFUNC */
IFUNC_IMPL_ADD (array, i, strcpy,
dl_hwcap & HWCAP_S390_VX, STRCPY_Z13)
# endif
-# if HAVE_STRCPY_Z900_G5
- IFUNC_IMPL_ADD (array, i, strcpy, 1, STRCPY_Z900_G5)
+# if HAVE_STRCPY_Z900
+ IFUNC_IMPL_ADD (array, i, strcpy, 1, STRCPY_Z900)
# endif
)
#endif /* HAVE_STRCPY_IFUNC */
IFUNC_IMPL_ADD (array, i, strncpy,
dl_hwcap & HWCAP_S390_VX, STRNCPY_Z13)
# endif
-# if HAVE_STRNCPY_Z900_G5
- IFUNC_IMPL_ADD (array, i, strncpy, 1, STRNCPY_Z900_G5)
+# if HAVE_STRNCPY_Z900
+ IFUNC_IMPL_ADD (array, i, strncpy, 1, STRNCPY_Z900)
# endif
)
#endif /* HAVE_STRNCPY_IFUNC */
IFUNC_IMPL_ADD (array, i, strcmp,
dl_hwcap & HWCAP_S390_VX, STRCMP_Z13)
# endif
-# if HAVE_STRCMP_Z900_G5
- IFUNC_IMPL_ADD (array, i, strcmp, 1, STRCMP_Z900_G5)
+# if HAVE_STRCMP_Z900
+ IFUNC_IMPL_ADD (array, i, strcmp, 1, STRCMP_Z900)
# endif
)
#endif /* HAVE_STRCMP_IFUNC */
IFUNC_IMPL_ADD (array, i, memchr,
dl_hwcap & HWCAP_S390_VX, MEMCHR_Z13)
# endif
-# if HAVE_MEMCHR_Z900_G5
- IFUNC_IMPL_ADD (array, i, memchr, 1, MEMCHR_Z900_G5)
+# if HAVE_MEMCHR_Z900
+ IFUNC_IMPL_ADD (array, i, memchr, 1, MEMCHR_Z900)
# endif
)
#endif /* HAVE_MEMCHR_IFUNC */
/* IFUNC resolver function for CPU specific functions.
- 32/64 bit S/390 version.
+ 64 bit S/390 version.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP,
(HAVE_FROM_VX && (hwcap & HWCAP_S390_VX))
? FROM_LOOP_VX
- : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ZARCH
- && hwcap & HWCAP_S390_HIGH_GPRS
- && hwcap & HWCAP_S390_ETF3EH))
+ : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ETF3EH))
? FROM_LOOP_CU
: FROM_LOOP_DEFAULT);
s390_libc_ifunc_expr (FROM_LOOP_DEFAULT, FROM_LOOP,
(HAVE_FROM_VX && (hwcap & HWCAP_S390_VX))
? FROM_LOOP_VX
- : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ZARCH
- && hwcap & HWCAP_S390_HIGH_GPRS
- && hwcap & HWCAP_S390_ETF3EH))
+ : (HAVE_FROM_CU && (hwcap & HWCAP_S390_ETF3EH))
? FROM_LOOP_CU
: FROM_LOOP_DEFAULT);
int __lock;
unsigned int __count;
int __owner;
-#if __WORDSIZE == 64
unsigned int __nusers;
-#endif
/* KIND must stay at this position in the structure to maintain
binary compatibility with static initializers. */
int __kind;
-#if __WORDSIZE == 64
short __spins;
short __glibc_reserved;
__pthread_list_t __list;
# define __PTHREAD_MUTEX_HAVE_PREV 1
-#else
- unsigned int __nusers;
- __extension__ union
- {
- struct
- {
- short __data_spins;
- short __data_unused;
- } __data;
-# define __spins __data.__data_spins
- __pthread_slist_t __list;
- };
-# define __PTHREAD_MUTEX_HAVE_PREV 0
-#endif
};
-#if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_INITIALIZER(__kind) \
+#define __PTHREAD_MUTEX_INITIALIZER(__kind) \
0, 0, 0, 0, __kind, 0, 0, { 0, 0 }
-#else
-# define __PTHREAD_MUTEX_INITIALIZER(__kind) \
- 0, 0, 0, __kind, 0, { { 0, 0 } }
-#endif
#endif
unsigned int __writers_futex;
unsigned int __pad3;
unsigned int __pad4;
-#if __WORDSIZE == 64
int __cur_writer;
int __shared;
unsigned long int __pad1;
/* FLAGS must stay at this position in the structure to maintain
binary compatibility. */
unsigned int __flags;
-# else
- unsigned char __pad1;
- unsigned char __pad2;
- unsigned char __shared;
- /* FLAGS must stay at this position in the structure to maintain
- binary compatibility. */
- unsigned char __flags;
- int __cur_writer;
-#endif
};
-#if __WORDSIZE == 64
-# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
+#define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags
-#else
-# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0
-#endif
#endif
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_KIND_OFFSET 16
-#else
-# define __PTHREAD_MUTEX_KIND_OFFSET 12
-#endif
-
-#if __WORDSIZE == 64
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48
-#else
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27
-#endif
+#define __PTHREAD_MUTEX_KIND_OFFSET 16
+#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48
void *__private_ss;
} tcbhead_t;
-# ifndef __s390x__
-# define TLS_MULTIPLE_THREADS_IN_TCB 1
-# endif
-
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif
-/* Vector optimized 32/64 bit S/390 version of rawmemchr.
+/* Vector optimized 64 bit S/390 version of rawmemchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(RAWMEMCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
/* Determine the wordsize from the preprocessor defines. */
-#if defined __s390x__
-# define __WORDSIZE 64
-#else
-# define __WORDSIZE 32
-# define __WORDSIZE32_SIZE_ULONG 1
-# define __WORDSIZE32_PTRDIFF_LONG 0
-#endif
-
-#define __WORDSIZE_TIME64_COMPAT32 0
+#define __WORDSIZE 64
+#define __WORDSIZE_TIME64_COMPAT32 0
#define STACK_CHK_GUARD \
({ uintptr_t x; __asm__ ("ear %0,%%a0; sllg %0,%0,32; ear %0,%%a1; lg %0,0x28(%0)" : "=a" (x)); x; })
-/* On s390/s390x there is no unique pointer guard, instead we use the
+/* On s390x there is no unique pointer guard, instead we use the
same value as the stack guard. */
#define POINTER_CHK_GUARD \
({ \
#include "sysdep.h"
#include "asm-syntax.h"
-#if HAVE_STRNCPY_Z900_G5
-ENTRY(STRNCPY_Z900_G5)
+#if HAVE_STRNCPY_Z900
+ENTRY(STRNCPY_Z900)
.text
stg %r2,48(%r15) # save dst pointer
slgr %r2,%r3 # %r3 points to src, %r2+%r3 to dst
jo .L13
.Lexit: lg %r2,48(%r15) # return dst pointer
br %r14
-END(STRNCPY_Z900_G5)
+END(STRNCPY_Z900)
# if ! HAVE_STRNCPY_IFUNC
-strong_alias (STRNCPY_Z900_G5, strncpy)
+strong_alias (STRNCPY_Z900, strncpy)
# endif
# if defined SHARED && IS_IN (libc)
-strong_alias (STRNCPY_Z900_G5, __GI_strncpy)
+strong_alias (STRNCPY_Z900, __GI_strncpy)
# endif
#endif
#include <elf/sotruss-lib.c>
-#if __ELF_NATIVE_CLASS == 32
-# define la_s390_gnu_pltenter la_s390_32_gnu_pltenter
-# define la_s390_gnu_pltexit la_s390_32_gnu_pltexit
-# define La_s390_regs La_s390_32_regs
-# define La_s390_retval La_s390_32_retval
-#else
-# define la_s390_gnu_pltenter la_s390_64_gnu_pltenter
-# define la_s390_gnu_pltexit la_s390_64_gnu_pltexit
-# define La_s390_regs La_s390_64_regs
-# define La_s390_retval La_s390_64_retval
-#endif
-
-ElfW(Addr)
-la_s390_gnu_pltenter (ElfW(Sym) *sym,
- unsigned int ndx __attribute__ ((unused)),
- uintptr_t *refcook, uintptr_t *defcook,
- La_s390_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
+Elf64_Addr
+la_s390_64_gnu_pltenter (Elf64_Sym *sym,
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_s390_64_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
{
print_enter (refcook, defcook, symname,
regs->lr_r2, regs->lr_r3, regs->lr_r4, *flags);
}
unsigned int
-la_s390_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook,
- const struct La_s390_regs *inregs,
- struct La_s390_retval *outregs, const char *symname)
+la_s390_64_gnu_pltexit (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_s390_64_regs *inregs,
+ struct La_s390_64_retval *outregs,
+ const char *symname)
{
print_exit (refcook, defcook, symname, outregs->lrv_r2);
-/* Vector optimized 32/64 bit S/390 version of stpcpy.
+/* Vector optimized 64 bit S/390 version of stpcpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STPCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r3),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r3),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of stpncpy.
+/* Vector optimized 64 bit S/390 version of stpncpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STPNCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,0
ber %r14 /* Nothing to do, if n == 0. */
-/* Vector optimized 32/64 bit S/390 version of strcat.
+/* Vector optimized 64 bit S/390 version of strcat.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRCAT_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
lgr %r0,%r2 /* Save destination pointer for return. */
-/* Vector optimized 32/64 bit S/390 version of strchr.
+/* Vector optimized 64 bit S/390 version of strchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of strchrnul.
+/* Vector optimized 64 bit S/390 version of strchrnul.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRCHRNUL_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of strcmp.
+/* Vector optimized 64 bit S/390 version of strcmp.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRCMP_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
lghi %r5,0 /* current_len = 0. */
strong_alias (STRCMP_Z13, strcmp)
# endif
-# if ! HAVE_STRCMP_Z900_G5 && defined SHARED && IS_IN (libc)
+# if ! HAVE_STRCMP_Z900 && defined SHARED && IS_IN (libc)
strong_alias (STRCMP_Z13, __GI_strcmp)
# endif
#endif
#include "sysdep.h"
#include "asm-syntax.h"
-#if HAVE_STRCMP_Z900_G5
-# if defined __s390x__
-# define SLGR slgr
-# define LGHI lghi
-# else
-# define SLGR slr
-# define LGHI lhi
-# endif /* ! defined __s390x__ */
-
+#if HAVE_STRCMP_Z900
.text
-ENTRY(STRCMP_Z900_G5)
- SLGR %r0,%r0
+ENTRY(STRCMP_Z900)
+ slgr %r0,%r0
0: clst %r2,%r3
jo 0b
jp 1f
jm 2f
- SLGR %r2,%r2
+ slgr %r2,%r2
br %r14
-1: LGHI %r2,1
+1: lghi %r2,1
br %r14
-2: LGHI %r2,-1
+2: lghi %r2,-1
br %r14
-END(STRCMP_Z900_G5)
+END(STRCMP_Z900)
# if ! HAVE_STRCMP_IFUNC
-strong_alias (STRCMP_Z900_G5, strcmp)
+strong_alias (STRCMP_Z900, strcmp)
# endif
# if defined SHARED && IS_IN (libc)
-strong_alias (STRCMP_Z900_G5, __GI_strcmp)
+strong_alias (STRCMP_Z900, __GI_strcmp)
# endif
#endif
# include <ifunc-resolve.h>
# undef strcmp
-# if HAVE_STRCMP_Z900_G5
-extern __typeof (__redirect_strcmp) STRCMP_Z900_G5 attribute_hidden;
+# if HAVE_STRCMP_Z900
+extern __typeof (__redirect_strcmp) STRCMP_Z900 attribute_hidden;
# endif
# if HAVE_STRCMP_Z13
-/* Vector optimized 32/64 bit S/390 version of strcpy.
+/* Vector optimized 64 bit S/390 version of strcpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r3),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r3),6 /* Get bytes to 4k-byte boundary or 16. */
strong_alias (STRCPY_Z13, strcpy)
# endif
-# if ! HAVE_STRCPY_Z900_G5 && defined SHARED && IS_IN (libc)
+# if ! HAVE_STRCPY_Z900 && defined SHARED && IS_IN (libc)
strong_alias (STRCPY_Z13, __GI_strcpy)
# endif
#endif
-/* strcpy - copy a string from source to destination. 64/31 bit S/390 version.
+/* strcpy - copy a string from source to destination. 64 bit S/390 version.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
#include "sysdep.h"
#include "asm-syntax.h"
-#if HAVE_STRCPY_Z900_G5
-# if defined __s390x__
-# define SLGR slgr
-# define LGR lgr
-# else
-# define SLGR slr
-# define LGR lr
-# endif /* ! defined __s390x__ */
-
- .text
-ENTRY(STRCPY_Z900_G5)
- SLGR %r0,%r0
- LGR %r1,%r2
+#if HAVE_STRCPY_Z900
+ .text
+ENTRY(STRCPY_Z900)
+ slgr %r0,%r0
+ lgr %r1,%r2
0: mvst %r1,%r3
jo 0b
br %r14
-END(STRCPY_Z900_G5)
-
-# undef SLGR
-# undef LGR
+END(STRCPY_Z900)
# if ! HAVE_STRCPY_IFUNC
-strong_alias (STRCPY_Z900_G5, strcpy)
+strong_alias (STRCPY_Z900, strcpy)
# endif
# if defined SHARED && IS_IN (libc)
-strong_alias (STRCPY_Z900_G5, __GI_strcpy)
+strong_alias (STRCPY_Z900, __GI_strcpy)
# endif
#endif
# undef strcpy
# include <ifunc-resolve.h>
-# if HAVE_STRCPY_Z900_G5
-extern __typeof (__redirect_strcpy) STRCPY_Z900_G5 attribute_hidden;
+# if HAVE_STRCPY_Z900
+extern __typeof (__redirect_strcpy) STRCPY_Z900 attribute_hidden;
# endif
# if HAVE_STRCPY_Z13
-/* Vector optimized 32/64 bit S/390 version of strcspn.
+/* Vector optimized 64 bit S/390 version of strcspn.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRCSPN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
/*
Check if reject-string fits in one vreg:
-/* Vector optimized 32/64 bit S/390 version of strlen.
+/* Vector optimized 64 bit S/390 version of strlen.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRLEN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of strncat.
+/* Vector optimized 64 bit S/390 version of strncat.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRNCAT_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,0
ber %r14 /* Nothing to do, if n == 0. */
-/* Vector optimized 32/64 bit S/390 version of strncmp.
+/* Vector optimized 64 bit S/390 version of strncmp.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRNCMP_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgije %r4,0,.Lend_equal /* Nothing to do if n == 0, */
lghi %r5,0 /* current_len = 0. */
-/* Vector optimized 32/64 bit S/390 version of strncpy.
+/* Vector optimized 64 bit S/390 version of strncpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRNCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,0
ber %r14 /* Nothing to do, if n == 0. */
strong_alias (STRNCPY_Z13, strncpy)
# endif
-# if ! HAVE_STRNCPY_Z900_G5 && defined SHARED && IS_IN (libc)
+# if ! HAVE_STRNCPY_Z900 && defined SHARED && IS_IN (libc)
strong_alias (STRNCPY_Z13, __GI_strncpy)
# endif
#endif
# undef strncpy
# include <ifunc-resolve.h>
-# if HAVE_STRNCPY_Z900_G5
-extern __typeof (__redirect_strncpy) STRNCPY_Z900_G5 attribute_hidden;
+# if HAVE_STRNCPY_Z900
+extern __typeof (__redirect_strncpy) STRNCPY_Z900 attribute_hidden;
# endif
# if HAVE_STRNCPY_Z13
-/* Vector optimized 32/64 bit S/390 version of strnlen.
+/* Vector optimized 64 bit S/390 version of strnlen.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRNLEN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r3,%r3
-# endif /* !defined __s390x__ */
clgfi %r3,0 /* if maxlen == 0, return 0. */
locgre %r2,%r3
-/* Vector optimized 32/64 bit S/390 version of strpbrk.
+/* Vector optimized 64 bit S/390 version of strpbrk.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRPBRK_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
/*
Check if accept-string fits in one vreg:
-/* Vector optimized 32/64 bit S/390 version of strrchr.
+/* Vector optimized 64 bit S/390 version of strrchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRRCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r0,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of strspn.
+/* Vector optimized 64 bit S/390 version of strspn.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(STRSPN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
/*
Check if accept-string fits in one vreg:
-/* Vector optimized 32/64 bit S/390 version of strstr.
+/* Vector optimized 64 bit S/390 version of strstr.
Copyright (C) 2019-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Locate a substring. */
ENTRY(STRSTR_ARCH13)
.machine "arch13"
- .machinemode "zarch_nohighgprs"
lcbb %r1,0(%r3),6
jo .Lneedle_on_bb /* Needle on block-boundary? */
vl %v18,0(%r3),6 /* Load needle. */
.type r0x2, @function
r0x2:
.cfi_startproc
-#if defined (__s390x__)
agr %r0,%r0
-#else
- ar %r0,%r0
-#endif
br %r14
.cfi_endproc
.size r0x2, .-r0x2
#include <stdlib.h>
#include <unistd.h>
-#if defined (__s390x__)
static const unsigned long magic_value = 0x0011223344556677UL;
-#else
-static const unsigned long magic_value = 0x00112233;
-#endif
unsigned long r0x2_trampoline (unsigned long);
_dl_runtime_resolve and _dl_runtime_profile. */
asm (" .type r0x2_trampoline, @function\n"
"r0x2_trampoline:\n"
-#if defined (__s390x__)
" lgr %r0,%r2\n"
" stg %r14,112(%r15)\n"
" aghi %r15,-160\n"
" lg %r14,112(%r15)\n"
" lgr %r2,%r0\n"
" br %r14\n"
-#elif defined (__zarch__)
- " lr %r0,%r2\n"
- " st %r14,56(%r15)\n"
- " ahi %r15,-96\n"
- " brasl %r14,r0x2@plt\n"
- " ahi %r15,96\n"
- " l %r14,56(%r15)\n"
- " lr %r2,%r0\n"
- " br %r14\n"
-#else
- " lr %r0,%r2\n"
- " st %r14,56(%r15)\n"
- " ahi %r15,-96\n"
- " balr %r14,0\n"
- " l %r14,1f-.(%r14)\n"
- " basr %r14,%r14\n"
- " ahi %r15,96\n"
- " l %r14,56(%r15)\n"
- " lr %r2,%r0\n"
- " br %r14\n"
- "1: .long r0x2\n"
-#endif
);
static int
# define ASM_CLOBBER_VR(NR)
#endif
-#if defined __s390x__
-# define CONVERT_32BIT_SIZE_T(REG)
-#else
-# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
-#endif
-
/* UTF-32 big endian byte order mark. */
#define BOM_UTF32 0x0000feffu
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for surrogates. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-16 chars <0xd800, >0xdfff. */ \
"0: clgijl %[R_INLEN],16,2f\n\t" \
" clgijl %[R_OUTLEN],32,2f\n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for surrogates. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-16 chars <0xd800, >0xdfff. */ \
"0: clgijl %[R_INLEN],16,20f\n\t" \
" clgijl %[R_OUTLEN],32,20f\n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for surrogates. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-32 chars \
ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \
"0: clgijl %[R_INLEN],32,2f\n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for surrogates. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-32 chars \
ch < 0xd800 || (ch > 0xdfff && ch < 0x10000). */ \
"0: clgijl %[R_INLEN],32,20f\n\t" \
# define ASM_CLOBBER_VR(NR)
#endif
-#if defined __s390x__
-# define CONVERT_32BIT_SIZE_T(REG)
-#else
-# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
-#endif
-
/* Defines for skeleton.c. */
#define DEFINE_INIT 0
#define DEFINE_FINI 0
\
__asm__ __volatile__ (".machine push \n\t" \
".machine \"z9-109\" \n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
"0: " INSTRUCTION " \n\t" \
".machine pop \n\t" \
" jo 0b \n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
" vrepib %%v30,0x7f\n\t" /* For compare > 0x7f. */ \
" vrepib %%v31,0x20\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-8 chars <=0x7f. */ \
"0: clgijl %[R_INLEN],16,20f\n\t" \
" clgijl %[R_OUTLEN],32,20f\n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for values <= 0x7f. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-16 chars <=0x7f. */ \
"0: clgijl %[R_INLEN],32,2f\n\t" \
" clgijl %[R_OUTLEN],16,2f\n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
/* Setup to check for values <= 0x7f. */ \
" larl %[R_TMP],9f\n\t" \
" vlm %%v30,%%v31,0(%[R_TMP])\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-16 chars <=0x7f. */ \
"0: clgijl %[R_INLEN],32,20f\n\t" \
" clgijl %[R_OUTLEN],16,20f\n\t" \
# define ASM_CLOBBER_VR(NR)
#endif
-#if defined __s390x__
-# define CONVERT_32BIT_SIZE_T(REG)
-#else
-# define CONVERT_32BIT_SIZE_T(REG) "llgfr %" #REG ",%" #REG "\n\t"
-#endif
-
/* Defines for skeleton.c. */
#define DEFINE_INIT 0
#define DEFINE_FINI 0
\
__asm__ __volatile__ (".machine push \n\t" \
".machine \"z9-109\" \n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
"0: " INSTRUCTION " \n\t" \
".machine pop \n\t" \
" jo 0b \n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
" vrepib %%v30,0x7f\n\t" /* For compare > 0x7f. */ \
" vrepib %%v31,0x20\n\t" \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-8 chars <=0x7f. */ \
"0: clgijl %[R_INLEN],16,20f\n\t" \
" clgijl %[R_OUTLEN],64,20f\n\t" \
unsigned long tmp, tmp2, tmp3; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
" vleif %%v20,127,0\n\t" /* element 0: 127 */ \
" vzero %%v21\n\t" \
" vleih %%v21,8192,0\n\t" /* element 0: > */ \
" vleih %%v21,-8192,2\n\t" /* element 1: =<> */ \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-32 chars <=0x7f. */ \
"0: clgijl %[R_INLEN],64,2f\n\t" \
" clgijl %[R_OUTLEN],16,2f\n\t" \
unsigned long tmp, tmp2; \
asm volatile (".machine push\n\t" \
".machine \"z13\"\n\t" \
- ".machinemode \"zarch_nohighgprs\"\n\t" \
" vleif %%v20,127,0\n\t" /* element 0: 127 */ \
" vzero %%v21\n\t" \
" vleih %%v21,8192,0\n\t" /* element 0: > */ \
" vleih %%v21,-8192,2\n\t" /* element 1: =<> */ \
- CONVERT_32BIT_SIZE_T ([R_INLEN]) \
- CONVERT_32BIT_SIZE_T ([R_OUTLEN]) \
/* Loop which handles UTF-32 chars <= 0x7f. */ \
"0: clgijl %[R_INLEN],64,20f\n\t" \
" clgijl %[R_OUTLEN],16,20f\n\t" \
-/* Vector optimized 32/64 bit S/390 version of wcpcpy.
+/* Vector optimized 64 bit S/390 version of wcpcpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCPCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r3),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r3),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcpncpy.
+/* Vector optimized 64 bit S/390 version of wcpncpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCPNCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,0
ber %r14 /* Nothing to do, if n == 0. */
llgfr %r6,%r6 /* Convert 32bit to 64bit. */
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r1,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r1,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector optimized 32/64 bit S/390 version of wcscat.
+/* Vector optimized 64 bit S/390 version of wcscat.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSCAT_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcschr.
+/* Vector optimized 64 bit S/390 version of wcschr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcschrnul.
+/* Vector optimized 64 bit S/390 version of wcschrnul.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSCHRNUL_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcscmp.
+/* Vector optimized 64 bit S/390 version of wcscmp.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSCMP_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
lghi %r5,0 /* current_len = 0. */
-/* Vector optimized 32/64 bit S/390 version of wcscpy.
+/* Vector optimized 64 bit S/390 version of wcscpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r3),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r3),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcscspn.
+/* Vector optimized 64 bit S/390 version of wcscspn.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSCSPN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
tmll %r2,3 /* Test if s is 4-byte aligned? */
jne .Lfallback /* And use common-code variant if not. */
-/* Vector optimized 32/64 bit S/390 version of wcslen.
+/* Vector optimized 64 bit S/390 version of wcslen.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSLEN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r1,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcsncat.
+/* Vector optimized 64 bit S/390 version of wcsncat.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSNCAT_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,0
ber %r14 /* Nothing to do, if n == 0. */
lghi %r5,0 /* current_len = 0. */
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r1,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r1,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector optimized 32/64 bit S/390 version of wcsncmp.
+/* Vector optimized 64 bit S/390 version of wcsncmp.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSNCMP_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgije %r4,0,.Lend_equal /* Nothing to do if n == 0. */
/* Check range of n and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r1,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r1,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector optimized 32/64 bit S/390 version of wcsncpy.
+/* Vector optimized 64 bit S/390 version of wcsncpy.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSNCPY_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgfi %r4,0
ber %r14 /* Nothing to do, if n == 0. */
lghi %r5,0 /* current_len = 0. */
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of n. */
lghi %r1,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of n. */
- llilf %r1,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector optimized 32/64 bit S/390 version of wcsnlen.
+/* Vector optimized 64 bit S/390 version of wcsnlen.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
ENTRY(WCSNLEN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r3,%r3
-# endif /* !defined __s390x__ */
clgfi %r3,0 /* if maxlen == 0, return 0. */
locgre %r2,%r3
jne .Lfallback /* And use common-code variant if not. */
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r3,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r4,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r3,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r4,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r3,%r3,2 /* Convert character-count to byte-count. */
locgrne %r3,%r4 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector optimized 32/64 bit S/390 version of wcspbrk.
+/* Vector optimized 64 bit S/390 version of wcspbrk.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSPBRK_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
tmll %r2,3 /* Test if s is 4-byte aligned? */
jne .Lfallback /* And use common-code variant if not. */
-/* Vector optimized 32/64 bit S/390 version of wcsrchr.
+/* Vector optimized 64 bit S/390 version of wcsrchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSRCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
vlbb %v16,0(%r2),6 /* Load s until next 4k-byte boundary. */
lcbb %r0,0(%r2),6 /* Get bytes to 4k-byte boundary or 16. */
-/* Vector optimized 32/64 bit S/390 version of wcsspn.
+/* Vector optimized 64 bit S/390 version of wcsspn.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WCSSPN_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
tmll %r2,3 /* Test if s is 4-byte aligned? */
jne .Lfallback /* And use common-code variant if not. */
-/* Vector optimized 32/64 bit S/390 version of wmemchr.
+/* Vector optimized 64 bit S/390 version of wmemchr.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WMEMCHR_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgije %r4,0,.Lnf_end /* If len == 0 then exit. */
lghi %r5,16 /* current_len = 16. */
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r1,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r1,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector Optimized 32/64 bit S/390 version of wmemcmp.
+/* Vector Optimized 64 bit S/390 version of wmemcmp.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WMEMCMP_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
clgije %r4,0,.Lend_equal /* Nothing to do if n == 0. */
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r1,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r1,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r1 /* Use max byte-count, if bit 0/1 was one. */
-/* Vector Optimized 32/64 bit S/390 version of wmemset.
+/* Vector Optimized 64 bit S/390 version of wmemset.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
*/
ENTRY(WMEMSET_Z13)
.machine "z13"
- .machinemode "zarch_nohighgprs"
-
-# if !defined __s390x__
- llgfr %r4,%r4
-# endif /* !defined __s390x__ */
vlvgg %v31,%r2,0 /* Save destination pointer for return. */
clgije %r4,0,.Lend
vrepf %v16,%v16,0
/* Check range of maxlen and convert to byte-count. */
-# ifdef __s390x__
tmhh %r4,49152 /* Test bit 0 or 1 of maxlen. */
lghi %r5,-4 /* Max byte-count is 18446744073709551612. */
-# else
- tmlh %r4,49152 /* Test bit 0 or 1 of maxlen. */
- llilf %r5,4294967292 /* Max byte-count is 4294967292. */
-# endif /* !__s390x__ */
sllg %r4,%r4,2 /* Convert character-count to byte-count. */
locgrne %r4,%r5 /* Use max byte-count, if bit 0/1 was one. */
return r ?: stat_overflow (buf);
# else
/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
- microblaze, s390, sh, powerpc, and sparc. */
+ microblaze, sh, powerpc, and sparc. */
return INLINE_SYSCALL_CALL (fstat, fd, buf);
# endif
}
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
#else
/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k, mips32,
- microblaze, s390, sh, powerpc32, and sparc32. */
+ microblaze, sh, powerpc32, and sparc32. */
struct stat64 st64;
int r = INLINE_SYSCALL_CALL (fstatat64, fd, file, &st64, flag);
return r ?: __xstat32_conv (vers, &st64, st);
#define MSGRCV_ARGS(__msgp, __msgtyp) \
((long int []){ (long int) __msgp, __msgtyp })
-/* This macro is required to handle the s390 variants, which passes the
- arguments in a different order than default. */
+/* This macro is required to handle s390x, which passes the arguments in a
+ different order than default. */
#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \
(__nsops), 0, (__sops), (__timeout)
similar to kernel:
- __ASSUME_CLONE_BACKWARDS: for variant 1.
- - __ASSUME_CLONE_BACKWARDS2: for variant 2 (s390).
+ - __ASSUME_CLONE_BACKWARDS2: for variant 2 (s390x).
- __ASSUME_CLONE_BACKWARDS3: for variant 3 (microblaze).
- __ASSUME_CLONE_DEFAULT: for variant 4.
*/
return r ?: stat_overflow (buf);
# else
/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
- microblaze, s390, sh, powerpc, and sparc. */
+ microblaze, sh, powerpc, and sparc. */
return INLINE_SYSCALL_CALL (lstat, name, buf);
# endif
}
AT_SYMLINK_NOFOLLOW);
# else
/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
- microblaze, s390, sh, mips32, powerpc32, and sparc32. */
+ microblaze, sh, mips32, powerpc32, and sparc32. */
return INLINE_SYSCALL_CALL (lstat64, name, buf);
# endif /* STAT_IS_KERNEL_STAT */
#endif /* XSTAT_IS_XSTAT64 */
__NR_fadvise64_64 (without the alignment argument required for the ABI).
Third option will be used by mips o32. Mips will use a 7 argument
- syscall with __NR_fadvise64.
-
- s390 implements fadvice64_64 using a specific struct with arguments
- packed inside. This is the only implementation handled in arch-specific
- code. */
+ syscall with __NR_fadvise64. */
int
posix_fadvise (int fd, off_t offset, off_t len, int advise)
/* Both arm and powerpc implements fadvise64_64 with last 'advise' argument
just after 'fd' to avoid the requirement of implementing 7-arg syscalls.
- ARM also defines __NR_fadvise64_64 as __NR_arm_fadvise64_64.
-
- s390 implements fadvice64_64 using a specific struct with arguments
- packed inside. This is the only implementation handled in arch-specific
- code. */
+ ARM also defines __NR_fadvise64_64 as __NR_arm_fadvise64_64. */
#ifndef __NR_fadvise64_64
# define __NR_fadvise64_64 __NR_fadvise64
-abi-variants := 32 64
-abi-32-condition := __WORDSIZE == 32
-abi-64-condition := __WORDSIZE == 64
-
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
librt-shared-only-routines += rt-sysdep
#define __ELF_NATIVE_CLASS __WORDSIZE
-#if __WORDSIZE == 64
/* 64 bit Linux for S/390 is exceptional as it has .hash section with
64 bit entries. */
typedef uint64_t Elf_Symndx;
-#else
-/* 32 bit Linux for S/390 has normal .hash section entries with 32 bits. */
-typedef uint32_t Elf_Symndx;
-#endif
#include <bits/wordsize.h>
-#if __WORDSIZE == 64
/* Not necessary, files are always with 64bit off_t. */
-# define __O_LARGEFILE 0
-#endif
+#define __O_LARGEFILE 0
-#if __WORDSIZE == 64
/* Not necessary, we always have 64-bit offsets. */
-# define F_GETLK64 5 /* Get record locking info. */
-# define F_SETLK64 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW64 7 /* Set record locking info (blocking). */
-#endif
+#define F_GETLK64 5 /* Get record locking info. */
+#define F_SETLK64 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 7 /* Set record locking info (blocking). */
struct flock
{
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
-#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
__off_t l_start; /* Offset where the lock begins. */
__off_t l_len; /* Size of the locked area; zero means until EOF. */
-#else
- __off64_t l_start; /* Offset where the lock begins. */
- __off64_t l_len; /* Size of the locked area; zero means until EOF. */
-#endif
__pid_t l_pid; /* Process holding the lock. */
};
};
#endif
-#if __WORDSIZE == 64
-# define __POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
-# define __POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
-#else
-# define __POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
-# define __POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
-#endif
+#define __POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
+#define __POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
/* Include generic Linux declarations. */
#include <bits/fcntl-linux.h>
-/* Definitions for 31 & 64 bit S/390 sigaction.
+/* Definitions for 64 bit S/390 sigaction.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
#endif
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
/* Structure describing the action to be taken when a signal arrives. */
struct sigaction
{
/* Additional set of signals to be blocked. */
__sigset_t sa_mask;
};
-#else
-/* Structure describing the action to be taken when a signal arrives. */
-struct sigaction
- {
- /* Signal handler. */
-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
- union
- {
- /* Used if SA_SIGINFO is not set. */
- __sighandler_t sa_handler;
- /* Used if SA_SIGINFO is set. */
- void (*sa_sigaction) (int, siginfo_t *, void *);
- }
- __sigaction_handler;
-# define sa_handler __sigaction_handler.sa_handler
-# define sa_sigaction __sigaction_handler.sa_sigaction
-#else
- __sighandler_t sa_handler;
-#endif
-
- /* Additional set of signals to be blocked. */
- __sigset_t sa_mask;
-
- /* Special flags. */
- int sa_flags;
-
- /* Restore handler. */
- void (*sa_restorer) (void);
- };
-#endif
/* Bits in `sa_flags'. */
#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
#include <bits/wordsize.h>
-#if __WORDSIZE == 64
struct stat
{
__dev_t st_dev; /* Device. */
__blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */
long int __glibc_reserved[3];
};
-#else
-struct stat
- {
-# ifdef __USE_TIME64_REDIRECTS
-# include <bits/struct_stat_time64_helper.h>
-# else
- __dev_t st_dev; /* Device. */
- unsigned int __pad1;
-# ifndef __USE_FILE_OFFSET64
- __ino_t st_ino; /* File serial number. */
-# else
- __ino_t __st_ino; /* 32bit file serial number. */
-# endif
- __mode_t st_mode; /* File mode. */
- __nlink_t st_nlink; /* Link count. */
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- __dev_t st_rdev; /* Device number, if device. */
- unsigned int __pad2;
-# ifndef __USE_FILE_OFFSET64
- __off_t st_size; /* Size of file, in bytes. */
-# else
- __off64_t st_size; /* Size of file, in bytes. */
-# endif
- __blksize_t st_blksize; /* Optimal block size for I/O. */
-
-# ifndef __USE_FILE_OFFSET64
- __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-# else
- __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-# endif
-# ifdef __USE_XOPEN2K8
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-# else
- __time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- __time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-# endif
-# ifndef __USE_FILE_OFFSET64
- unsigned long int __glibc_reserved4;
- unsigned long int __glibc_reserved5;
-# else
- __ino64_t st_ino; /* File serial number. */
-# endif
-# endif
- };
-# endif
#ifdef __USE_LARGEFILE64
-# if __WORDSIZE == 64
/* Note stat64 is the same shape as stat. */
struct stat64
{
int __glibc_reserved0;
__dev_t st_rdev; /* Device number, if device. */
__off_t st_size; /* Size of file, in bytes. */
-# ifdef __USE_XOPEN2K8
+# ifdef __USE_XOPEN2K8
/* Nanosecond resolution timestamps are stored in a format
equivalent to 'struct timespec'. This is the type used
whenever possible but the Unix namespace rules do not allow the
struct timespec st_atim; /* Time of last access. */
struct timespec st_mtim; /* Time of last modification. */
struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-# else
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+# else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
-# endif
+# endif
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
long int __glibc_reserved[3];
};
-# else
-struct stat64
- {
-# ifdef __USE_TIME64_REDIRECTS
-# include <bits/struct_stat_time64_helper.h>
-# else
- __dev_t st_dev; /* Device. */
- unsigned int __pad1;
-
- __ino_t __st_ino; /* 32bit file serial number. */
- __mode_t st_mode; /* File mode. */
- __nlink_t st_nlink; /* Link count. */
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- __dev_t st_rdev; /* Device number, if device. */
- unsigned int __pad2;
- __off64_t st_size; /* Size of file, in bytes. */
- __blksize_t st_blksize; /* Optimal block size for I/O. */
-
- __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-# ifdef __USE_XOPEN2K8
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-# else
- __time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- __time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-# endif
- __ino64_t st_ino; /* File serial number. */
-# endif
- };
-# endif
#endif
/* Tell code we have these members. */
#define __TIMER_T_TYPE void *
#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
#define __FSID_T_TYPE struct { int __val[2]; }
-#if defined __GNUC__ && __GNUC__ <= 2
-/* Compatibility with g++ 2.95.x. */
-#define __SSIZE_T_TYPE __SWORD_TYPE
-#else
-/* size_t is unsigned long int on s390 -m31. */
-#define __SSIZE_T_TYPE __SLONGWORD_TYPE
-#endif
+
+/* With s390-32, __SSIZE_T_TYPE was __SWORD_TYPE for compatibility with
+ g++ 2.95.x. Afterwards __SLONGWORD_TYPE was needed as size_t was
+ unsigned long int on s390-32.
+ Now as only s390-64 exists, __SWORD_TYPE can be used as also used in the
+ generic version as both types result in long int. */
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
-#define __CPU_MASK_TYPE __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE __ULONGWORD_TYPE
-#ifdef __s390x__
/* Tell the libc code that off_t and off64_t are actually the same type
for all ABI purposes, even if possibly expressed as different base types
for C type-checking purposes. */
-# define __OFF_T_MATCHES_OFF64_T 1
+#define __OFF_T_MATCHES_OFF64_T 1
/* Same for ino_t and ino64_t. */
-# define __INO_T_MATCHES_INO64_T 1
+#define __INO_T_MATCHES_INO64_T 1
/* And for __rlim_t and __rlim64_t. */
-# define __RLIM_T_MATCHES_RLIM64_T 1
+#define __RLIM_T_MATCHES_RLIM64_T 1
/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
-# define __STATFS_MATCHES_STATFS64 1
+#define __STATFS_MATCHES_STATFS64 1
/* And for getitimer, setitimer and rusage */
-# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
-#else
-# define __RLIM_T_MATCHES_RLIM64_T 0
-
-# define __STATFS_MATCHES_STATFS64 0
-
-/* And for getitimer, setitimer and rusage */
-# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
-#endif
+#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
# undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
#endif
-#ifndef __s390x__
-# define __ASSUME_SYSVIPC_BROKEN_MODE_T
-#endif
#undef __ASSUME_CLONE_DEFAULT
#define __ASSUME_CLONE_BACKWARDS2
<https://www.gnu.org/licenses/>. */
-int process_elf32_file (const char *file_name, const char *lib,
- int *flag, unsigned int *isa_level, char **soname,
- void *file_contents, size_t file_length);
int process_elf64_file (const char *file_name, const char *lib,
int *flag, unsigned int *isa_level, char **soname,
void *file_contents, size_t file_length);
unsigned int *isa_level, char **soname, void *file_contents,
size_t file_length)
{
- ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
- int ret;
-
- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
- return process_elf32_file (file_name, lib, flag, isa_level, soname,
- file_contents, file_length);
- else
- {
- ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
- file_contents, file_length);
- /* S/390 64bit libraries are always libc.so.6+. */
- if (!ret)
- *flag = FLAG_S390_LIB64|FLAG_ELF_LIBC6;
- return ret;
- }
+ int ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
+ file_contents, file_length);
+ /* S/390 64bit libraries are always libc.so.6+ which is already set
+ in process_elf64_file. */
+ if (!ret)
+ *flag |= FLAG_S390_LIB64;
+ return ret;
}
-#undef __ELF_NATIVE_CLASS
-#undef process_elf_file
-#define process_elf_file process_elf32_file
-#define __ELF_NATIVE_CLASS 32
-#include "elf/readelflib.c"
-
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
-# See Makeconfig regarding the use of default-abi.
-default-abi := 64
-
ifeq ($(subdir),misc)
sysdep_headers += sys/elf.h
endif
static inline uintptr_t
sigcontext_get_pc (const ucontext_t *ctx)
{
-#ifdef __s390x__
return ctx->uc_mcontext.psw.addr;
-#else
- return ctx->uc_mcontext.psw.addr & 0x7FFFFFFF;
-#endif
}
#endif
the register set is an array, we make gregset_t a simple array
that has the same size as s390_regs. This is needed for the
elf_prstatus structure. */
-#if __WORDSIZE == 64
-# define __NGREG 27
-#else
-# define __NGREG 36
-#endif
+#define __NGREG 27
#ifdef __USE_MISC
# define NGREG __NGREG
#endif
-/* Get system parameters, e.g. cache information. S390/S390x version.
+/* Get system parameters, e.g. cache information. S390x version.
Copyright (C) 2015-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
/* Check if ecag-instruction is available.
ecag - extract CPU attribute (only in zarch; arch >= z10; in as 2.24) */
- if (!(features->hwcap & HWCAP_S390_STFLE)
-#if !defined __s390x__
- || !(features->hwcap & HWCAP_S390_ZARCH)
- || !(features->hwcap & HWCAP_S390_HIGH_GPRS)
-#endif /* !__s390x__ */
- )
+ if (!(features->hwcap & HWCAP_S390_STFLE))
{
- /* stfle (or zarch, high-gprs on s390-32) is not available.
+ /* stfle is not available.
We are on an old machine. Return 256byte for LINESIZE for L1 d/i-cache,
otherwise 0. */
if (level == 1 && attr == CACHE_ATTR_LINESIZE)
arg = (CACHE_LEVEL_MAX - level) * 8;
__asm__ __volatile__ (".machine push\n\t"
".machine \"z10\"\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
"ecag %0,%%r0,0\n\t" /* returns 64bit unsigned integer. */
"srlg %0,%0,0(%1)\n\t" /* right align 8bit cache info field. */
".machine pop"
cmd = (attr << 4) | ((level - 1) << 1) | type;
__asm__ __volatile__ (".machine push\n\t"
".machine \"z10\"\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
"ecag %0,%%r0,0(%1)\n\t"
".machine pop"
: "=d" (val)
#define VDSO_HASH 123718585
/* List of system calls which are supported as vsyscalls. */
-#ifdef __s390x__
#define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
#define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
#define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom"
-#else
-#define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"
-#define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"
-#endif
#define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
#define HAVE_GETCPU_VSYSCALL "__kernel_getcpu"
/* Versions of the 'struct stat' data structure used in compatibility xstat
functions. */
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define _STAT_VER_KERNEL 0
-# define _STAT_VER_LINUX 1
-# define _MKNOD_VER_LINUX 0
-#else
-# define _STAT_VER_LINUX_OLD 1
-# define _STAT_VER_KERNEL 1
-# define _STAT_VER_SVR4 2
-# define _STAT_VER_LINUX 3
-# define _MKNOD_VER_LINUX 1
-# define _MKNOD_VER_SVR4 2
-#endif
+#define _STAT_VER_KERNEL 0
+#define _STAT_VER_LINUX 1
#define _STAT_VER _STAT_VER_LINUX
+
+/* Versions of the 'xmknod' interface used in compatibility xmknod
+ functions. */
+#define _MKNOD_VER_LINUX 0
#define _MKNOD_VER _MKNOD_VER_LINUX
/* Linux between 4.13 and 4.15 return EOVERFLOW for LFS OFD locks usage
in compat mode (non-LFS ABI running on a LFS default kernel, such as
- i386 on a x86_64 kernel or s390-32 on a s390-64 kernel) [1]. This is
- a kernel issue because __NR_fcntl64 is the expected way to use OFD locks
- (used on GLIBC for both fcntl and fcntl64).
+ i386 on a x86_64 kernel) [1]. This is a kernel issue because __NR_fcntl64
+ is the expected way to use OFD locks (used on GLIBC for both fcntl and
+ fcntl64).
[1] https://sourceware.org/ml/libc-alpha/2018-07/msg00243.html */
return r ?: stat_overflow (buf);
# else
/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
- microblaze, s390, sh, powerpc, and sparc32. */
+ microblaze, sh, powerpc, and sparc32. */
return INLINE_SYSCALL_CALL (stat, name, buf);
# endif
}
return INLINE_SYSCALL_CALL (fstatat64, AT_FDCWD, name, buf, 0);
# else
/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
- microblaze, s390, sh, mips32, powerpc32, and sparc32. */
+ microblaze, sh, mips32, powerpc32, and sparc32. */
return INLINE_SYSCALL_CALL (stat64, name, buf);
# endif /* STAT_IS_KERNEL_STAT */
#endif /* XSTAT_IS_XSTAT64 */