[PATCH 0/2] Remove some i386 system call optimizations
H.J. Lu
hjl.tools@gmail.com
Tue Jan 11 20:30:58 GMT 2022
On Tue, Jan 11, 2022 at 6:00 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Jan 11, 2022 at 2:05 AM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we
> > used it to switch away from using %ebx in assembler constraints, but
> > this appears to be no longer necessary.
>
> This GCC bug has been fixed in GCC 5 as seen in
>
> commit 021478683cc091de9902d297a7b161f8343ffb6a
> Author: Uros Bizjak <uros@gcc.gnu.org>
> Date: Fri Oct 17 08:00:58 2014 +0200
>
> cpuid.h (__cpuid): Remove definitions that handle %ebx register in
> a special way.
>
> * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx
> register in a special way.
> (__cpuid_count): Ditto.
> * config/i386/driver-i386.h: Protect with
> "#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))".
> (host_detect_local_cpu): Mention that GCC with non-fixed %ebx
> is required to compile the function.
>
> From-SVN: r216362
>
> Since GCC 6.2 or above is required to build glibc, please
> remove the !OPTIMIZE_FOR_GCC_5 path and this issue
> will be resolved automatically.
There are
/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
we can inline syscalls with 6 arguments if GCC 5 or above is used
to compile glibc. Disable GCC 5 optimization when compiling for
profiling or when -fno-omit-frame-pointer is used since asm ("ebp")
can't be used to put the 6th argument in %ebp for syscall. */
#if !defined PROF && CAN_USE_REGISTER_ASM_EBP
# define OPTIMIZE_FOR_GCC_5
#endif
If we want to support profiling or -fno-omit-frame-pointer,
we need to keep these codes.
> > Tested on i686-linux-gnu. Built with build-many-glibcs.py.
> >
> > Thanks,
> > Florian
> >
> > Florian Weimer (2):
> > i386: Always treat %ebx as an allocatable register
> > i386: Always use __libc_do_syscall for 6-argument syscalls (bug 27997)
> >
> > config.h.in | 4 -
> > sysdeps/unix/sysv/linux/i386/configure | 39 ----
> > sysdeps/unix/sysv/linux/i386/configure.ac | 17 --
> > sysdeps/unix/sysv/linux/i386/sysdep.h | 222 +++-------------------
> > 4 files changed, 27 insertions(+), 255 deletions(-)
> >
> >
> > base-commit: e72ef23ee88187284b4b1ca9b2e314e618429d35
> > --
> > 2.34.1
> >
>
>
> --
> H.J.
--
H.J.
More information about the Libc-alpha
mailing list