From: Stefan Liebler Date: Thu, 9 Apr 2026 08:47:07 +0000 (+0200) Subject: s390: Remove s390-32 specific code in non s390-32 specific files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b01debcd8f5229860b3224ea135b1b8456281cee;p=thirdparty%2Fglibc.git s390: Remove s390-32 specific code in non s390-32 specific files This patch removes s390-32 specific code in either common-code files or shared files between s390-64 and s390-32. Such code was guarded with preprocessor guards which check the size of __WORDSIZE or __ELF_NATIVE_CLASS and of course the existance of __s390x__ and __s390__ macros. Note, that if __s390x__ is defined then __s390__ is also defined. This patch also adjust guards for __s390__ only to __s390x__ to make clear that those are still needed. Futhermore the macro names for ifunc variants were adjusted from XYZ_Z900_G5 to XYZ_Z900 as G5 is a pre 64bit machine. On s390-32 we've used the special assembler directive to enable zarch instructions: .machinemode "zarch_nohighgprs" As this is not needed on s390-64 anymore as zarch is enabled by default, just drop those lines. Furthermore we do not check for HWCAP_S390_ZARCH and HWCAP_S390_HIGH_GPRS anymore. Just simplify those checks for e.g. stfle- or cuXY-instructions. The 32/64 abi-variants and the corresponding abi-conditions are now also removed from the s390 Makefiles and thus we now only generate a single gnu/stubs.h and gnu/lib-names.h file instead of also having the different ones for both abi-variants. After removing process_elf32_file in s390 readelflib.c, ldconfig is only recognizing 64bit ELF files for ld.so.cache. Various comments mentioning s390 (with meaning s390-32) were removed/adjusted. Reviewed-by: Adhemerval Zanella --- diff --git a/README b/README index 2e360eb70af..570b259de56 100644 --- a/README +++ b/README @@ -38,7 +38,6 @@ The GNU C Library supports these configurations for using Linux kernels: 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 diff --git a/elf/elf.h b/elf/elf.h index 46a01281cb0..3a60ef36b55 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -798,7 +798,8 @@ typedef struct #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 */ @@ -3470,7 +3471,9 @@ enum /* 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 */ diff --git a/intl/dcigettext.c b/intl/dcigettext.c index e70c938566b..9ebc54eeec4 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -72,7 +72,7 @@ extern int errno; /* 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 diff --git a/manual/math.texi b/manual/math.texi index fd7284953d3..cf579379434 100644 --- a/manual/math.texi +++ b/manual/math.texi @@ -70,7 +70,7 @@ provided for @code{_Float32}, @code{_Float64} and @code{_Float32x} on 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 diff --git a/stdlib/test-bz22786.c b/stdlib/test-bz22786.c index 242a3044db2..6e2636d896c 100644 --- a/stdlib/test-bz22786.c +++ b/stdlib/test-bz22786.c @@ -46,9 +46,7 @@ do_test (void) 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; } diff --git a/string/string-inlines.c b/string/string-inlines.c index 7de9ff6aa46..bab58c91a20 100644 --- a/string/string-inlines.c +++ b/string/string-inlines.c @@ -208,7 +208,7 @@ __old_strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3) } 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 diff --git a/support/support_readdir.c b/support/support_readdir.c index 6cb6b6bfcdd..793b7bc87eb 100644 --- a/support/support_readdir.c +++ b/support/support_readdir.c @@ -42,8 +42,8 @@ static int (*readdir64_r_compat) (DIR *, struct __old_dirent64 *, 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"); } diff --git a/sysdeps/s390/bits/link.h b/sysdeps/s390/bits/link.h index c9f6aab63ce..794d6ca286f 100644 --- a/sysdeps/s390/bits/link.h +++ b/sysdeps/s390/bits/link.h @@ -23,64 +23,6 @@ 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 { @@ -135,5 +77,3 @@ extern unsigned int la_s390_64_gnu_pltexit (Elf64_Sym *__sym, const char *__symname); __END_DECLS - -#endif diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/bits/setjmp.h index 4b87fe55a1e..3afa770bf78 100644 --- a/sysdeps/s390/bits/setjmp.h +++ b/sysdeps/s390/bits/setjmp.h @@ -33,13 +33,7 @@ typedef struct __s390_jmp_buf /* 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 diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index e3766aa8013..f4ec6626101 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -15,7 +15,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext void testvecinsn () { __asm__ (".machine \"z13\" \n\t" - ".machinemode \"zarch_nohighgprs\" \n\t" "vistrbs %%v16,%%v17 \n\t" "locghie %%r1,0" : :); } @@ -91,7 +90,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext 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" diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac index 4265bfd9f47..82e1a4445fd 100644 --- a/sysdeps/s390/configure.ac +++ b/sysdeps/s390/configure.ac @@ -6,7 +6,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ void testvecinsn () { __asm__ (".machine \"z13\" \n\t" - ".machinemode \"zarch_nohighgprs\" \n\t" "vistrbs %%v16,%%v17 \n\t" "locghie %%r1,0" : :); } @@ -43,7 +42,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 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" diff --git a/sysdeps/s390/cpu-features.c b/sysdeps/s390/cpu-features.c index 76e9079bd40..fd6f2357d51 100644 --- a/sysdeps/s390/cpu-features.c +++ b/sysdeps/s390/cpu-features.c @@ -170,15 +170,12 @@ init_cpu_features_no_tunables (struct cpu_features *cpu_features) 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]), diff --git a/sysdeps/s390/dl-tls.h b/sysdeps/s390/dl-tls.h index eff8cb61b30..4c4f8e7b44b 100644 --- a/sysdeps/s390/dl-tls.h +++ b/sysdeps/s390/dl-tls.h @@ -69,7 +69,6 @@ versioned_symbol (ld, __tls_get_addr_internal_tmp, 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\ @@ -79,20 +78,6 @@ __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) */ diff --git a/sysdeps/s390/fpu/fenv_private.h b/sysdeps/s390/fpu/fenv_private.h index fbefc7889cd..42eb94cd151 100644 --- a/sysdeps/s390/fpu/fenv_private.h +++ b/sysdeps/s390/fpu/fenv_private.h @@ -1,4 +1,4 @@ -/* 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. diff --git a/sysdeps/s390/fpu/s_llrint.c b/sysdeps/s390/fpu/s_llrint.c index ae628b30259..03937b79a9d 100644 --- a/sysdeps/s390/fpu/s_llrint.c +++ b/sysdeps/s390/fpu/s_llrint.c @@ -17,11 +17,7 @@ License along with the GNU C Library; if not, see . */ -#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 # include diff --git a/sysdeps/s390/fpu/s_llrintf.c b/sysdeps/s390/fpu/s_llrintf.c index b94705da42f..c3a8638c7c6 100644 --- a/sysdeps/s390/fpu/s_llrintf.c +++ b/sysdeps/s390/fpu/s_llrintf.c @@ -17,11 +17,7 @@ License along with the GNU C Library; if not, see . */ -#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 # include diff --git a/sysdeps/s390/fpu/s_llrintl.c b/sysdeps/s390/fpu/s_llrintl.c index 61938b67ee9..5c3c0536b00 100644 --- a/sysdeps/s390/fpu/s_llrintl.c +++ b/sysdeps/s390/fpu/s_llrintl.c @@ -17,11 +17,7 @@ License along with the GNU C Library; if not, see . */ -#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 # include # include diff --git a/sysdeps/s390/fpu/s_llround.c b/sysdeps/s390/fpu/s_llround.c index 0d598c4bd52..c625322384f 100644 --- a/sysdeps/s390/fpu/s_llround.c +++ b/sysdeps/s390/fpu/s_llround.c @@ -17,11 +17,7 @@ License along with the GNU C Library; if not, see . */ -#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 # include diff --git a/sysdeps/s390/fpu/s_llroundf.c b/sysdeps/s390/fpu/s_llroundf.c index 5b77705f1a6..cdea8fc4f33 100644 --- a/sysdeps/s390/fpu/s_llroundf.c +++ b/sysdeps/s390/fpu/s_llroundf.c @@ -17,11 +17,7 @@ License along with the GNU C Library; if not, see . */ -#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 # include diff --git a/sysdeps/s390/fpu/s_llroundl.c b/sysdeps/s390/fpu/s_llroundl.c index fff507979f7..39d533b36ca 100644 --- a/sysdeps/s390/fpu/s_llroundl.c +++ b/sysdeps/s390/fpu/s_llroundl.c @@ -17,11 +17,7 @@ License along with the GNU C Library; if not, see . */ -#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 # include # include diff --git a/sysdeps/s390/fpu/s_lrint.c b/sysdeps/s390/fpu/s_lrint.c index e6c0117dcad..6c99bab4b6a 100644 --- a/sysdeps/s390/fpu/s_lrint.c +++ b/sysdeps/s390/fpu/s_lrint.c @@ -21,15 +21,6 @@ # include # include -/* 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) { @@ -41,9 +32,9 @@ __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; diff --git a/sysdeps/s390/fpu/s_lrintf.c b/sysdeps/s390/fpu/s_lrintf.c index 9e489e9d63e..382836c4fbe 100644 --- a/sysdeps/s390/fpu/s_lrintf.c +++ b/sysdeps/s390/fpu/s_lrintf.c @@ -21,15 +21,6 @@ # include # include -/* 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) { @@ -41,9 +32,9 @@ __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; diff --git a/sysdeps/s390/fpu/s_lrintl.c b/sysdeps/s390/fpu/s_lrintl.c index 417e7bd4dc4..bf200a53c94 100644 --- a/sysdeps/s390/fpu/s_lrintl.c +++ b/sysdeps/s390/fpu/s_lrintl.c @@ -22,15 +22,6 @@ # include # include -/* 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) { @@ -42,9 +33,9 @@ __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; diff --git a/sysdeps/s390/fpu/s_lround.c b/sysdeps/s390/fpu/s_lround.c index db079c4aebd..09d203e0c3b 100644 --- a/sysdeps/s390/fpu/s_lround.c +++ b/sysdeps/s390/fpu/s_lround.c @@ -21,15 +21,6 @@ # include # include -/* 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) { @@ -37,7 +28,7 @@ __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) diff --git a/sysdeps/s390/fpu/s_lroundf.c b/sysdeps/s390/fpu/s_lroundf.c index 4be5a1e1a7d..80061d1ac89 100644 --- a/sysdeps/s390/fpu/s_lroundf.c +++ b/sysdeps/s390/fpu/s_lroundf.c @@ -21,15 +21,6 @@ # include # include -/* 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) { @@ -37,7 +28,7 @@ __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) diff --git a/sysdeps/s390/fpu/s_lroundl.c b/sysdeps/s390/fpu/s_lroundl.c index 046a71f60a7..0f8f486ed99 100644 --- a/sysdeps/s390/fpu/s_lroundl.c +++ b/sysdeps/s390/fpu/s_lroundl.c @@ -22,15 +22,6 @@ # include # include -/* 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) { @@ -38,7 +29,7 @@ __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) diff --git a/sysdeps/s390/ifunc-memchr.h b/sysdeps/s390/ifunc-memchr.h index a0ed7c54444..5dcf2850a6e 100644 --- a/sysdeps/s390/ifunc-memchr.h +++ b/sysdeps/s390/ifunc-memchr.h @@ -31,18 +31,18 @@ #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 diff --git a/sysdeps/s390/ifunc-memcmp.h b/sysdeps/s390/ifunc-memcmp.h index 8a21278a0f4..cb427978cdd 100644 --- a/sysdeps/s390/ifunc-memcmp.h +++ b/sysdeps/s390/ifunc-memcmp.h @@ -25,25 +25,25 @@ #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 diff --git a/sysdeps/s390/ifunc-memcpy.h b/sysdeps/s390/ifunc-memcpy.h index 91efab34285..48afc2c23a2 100644 --- a/sysdeps/s390/ifunc-memcpy.h +++ b/sysdeps/s390/ifunc-memcpy.h @@ -26,19 +26,19 @@ #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 @@ -79,12 +79,12 @@ # 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 diff --git a/sysdeps/s390/ifunc-memset.h b/sysdeps/s390/ifunc-memset.h index b0041d1a58f..569591c9cc1 100644 --- a/sysdeps/s390/ifunc-memset.h +++ b/sysdeps/s390/ifunc-memset.h @@ -25,17 +25,17 @@ #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 @@ -46,10 +46,10 @@ # 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 diff --git a/sysdeps/s390/ifunc-strcmp.h b/sysdeps/s390/ifunc-strcmp.h index 7d32d72b600..069827c4606 100644 --- a/sysdeps/s390/ifunc-strcmp.h +++ b/sysdeps/s390/ifunc-strcmp.h @@ -31,18 +31,18 @@ #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 diff --git a/sysdeps/s390/ifunc-strcpy.h b/sysdeps/s390/ifunc-strcpy.h index 919bd749230..9cd26f2f76f 100644 --- a/sysdeps/s390/ifunc-strcpy.h +++ b/sysdeps/s390/ifunc-strcpy.h @@ -31,18 +31,18 @@ #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 diff --git a/sysdeps/s390/ifunc-strncpy.h b/sysdeps/s390/ifunc-strncpy.h index de426e611ec..625b52a3aba 100644 --- a/sysdeps/s390/ifunc-strncpy.h +++ b/sysdeps/s390/ifunc-strncpy.h @@ -31,18 +31,18 @@ #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 diff --git a/sysdeps/s390/iso-8859-1_cp037_z900.c b/sysdeps/s390/iso-8859-1_cp037_z900.c index 3e7f131f15f..b38e9e6b407 100644 --- a/sysdeps/s390/iso-8859-1_cp037_z900.c +++ b/sysdeps/s390/iso-8859-1_cp037_z900.c @@ -169,12 +169,6 @@ __attribute__ ((aligned (8))) = #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 \ @@ -188,7 +182,7 @@ __attribute__ ((aligned (8))) = " 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) \ diff --git a/sysdeps/s390/jmpbuf-unwind.h b/sysdeps/s390/jmpbuf-unwind.h index 97dbb400782..3812c126a5e 100644 --- a/sysdeps/s390/jmpbuf-unwind.h +++ b/sysdeps/s390/jmpbuf-unwind.h @@ -30,8 +30,7 @@ ((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) \ diff --git a/sysdeps/s390/ldsodefs.h b/sysdeps/s390/ldsodefs.h index 0313b507745..6c4a999e33d 100644 --- a/sysdeps/s390/ldsodefs.h +++ b/sysdeps/s390/ldsodefs.h @@ -22,18 +22,10 @@ #include #include -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 *, \ @@ -42,11 +34,6 @@ struct La_s390_64_retval; 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 *, \ diff --git a/sysdeps/s390/linkmap.h b/sysdeps/s390/linkmap.h index 283615b99ae..faf0b96d3e3 100644 --- a/sysdeps/s390/linkmap.h +++ b/sysdeps/s390/linkmap.h @@ -1,13 +1,5 @@ -#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 */ +}; diff --git a/sysdeps/s390/memccpy-vx.S b/sysdeps/s390/memccpy-vx.S index 8008e374cee..648039d867c 100644 --- a/sysdeps/s390/memccpy-vx.S +++ b/sysdeps/s390/memccpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -46,11 +46,6 @@ */ 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. */ diff --git a/sysdeps/s390/memchr-vx.S b/sysdeps/s390/memchr-vx.S index e6c3ac4181d..86cd0291f79 100644 --- a/sysdeps/s390/memchr-vx.S +++ b/sysdeps/s390/memchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,13 +40,7 @@ -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. */ @@ -157,7 +151,7 @@ strong_alias (MEMCHR_Z13, __memchr) 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 diff --git a/sysdeps/s390/memchr-z900.S b/sysdeps/s390/memchr-z900.S index 16b9c19429f..c0ffd864f7c 100644 --- a/sysdeps/s390/memchr-z900.S +++ b/sysdeps/s390/memchr-z900.S @@ -1,4 +1,4 @@ -/* 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. @@ -25,51 +25,26 @@ #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 diff --git a/sysdeps/s390/memchr.c b/sysdeps/s390/memchr.c index 764a10a8395..8ddfaa03d4a 100644 --- a/sysdeps/s390/memchr.c +++ b/sysdeps/s390/memchr.c @@ -24,8 +24,8 @@ # undef memchr # include -# 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 diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S index 00ec2bba526..abdbcaa35e9 100644 --- a/sysdeps/s390/memcmp-z900.S +++ b/sysdeps/s390/memcmp-z900.S @@ -1,4 +1,4 @@ -/* 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. @@ -28,72 +28,38 @@ .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 @@ -123,10 +89,6 @@ END(MEMCMP_Z10) #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 diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c index b6f6faa2247..5ff55c80913 100644 --- a/sysdeps/s390/memcmp.c +++ b/sysdeps/s390/memcmp.c @@ -23,8 +23,8 @@ # undef memcmp # include -# 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 diff --git a/sysdeps/s390/memcopy.h b/sysdeps/s390/memcopy.h index 6ec81298d87..1eb8dc40578 100644 --- a/sysdeps/s390/memcopy.h +++ b/sysdeps/s390/memcopy.h @@ -18,6 +18,6 @@ #include -/* 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 diff --git a/sysdeps/s390/memcpy-z900.S b/sysdeps/s390/memcpy-z900.S index 037d2458163..3966585e83d 100644 --- a/sysdeps/s390/memcpy-z900.S +++ b/sysdeps/s390/memcpy-z900.S @@ -1,4 +1,4 @@ -/* 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. @@ -28,83 +28,49 @@ .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 @@ -112,20 +78,13 @@ ENTRY(__memcpy_mvcle) .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 @@ -133,12 +92,8 @@ END(MEMPCPY_Z10) 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 @@ -166,7 +121,6 @@ END(MEMCPY_Z10) #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 @@ -174,12 +128,8 @@ END(MEMPCPY_Z196) 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: @@ -220,13 +170,6 @@ END(MEMCPY_Z196) #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 @@ -289,13 +232,6 @@ END(MEMMOVE_Z13) #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 diff --git a/sysdeps/s390/memcpy.c b/sysdeps/s390/memcpy.c index 243f3a30460..cfad6cdcb46 100644 --- a/sysdeps/s390/memcpy.c +++ b/sysdeps/s390/memcpy.c @@ -24,8 +24,8 @@ # undef memcpy # include -# 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 diff --git a/sysdeps/s390/memmem-arch13.S b/sysdeps/s390/memmem-arch13.S index 227c6fecfb0..e8644713914 100644 --- a/sysdeps/s390/memmem-arch13.S +++ b/sysdeps/s390/memmem-arch13.S @@ -1,4 +1,4 @@ -/* 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. @@ -27,13 +27,6 @@ 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. */ diff --git a/sysdeps/s390/mempcpy.c b/sysdeps/s390/mempcpy.c index 43604948e77..49f01b0575e 100644 --- a/sysdeps/s390/mempcpy.c +++ b/sysdeps/s390/mempcpy.c @@ -28,8 +28,8 @@ # undef __mempcpy # include -# 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 diff --git a/sysdeps/s390/memrchr-vx.S b/sysdeps/s390/memrchr-vx.S index 53ca78ae245..7b65479777b 100644 --- a/sysdeps/s390/memrchr-vx.S +++ b/sysdeps/s390/memrchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -44,11 +44,7 @@ */ 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. diff --git a/sysdeps/s390/memset-z900.S b/sysdeps/s390/memset-z900.S index 987589988bc..646ea9b33da 100644 --- a/sysdeps/s390/memset-z900.S +++ b/sysdeps/s390/memset-z900.S @@ -1,4 +1,4 @@ -/* 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. @@ -28,75 +28,39 @@ .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 @@ -126,10 +90,6 @@ END(MEMSET_Z10) 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) diff --git a/sysdeps/s390/memset.c b/sysdeps/s390/memset.c index 1eb6dcb007d..25ed9af6608 100644 --- a/sysdeps/s390/memset.c +++ b/sysdeps/s390/memset.c @@ -23,8 +23,8 @@ # undef memset # include -# 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 diff --git a/sysdeps/s390/multiarch/8bit-generic.c b/sysdeps/s390/multiarch/8bit-generic.c index 10edde66414..8224cec5571 100644 --- a/sysdeps/s390/multiarch/8bit-generic.c +++ b/sysdeps/s390/multiarch/8bit-generic.c @@ -88,7 +88,6 @@ 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. */ \ @@ -226,7 +225,6 @@ (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: > */ \ @@ -288,7 +286,6 @@ 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. */ \ diff --git a/sysdeps/s390/multiarch/gconv_simple.c b/sysdeps/s390/multiarch/gconv_simple.c index a6548d6d412..35a56994041 100644 --- a/sysdeps/s390/multiarch/gconv_simple.c +++ b/sysdeps/s390/multiarch/gconv_simple.c @@ -77,11 +77,6 @@ # 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 @@ -125,8 +120,6 @@ 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" \ @@ -257,8 +250,6 @@ ICONV_VX_IFUNC (__gconv_transform_ascii_internal) 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" \ @@ -414,8 +405,6 @@ ICONV_VX_NAME (internal_ucs4le_loop) (struct __gconv_step *step, 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" @@ -517,8 +506,6 @@ ICONV_VX_NAME (ucs4_internal_loop) (struct __gconv_step *step, 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" @@ -644,8 +631,6 @@ ICONV_VX_NAME (ucs4le_internal_loop) (struct __gconv_step *step, 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" @@ -783,8 +768,6 @@ ICONV_VX_IFUNC (__gconv_transform_ucs4le_internal) 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" \ @@ -907,8 +890,6 @@ ICONV_VX_IFUNC (__gconv_transform_ucs2_internal) 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" \ @@ -1051,8 +1032,6 @@ ICONV_VX_IFUNC (__gconv_transform_ucs2reverse_internal) 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" \ @@ -1183,8 +1162,6 @@ ICONV_VX_IFUNC (__gconv_transform_internal_ucs2) 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" \ diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c index e948b975303..6e9799891af 100644 --- a/sysdeps/s390/multiarch/ifunc-impl-list.c +++ b/sysdeps/s390/multiarch/ifunc-impl-list.c @@ -1,4 +1,4 @@ -/* 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. @@ -94,8 +94,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ @@ -110,8 +110,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ @@ -126,8 +126,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 ) @@ -140,8 +140,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ @@ -226,8 +226,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ @@ -250,8 +250,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ @@ -298,8 +298,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ @@ -394,8 +394,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, 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 */ diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h index c6cb8fa97c9..a66669e1d73 100644 --- a/sysdeps/s390/multiarch/ifunc-resolve.h +++ b/sysdeps/s390/multiarch/ifunc-resolve.h @@ -1,5 +1,5 @@ /* 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. diff --git a/sysdeps/s390/multiarch/utf8-utf16-z9.c b/sysdeps/s390/multiarch/utf8-utf16-z9.c index dbc2b5b976a..21538139573 100644 --- a/sysdeps/s390/multiarch/utf8-utf16-z9.c +++ b/sysdeps/s390/multiarch/utf8-utf16-z9.c @@ -34,9 +34,7 @@ strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP)) 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); diff --git a/sysdeps/s390/multiarch/utf8-utf32-z9.c b/sysdeps/s390/multiarch/utf8-utf32-z9.c index 06d7e66f9e1..94f0767832f 100644 --- a/sysdeps/s390/multiarch/utf8-utf32-z9.c +++ b/sysdeps/s390/multiarch/utf8-utf32-z9.c @@ -34,9 +34,7 @@ strong_alias (SINGLE_NAME (TO_LOOP_DEFAULT), SINGLE_NAME (TO_LOOP)) 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); diff --git a/sysdeps/s390/nptl/bits/struct_mutex.h b/sysdeps/s390/nptl/bits/struct_mutex.h index 571265267c2..ff2d251986c 100644 --- a/sysdeps/s390/nptl/bits/struct_mutex.h +++ b/sysdeps/s390/nptl/bits/struct_mutex.h @@ -24,39 +24,17 @@ struct __pthread_mutex_s 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 diff --git a/sysdeps/s390/nptl/bits/struct_rwlock.h b/sysdeps/s390/nptl/bits/struct_rwlock.h index ee49a9632d6..ed1235b0616 100644 --- a/sysdeps/s390/nptl/bits/struct_rwlock.h +++ b/sysdeps/s390/nptl/bits/struct_rwlock.h @@ -28,7 +28,6 @@ struct __pthread_rwlock_arch_t unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; -#if __WORDSIZE == 64 int __cur_writer; int __shared; unsigned long int __pad1; @@ -36,23 +35,9 @@ struct __pthread_rwlock_arch_t /* 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 diff --git a/sysdeps/s390/nptl/pthread-offsets.h b/sysdeps/s390/nptl/pthread-offsets.h index 9e2112120b6..f8e4469f7ea 100644 --- a/sysdeps/s390/nptl/pthread-offsets.h +++ b/sysdeps/s390/nptl/pthread-offsets.h @@ -1,13 +1,2 @@ -#include - -#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 diff --git a/sysdeps/s390/nptl/tls.h b/sysdeps/s390/nptl/tls.h index 9870e54327d..de7e9c64828 100644 --- a/sysdeps/s390/nptl/tls.h +++ b/sysdeps/s390/nptl/tls.h @@ -44,10 +44,6 @@ typedef struct void *__private_ss; } tcbhead_t; -# ifndef __s390x__ -# define TLS_MULTIPLE_THREADS_IN_TCB 1 -# endif - #else /* __ASSEMBLER__ */ # include #endif diff --git a/sysdeps/s390/rawmemchr-vx.S b/sysdeps/s390/rawmemchr-vx.S index e74c63f6e41..4bf4e4bdda5 100644 --- a/sysdeps/s390/rawmemchr-vx.S +++ b/sysdeps/s390/rawmemchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -41,7 +41,6 @@ */ 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. */ diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h index 00e88b06282..b263c3141ba 100644 --- a/sysdeps/s390/s390-64/bits/wordsize.h +++ b/sysdeps/s390/s390-64/bits/wordsize.h @@ -1,11 +1,4 @@ /* 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 diff --git a/sysdeps/s390/s390-64/stackguard-macros.h b/sysdeps/s390/s390-64/stackguard-macros.h index 2c97d3824f4..3671c7cd7a1 100644 --- a/sysdeps/s390/s390-64/stackguard-macros.h +++ b/sysdeps/s390/s390-64/stackguard-macros.h @@ -3,7 +3,7 @@ #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 \ ({ \ diff --git a/sysdeps/s390/s390-64/strncpy-z900.S b/sysdeps/s390/s390-64/strncpy-z900.S index 579e1217315..6d954cf4024 100644 --- a/sysdeps/s390/s390-64/strncpy-z900.S +++ b/sysdeps/s390/s390-64/strncpy-z900.S @@ -26,8 +26,8 @@ #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 @@ -87,13 +87,13 @@ ENTRY(STRNCPY_Z900_G5) 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 diff --git a/sysdeps/s390/sotruss-lib.c b/sysdeps/s390/sotruss-lib.c index 4b0194ab0aa..ff6ebf7a432 100644 --- a/sysdeps/s390/sotruss-lib.c +++ b/sysdeps/s390/sotruss-lib.c @@ -22,24 +22,12 @@ #include -#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); @@ -51,10 +39,11 @@ la_s390_gnu_pltenter (ElfW(Sym) *sym, } 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); diff --git a/sysdeps/s390/stpcpy-vx.S b/sysdeps/s390/stpcpy-vx.S index 02c8e456175..8184fd3bc4b 100644 --- a/sysdeps/s390/stpcpy-vx.S +++ b/sysdeps/s390/stpcpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,7 +40,6 @@ */ 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. */ diff --git a/sysdeps/s390/stpncpy-vx.S b/sysdeps/s390/stpncpy-vx.S index 739bf7ebce2..46a82e71b03 100644 --- a/sysdeps/s390/stpncpy-vx.S +++ b/sysdeps/s390/stpncpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -42,11 +42,6 @@ */ 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. */ diff --git a/sysdeps/s390/strcat-vx.S b/sysdeps/s390/strcat-vx.S index 434c78ca4af..0f36c8de8a1 100644 --- a/sysdeps/s390/strcat-vx.S +++ b/sysdeps/s390/strcat-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,7 +40,6 @@ */ ENTRY(STRCAT_Z13) .machine "z13" - .machinemode "zarch_nohighgprs" lgr %r0,%r2 /* Save destination pointer for return. */ diff --git a/sysdeps/s390/strchr-vx.S b/sysdeps/s390/strchr-vx.S index f263f51bb7c..4544c85592c 100644 --- a/sysdeps/s390/strchr-vx.S +++ b/sysdeps/s390/strchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,7 +40,6 @@ */ 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. */ diff --git a/sysdeps/s390/strchrnul-vx.S b/sysdeps/s390/strchrnul-vx.S index 4a648190a5a..485be32b043 100644 --- a/sysdeps/s390/strchrnul-vx.S +++ b/sysdeps/s390/strchrnul-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -39,7 +39,6 @@ */ 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. */ diff --git a/sysdeps/s390/strcmp-vx.S b/sysdeps/s390/strcmp-vx.S index fda693002d8..2fe013cb821 100644 --- a/sysdeps/s390/strcmp-vx.S +++ b/sysdeps/s390/strcmp-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -39,7 +39,6 @@ */ ENTRY(STRCMP_Z13) .machine "z13" - .machinemode "zarch_nohighgprs" lghi %r5,0 /* current_len = 0. */ @@ -113,7 +112,7 @@ END(STRCMP_Z13) 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 diff --git a/sysdeps/s390/strcmp-z900.S b/sysdeps/s390/strcmp-z900.S index 2404cdc3c01..07ad1fbdf5e 100644 --- a/sysdeps/s390/strcmp-z900.S +++ b/sysdeps/s390/strcmp-z900.S @@ -24,35 +24,27 @@ #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 diff --git a/sysdeps/s390/strcmp.c b/sysdeps/s390/strcmp.c index 2dbffb13c9c..9ed3abee194 100644 --- a/sysdeps/s390/strcmp.c +++ b/sysdeps/s390/strcmp.c @@ -26,8 +26,8 @@ # include # 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 diff --git a/sysdeps/s390/strcpy-vx.S b/sysdeps/s390/strcpy-vx.S index 2ddc96ed0b7..7cc6dd8f689 100644 --- a/sysdeps/s390/strcpy-vx.S +++ b/sysdeps/s390/strcpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -38,7 +38,6 @@ */ 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. */ @@ -103,7 +102,7 @@ END(STRCPY_Z13) 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 diff --git a/sysdeps/s390/strcpy-z900.S b/sysdeps/s390/strcpy-z900.S index 39f72381524..a34cb56b9a8 100644 --- a/sysdeps/s390/strcpy-z900.S +++ b/sysdeps/s390/strcpy-z900.S @@ -1,4 +1,4 @@ -/* 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. @@ -24,32 +24,21 @@ #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 diff --git a/sysdeps/s390/strcpy.c b/sysdeps/s390/strcpy.c index a307a5f3701..daede82f3f6 100644 --- a/sysdeps/s390/strcpy.c +++ b/sysdeps/s390/strcpy.c @@ -24,8 +24,8 @@ # undef strcpy # include -# 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 diff --git a/sysdeps/s390/strcspn-vx.S b/sysdeps/s390/strcspn-vx.S index 7a825131dd0..e28f738d6cb 100644 --- a/sysdeps/s390/strcspn-vx.S +++ b/sysdeps/s390/strcspn-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -62,7 +62,6 @@ */ ENTRY(STRCSPN_Z13) .machine "z13" - .machinemode "zarch_nohighgprs" /* Check if reject-string fits in one vreg: diff --git a/sysdeps/s390/strlen-vx.S b/sysdeps/s390/strlen-vx.S index e4bbcd4500a..99f71f1e22b 100644 --- a/sysdeps/s390/strlen-vx.S +++ b/sysdeps/s390/strlen-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -37,7 +37,6 @@ */ 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. */ diff --git a/sysdeps/s390/strncat-vx.S b/sysdeps/s390/strncat-vx.S index 02b2022cbc0..53e80a49c11 100644 --- a/sysdeps/s390/strncat-vx.S +++ b/sysdeps/s390/strncat-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -43,11 +43,6 @@ */ 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. */ diff --git a/sysdeps/s390/strncmp-vx.S b/sysdeps/s390/strncmp-vx.S index 332dd4593e4..a334bdfca16 100644 --- a/sysdeps/s390/strncmp-vx.S +++ b/sysdeps/s390/strncmp-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -41,11 +41,6 @@ */ 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. */ diff --git a/sysdeps/s390/strncpy-vx.S b/sysdeps/s390/strncpy-vx.S index 76155bf8c4d..9d65d4ebe7b 100644 --- a/sysdeps/s390/strncpy-vx.S +++ b/sysdeps/s390/strncpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -42,11 +42,6 @@ */ 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. */ @@ -202,7 +197,7 @@ END(STRNCPY_Z13) 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 diff --git a/sysdeps/s390/strncpy.c b/sysdeps/s390/strncpy.c index b7ace482a56..986f00a0f40 100644 --- a/sysdeps/s390/strncpy.c +++ b/sysdeps/s390/strncpy.c @@ -26,8 +26,8 @@ # undef strncpy # include -# 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 diff --git a/sysdeps/s390/strnlen-vx.S b/sysdeps/s390/strnlen-vx.S index db1bda229fc..29e3353d5a1 100644 --- a/sysdeps/s390/strnlen-vx.S +++ b/sysdeps/s390/strnlen-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -38,11 +38,6 @@ */ 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 diff --git a/sysdeps/s390/strpbrk-vx.S b/sysdeps/s390/strpbrk-vx.S index 8fb6963be2e..6bf12134182 100644 --- a/sysdeps/s390/strpbrk-vx.S +++ b/sysdeps/s390/strpbrk-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -63,7 +63,6 @@ */ ENTRY(STRPBRK_Z13) .machine "z13" - .machinemode "zarch_nohighgprs" /* Check if accept-string fits in one vreg: diff --git a/sysdeps/s390/strrchr-vx.S b/sysdeps/s390/strrchr-vx.S index ed2342c9e30..219c6d59ceb 100644 --- a/sysdeps/s390/strrchr-vx.S +++ b/sysdeps/s390/strrchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -43,7 +43,6 @@ */ 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. */ diff --git a/sysdeps/s390/strspn-vx.S b/sysdeps/s390/strspn-vx.S index aa985de110d..67de8883951 100644 --- a/sysdeps/s390/strspn-vx.S +++ b/sysdeps/s390/strspn-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -61,7 +61,6 @@ */ ENTRY(STRSPN_Z13) .machine "z13" - .machinemode "zarch_nohighgprs" /* Check if accept-string fits in one vreg: diff --git a/sysdeps/s390/strstr-arch13.S b/sysdeps/s390/strstr-arch13.S index 10875acad69..acf47928ba9 100644 --- a/sysdeps/s390/strstr-arch13.S +++ b/sysdeps/s390/strstr-arch13.S @@ -1,4 +1,4 @@ -/* 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. @@ -26,7 +26,6 @@ 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. */ diff --git a/sysdeps/s390/tst-dl-runtime-mod.S b/sysdeps/s390/tst-dl-runtime-mod.S index 6090d21a975..58feb144506 100644 --- a/sysdeps/s390/tst-dl-runtime-mod.S +++ b/sysdeps/s390/tst-dl-runtime-mod.S @@ -20,11 +20,7 @@ .type r0x2, @function r0x2: .cfi_startproc -#if defined (__s390x__) agr %r0,%r0 -#else - ar %r0,%r0 -#endif br %r14 .cfi_endproc .size r0x2, .-r0x2 diff --git a/sysdeps/s390/tst-dl-runtime.c b/sysdeps/s390/tst-dl-runtime.c index 3b2fc3093e3..49087ef5e0c 100644 --- a/sysdeps/s390/tst-dl-runtime.c +++ b/sysdeps/s390/tst-dl-runtime.c @@ -22,11 +22,7 @@ #include #include -#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); @@ -35,7 +31,6 @@ 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" @@ -44,28 +39,6 @@ asm (" .type r0x2_trampoline, @function\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 diff --git a/sysdeps/s390/utf16-utf32-z9.c b/sysdeps/s390/utf16-utf32-z9.c index ceba2fad5e2..68d256a7b25 100644 --- a/sysdeps/s390/utf16-utf32-z9.c +++ b/sysdeps/s390/utf16-utf32-z9.c @@ -49,12 +49,6 @@ # 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 @@ -256,12 +250,9 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -402,12 +393,9 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -572,12 +560,9 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -712,12 +697,9 @@ gconv_end (struct __gconv_step *data) 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" \ diff --git a/sysdeps/s390/utf8-utf16-z9.c b/sysdeps/s390/utf8-utf16-z9.c index 1c43f5b2215..1bc52e5833e 100644 --- a/sysdeps/s390/utf8-utf16-z9.c +++ b/sysdeps/s390/utf8-utf16-z9.c @@ -59,12 +59,6 @@ # 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 @@ -176,7 +170,6 @@ gconv_end (struct __gconv_step *data) \ __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" \ @@ -247,11 +240,8 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -636,12 +626,9 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -823,12 +810,9 @@ gconv_end (struct __gconv_step *data) 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" \ diff --git a/sysdeps/s390/utf8-utf32-z9.c b/sysdeps/s390/utf8-utf32-z9.c index a5bf48e4994..c1708772c6d 100644 --- a/sysdeps/s390/utf8-utf32-z9.c +++ b/sysdeps/s390/utf8-utf32-z9.c @@ -59,12 +59,6 @@ # 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 @@ -176,7 +170,6 @@ gconv_end (struct __gconv_step *data) \ __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" \ @@ -480,11 +473,8 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -691,13 +681,10 @@ gconv_end (struct __gconv_step *data) 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" \ @@ -869,13 +856,10 @@ gconv_end (struct __gconv_step *data) 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" \ diff --git a/sysdeps/s390/wcpcpy-vx.S b/sysdeps/s390/wcpcpy-vx.S index 98c9d090645..ee509ab8d04 100644 --- a/sysdeps/s390/wcpcpy-vx.S +++ b/sysdeps/s390/wcpcpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,7 +40,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcpncpy-vx.S b/sysdeps/s390/wcpncpy-vx.S index 097eee96786..69817aa97d2 100644 --- a/sysdeps/s390/wcpncpy-vx.S +++ b/sysdeps/s390/wcpncpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -41,11 +41,6 @@ */ 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. */ @@ -62,13 +57,8 @@ ENTRY(WCPNCPY_Z13) 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. */ diff --git a/sysdeps/s390/wcscat-vx.S b/sysdeps/s390/wcscat-vx.S index 0feb4797e66..a7ec6d50b5e 100644 --- a/sysdeps/s390/wcscat-vx.S +++ b/sysdeps/s390/wcscat-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,7 +40,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcschr-vx.S b/sysdeps/s390/wcschr-vx.S index dd4ca46d9ac..af3f5cf8492 100644 --- a/sysdeps/s390/wcschr-vx.S +++ b/sysdeps/s390/wcschr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -39,7 +39,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcschrnul-vx.S b/sysdeps/s390/wcschrnul-vx.S index 9d1d0b36708..0107fd5a669 100644 --- a/sysdeps/s390/wcschrnul-vx.S +++ b/sysdeps/s390/wcschrnul-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -38,7 +38,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcscmp-vx.S b/sysdeps/s390/wcscmp-vx.S index 39d62412d5b..25f992e75c5 100644 --- a/sysdeps/s390/wcscmp-vx.S +++ b/sysdeps/s390/wcscmp-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -39,7 +39,6 @@ */ ENTRY(WCSCMP_Z13) .machine "z13" - .machinemode "zarch_nohighgprs" lghi %r5,0 /* current_len = 0. */ diff --git a/sysdeps/s390/wcscpy-vx.S b/sysdeps/s390/wcscpy-vx.S index 718fb2f9e1b..2aa266d2ef3 100644 --- a/sysdeps/s390/wcscpy-vx.S +++ b/sysdeps/s390/wcscpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,7 +40,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcscspn-vx.S b/sysdeps/s390/wcscspn-vx.S index b5b910f8bf6..3a6fcb6e1bd 100644 --- a/sysdeps/s390/wcscspn-vx.S +++ b/sysdeps/s390/wcscspn-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -60,7 +60,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcslen-vx.S b/sysdeps/s390/wcslen-vx.S index 29a91315215..cd4459ac82f 100644 --- a/sysdeps/s390/wcslen-vx.S +++ b/sysdeps/s390/wcslen-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -37,7 +37,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcsncat-vx.S b/sysdeps/s390/wcsncat-vx.S index 91d2a9b89de..155459dd5e2 100644 --- a/sysdeps/s390/wcsncat-vx.S +++ b/sysdeps/s390/wcsncat-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -43,11 +43,6 @@ */ 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. */ @@ -123,13 +118,8 @@ ENTRY(WCSNCAT_Z13) 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. */ diff --git a/sysdeps/s390/wcsncmp-vx.S b/sysdeps/s390/wcsncmp-vx.S index f01fcc56a66..3fb37560596 100644 --- a/sysdeps/s390/wcsncmp-vx.S +++ b/sysdeps/s390/wcsncmp-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,22 +40,12 @@ */ 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. */ diff --git a/sysdeps/s390/wcsncpy-vx.S b/sysdeps/s390/wcsncpy-vx.S index c1d6732e878..afe14951853 100644 --- a/sysdeps/s390/wcsncpy-vx.S +++ b/sysdeps/s390/wcsncpy-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -43,11 +43,6 @@ */ 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. */ @@ -66,13 +61,8 @@ ENTRY(WCSNCPY_Z13) 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. */ diff --git a/sysdeps/s390/wcsnlen-vx.S b/sysdeps/s390/wcsnlen-vx.S index bfff0ba2a43..d57b3bb5b31 100644 --- a/sysdeps/s390/wcsnlen-vx.S +++ b/sysdeps/s390/wcsnlen-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -38,11 +38,6 @@ 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 @@ -56,13 +51,8 @@ ENTRY(WCSNLEN_Z13) 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. */ diff --git a/sysdeps/s390/wcspbrk-vx.S b/sysdeps/s390/wcspbrk-vx.S index d1c0b2b47db..d97b2c02f1e 100644 --- a/sysdeps/s390/wcspbrk-vx.S +++ b/sysdeps/s390/wcspbrk-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -62,7 +62,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcsrchr-vx.S b/sysdeps/s390/wcsrchr-vx.S index 9e5f4ceea3e..4e9934f01e1 100644 --- a/sysdeps/s390/wcsrchr-vx.S +++ b/sysdeps/s390/wcsrchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -42,7 +42,6 @@ */ 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. */ diff --git a/sysdeps/s390/wcsspn-vx.S b/sysdeps/s390/wcsspn-vx.S index 81d7ccb1017..bdd316950d7 100644 --- a/sysdeps/s390/wcsspn-vx.S +++ b/sysdeps/s390/wcsspn-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -60,7 +60,6 @@ */ 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. */ diff --git a/sysdeps/s390/wmemchr-vx.S b/sysdeps/s390/wmemchr-vx.S index 6882395ce76..2040ee8ebae 100644 --- a/sysdeps/s390/wmemchr-vx.S +++ b/sysdeps/s390/wmemchr-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -41,11 +41,6 @@ */ 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. */ @@ -61,13 +56,8 @@ ENTRY(WMEMCHR_Z13) 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. */ diff --git a/sysdeps/s390/wmemcmp-vx.S b/sysdeps/s390/wmemcmp-vx.S index 3d07b815a09..6a2997d74b5 100644 --- a/sysdeps/s390/wmemcmp-vx.S +++ b/sysdeps/s390/wmemcmp-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -40,21 +40,11 @@ */ 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. */ diff --git a/sysdeps/s390/wmemset-vx.S b/sysdeps/s390/wmemset-vx.S index 4f3661297ce..f7ab5dd8c70 100644 --- a/sysdeps/s390/wmemset-vx.S +++ b/sysdeps/s390/wmemset-vx.S @@ -1,4 +1,4 @@ -/* 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. @@ -41,11 +41,6 @@ */ 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 @@ -54,13 +49,8 @@ ENTRY(WMEMSET_Z13) 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. */ diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c index 2b45a31c2d1..a034345ee37 100644 --- a/sysdeps/unix/sysv/linux/fxstat.c +++ b/sysdeps/unix/sysv/linux/fxstat.c @@ -43,7 +43,7 @@ __fxstat (int vers, int fd, struct stat *buf) 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 } diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c index 8f4dcdd3a96..12d743f61e6 100644 --- a/sysdeps/unix/sysv/linux/fxstatat.c +++ b/sysdeps/unix/sysv/linux/fxstatat.c @@ -43,7 +43,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) 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); diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h index 24f6867e0ed..2b75a49b1ea 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -48,8 +48,8 @@ struct __old_ipc_perm #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) diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 94bdbbb730a..85f6e888dba 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -155,7 +155,7 @@ 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. */ diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c index a65e2715a83..6efe1698bc7 100644 --- a/sysdeps/unix/sysv/linux/lxstat.c +++ b/sysdeps/unix/sysv/linux/lxstat.c @@ -44,7 +44,7 @@ __lxstat (int vers, const char *name, struct stat *buf) 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 } diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c index 22b0bedbf12..e743aaec4aa 100644 --- a/sysdeps/unix/sysv/linux/lxstat64.c +++ b/sysdeps/unix/sysv/linux/lxstat64.c @@ -75,7 +75,7 @@ ___lxstat64 (int vers, const char *name, struct stat64 *buf) 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 */ diff --git a/sysdeps/unix/sysv/linux/posix_fadvise.c b/sysdeps/unix/sysv/linux/posix_fadvise.c index b62cf8c002a..01c450de31e 100644 --- a/sysdeps/unix/sysv/linux/posix_fadvise.c +++ b/sysdeps/unix/sysv/linux/posix_fadvise.c @@ -32,11 +32,7 @@ __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) diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c index 56748fd7fe9..b19b5deb560 100644 --- a/sysdeps/unix/sysv/linux/posix_fadvise64.c +++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c @@ -25,11 +25,7 @@ libc_hidden_proto (__posix_fadvise64_l64) /* 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 diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile index d5433f1dd9a..218aff1aeed 100644 --- a/sysdeps/unix/sysv/linux/s390/Makefile +++ b/sysdeps/unix/sysv/linux/s390/Makefile @@ -1,7 +1,3 @@ -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 diff --git a/sysdeps/unix/sysv/linux/s390/bits/elfclass.h b/sysdeps/unix/sysv/linux/s390/bits/elfclass.h index 723aa1189aa..59de7fbef6a 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/elfclass.h +++ b/sysdeps/unix/sysv/linux/s390/bits/elfclass.h @@ -27,11 +27,6 @@ #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 diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h index 75ea4e23c6e..0531f13efd6 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h @@ -22,29 +22,20 @@ #include -#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. */ }; @@ -59,13 +50,8 @@ struct flock64 }; #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 diff --git a/sysdeps/unix/sysv/linux/s390/bits/sigaction.h b/sysdeps/unix/sysv/linux/s390/bits/sigaction.h index 7f761808dcf..19cdb14c328 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/s390/bits/sigaction.h @@ -1,4 +1,4 @@ -/* 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. @@ -23,9 +23,6 @@ # error "Never include directly; use instead." #endif -#include - -#if __WORDSIZE == 64 /* Structure describing the action to be taken when a signal arrives. */ struct sigaction { @@ -55,36 +52,6 @@ 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. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h index e98192d7ef1..f6a3a785a1d 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h @@ -25,7 +25,6 @@ #include -#if __WORDSIZE == 64 struct stat { __dev_t st_dev; /* Device. */ @@ -62,70 +61,8 @@ struct stat __blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */ long int __glibc_reserved[3]; }; -#else -struct stat - { -# ifdef __USE_TIME64_REDIRECTS -# include -# 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 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 { @@ -138,7 +75,7 @@ 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 @@ -148,66 +85,21 @@ struct stat64 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 -# 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 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. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index 826a1e425c1..6e2be2270f3 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -57,42 +57,34 @@ #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 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index a955c18738a..d7af29285fc 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -47,9 +47,6 @@ # 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 diff --git a/sysdeps/unix/sysv/linux/s390/readelflib.c b/sysdeps/unix/sysv/linux/s390/readelflib.c index 6229b705d22..87e900f5365 100644 --- a/sysdeps/unix/sysv/linux/s390/readelflib.c +++ b/sysdeps/unix/sysv/linux/s390/readelflib.c @@ -16,9 +16,6 @@ . */ -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); @@ -29,29 +26,15 @@ process_elf_file (const char *file_name, const char *lib, int *flag, 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 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/Makefile b/sysdeps/unix/sysv/linux/s390/s390-64/Makefile index 67957347473..0c338cba365 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/Makefile +++ b/sysdeps/unix/sysv/linux/s390/s390-64/Makefile @@ -1,6 +1,3 @@ -# See Makeconfig regarding the use of default-abi. -default-abi := 64 - ifeq ($(subdir),misc) sysdep_headers += sys/elf.h endif diff --git a/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h b/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h index 08679ffc82b..ac1fc28dc3e 100644 --- a/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h +++ b/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h @@ -23,11 +23,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h index 1d4d979b6c1..3bbddd08bac 100644 --- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h +++ b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h @@ -45,11 +45,7 @@ typedef unsigned long greg_t; 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 diff --git a/sysdeps/unix/sysv/linux/s390/sysconf.c b/sysdeps/unix/sysv/linux/s390/sysconf.c index 7083b637370..57ccaed4e39 100644 --- a/sysdeps/unix/sysv/linux/s390/sysconf.c +++ b/sysdeps/unix/sysv/linux/s390/sysconf.c @@ -1,4 +1,4 @@ -/* 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. @@ -50,14 +50,9 @@ get_cache_info (int level, int attr, int type) /* 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) @@ -81,7 +76,6 @@ get_cache_info (int level, int attr, int type) 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" @@ -97,7 +91,6 @@ get_cache_info (int level, int attr, int type) 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) diff --git a/sysdeps/unix/sysv/linux/s390/sysdep.h b/sysdeps/unix/sysv/linux/s390/sysdep.h index ee2d92edff1..593e70dc1ea 100644 --- a/sysdeps/unix/sysv/linux/s390/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/sysdep.h @@ -69,14 +69,9 @@ #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" diff --git a/sysdeps/unix/sysv/linux/s390/xstatver.h b/sysdeps/unix/sysv/linux/s390/xstatver.h index 9923199e407..f24ab4a9ee1 100644 --- a/sysdeps/unix/sysv/linux/s390/xstatver.h +++ b/sysdeps/unix/sysv/linux/s390/xstatver.h @@ -1,19 +1,10 @@ /* Versions of the 'struct stat' data structure used in compatibility xstat functions. */ - -#include - -#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 diff --git a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c index f9cdde32228..0947fff1576 100644 --- a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c +++ b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c @@ -41,9 +41,9 @@ do_prepare (int argc, char **argv) /* 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 */ diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c index a67139cafaa..33863c3cb7a 100644 --- a/sysdeps/unix/sysv/linux/xstat.c +++ b/sysdeps/unix/sysv/linux/xstat.c @@ -43,7 +43,7 @@ __xstat (int vers, const char *name, struct stat *buf) 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 } diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c index 8baa8214bcb..7d513e4af0d 100644 --- a/sysdeps/unix/sysv/linux/xstat64.c +++ b/sysdeps/unix/sysv/linux/xstat64.c @@ -72,7 +72,7 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf) 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 */