From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 823CE1F44D for ; Wed, 27 Mar 2024 19:57:01 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=W+/WSFO0; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC265385DC0F for ; Wed, 27 Mar 2024 19:57:00 +0000 (GMT) Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by sourceware.org (Postfix) with ESMTPS id C0C403858D20 for ; Wed, 27 Mar 2024 19:56:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0C403858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C0C403858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711569399; cv=none; b=jZstQFhzt9ldjTXPgZGh5SmdJ5b3JUn9QLVKZlpHwnsqF6FF/ScTP1vNQiJInH3GMedmo8esHO/UO5eM+MrJaY1+eEo9wJG0MvZDywtU4XEdQDDB4wuUjAyaiP6LT3iE2c/VAeg72NB552ek45lOH0+0VGAkXtWmqey7Fnxldjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711569399; c=relaxed/simple; bh=FQp0zbtZ8hII0ce3Le0+tjFes5o2h7HyjaisbOnN4Y8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=HnE4aImW0ThJv5hH4KMqkv3MDYhJxrSujmnDme7hwhuchmm3OC8xlc3wnUbwXdkglM3PBMENhm1TLQBGnprhQLXdLpIcTEGT2xhe6hK+FH8l0vxIqUjbSYzx1o5qXVpod2+YewFQYiuvd7aNbRmt+HGOJJfACE/V7H0ZYQ43W/I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-612f318d421so2394997b3.3 for ; Wed, 27 Mar 2024 12:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711569397; x=1712174197; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ibhAkk6LUUgnUViFhZPXT1aDiwcXliS1LNPSVJ02tas=; b=W+/WSFO0QXRCfqUITB67QPkP/I/YN2fyL5lhxgLCFsPf0PuO33im/8+D0jApU5WzZc TIqRGCBZD4VgxPqvlkgRnJ7S28WpxPIeDvkl+qhHVjB4rMX8dZOqzZL7iKSOZ8/CAzpA u8ZJPnN6nHpVjDGBdBO357as9FXeIGUTOdokntHoxXuZJ78Lb5oWDjURiJV4H0II2vv8 nil3cf+FIjdT1UTYQ/dMr8SYAeaCtFUBPXHXStazMtIxjDvMxSBm/aVQbYwr3P35Au4+ hOnrrOMW9oDcJYB14fB72a3L629yj47WCJaxez0Iy8ZvwCgKjo0e2U8bXtoFPYHDnDEJ PCkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711569397; x=1712174197; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ibhAkk6LUUgnUViFhZPXT1aDiwcXliS1LNPSVJ02tas=; b=b6wxozpplyuI2akWlLxDdfQ7bgcZlYUgfzYDhRxBe0lfEaAj6bgUibz2YLUVGF5+Vi jsDVBQLppytBHTJ8R1BZcoQhvv5U+PQRSc7uvUGo26pgBStP+fsysBFDzS/PyjbBx7+H XRtGkE07B56AOa0rZ2mM5gJFTHtCbHkSBLeTKYF9vsljcO3NL3m9DRI6NrN5pbofyYJR KI2TXT2X8CUKD13J1EtGCbFI7tNzjJmyb1MMy7y95dUE5aGD3YW2GlcBRESwYT5vadQC MsKLK/oZBdYxDaeL7Ip1CaLqPtdOtPLf4pnFgvV7U6bh2eu8P/9g5Tv7FnUy2XegMojY b2hA== X-Gm-Message-State: AOJu0Yx8DHDb6iGIYExLdzSTioDKwhnpsUx9ruuzFBWype1w4AppD+Lf KuoJ7YPQ/Augb7LH4g3H0QAXUSIzCWGJtzfXIJLzOo2GMYcW4UBNqGw3TUhUj6mxZ3jx/gNrVZc CK2S08j/PrSLpOML2V6G8swqa1wYa640w X-Google-Smtp-Source: AGHT+IFosJbWjAFP83PTdSBfaBSGvs7lBWlg01xSPYoEBrrQ/I1Ah/f97acxILpCXrwueDy5NJXazO91v6swXy0Lgdc= X-Received: by 2002:a81:71c4:0:b0:608:ecf0:e78a with SMTP id m187-20020a8171c4000000b00608ecf0e78amr827529ywc.27.1711569395788; Wed, 27 Mar 2024 12:56:35 -0700 (PDT) MIME-Version: 1.0 References: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> <20240327194024.1409677-5-adhemerval.zanella@linaro.org> In-Reply-To: <20240327194024.1409677-5-adhemerval.zanella@linaro.org> From: "H.J. Lu" Date: Wed, 27 Mar 2024 12:55:59 -0700 Message-ID: Subject: Re: [PATCH v2 04/10] i386: Use generic fmodf To: Adhemerval Zanella Cc: libc-alpha@sourceware.org, Joseph Myers , Florian Weimer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org On Wed, Mar 27, 2024 at 12:40=E2=80=AFPM Adhemerval Zanella wrote: > > The resulting performance is similiar (Ryzen 5900, gcc 13.2.1): > > * sysdeps/i386/fpu/e_fmodf.S > "fmodf": { > "subnormals": { > "duration": 3.68732e+09, > "iterations": 2.2912e+08, > "max": 71.447, > "min": 15.836, > "mean": 16.0934 > }, > "normal": { > "duration": 3.75848e+09, > "iterations": 5.5296e+07, > "max": 273.208, > "min": 15.725, > "mean": 67.9702 > }, > "close-exponents": { > "duration": 3.69035e+09, > "iterations": 2.07872e+08, > "max": 64.454, > "min": 15.762, > "mean": 17.753 > } > } > > * master > "fmodf": { > "subnormals": { > "duration": 3.6863e+09, > "iterations": 2.23616e+08, > "max": 65.453, > "min": 16.243, > "mean": 16.485 > }, > "normal": { > "duration": 3.71129e+09, > "iterations": 5.3248e+07, > "max": 281.57, > "min": 16.169, > "mean": 69.6983 > }, > "close-exponents": { > "duration": 3.70274e+09, > "iterations": 2.03776e+08, > "max": 81.474, > "min": 16.206, > "mean": 18.1706 > } > } > --- > sysdeps/i386/fpu/Versions | 2 +- > sysdeps/i386/fpu/e_fmodf.S | 18 ------------------ > sysdeps/i386/fpu/e_fmodf.c | 2 ++ > sysdeps/i386/fpu/w_fmodf_compat.c | 15 --------------- > sysdeps/ieee754/flt-32/e_fmodf.c | 5 ++++- > sysdeps/mach/hurd/i386/libm.abilist | 1 + > sysdeps/unix/sysv/linux/i386/libm.abilist | 1 + > 7 files changed, 9 insertions(+), 35 deletions(-) > delete mode 100644 sysdeps/i386/fpu/e_fmodf.S > create mode 100644 sysdeps/i386/fpu/e_fmodf.c > delete mode 100644 sysdeps/i386/fpu/w_fmodf_compat.c > > diff --git a/sysdeps/i386/fpu/Versions b/sysdeps/i386/fpu/Versions > index d37bc1eae6..9509f9b7c7 100644 > --- a/sysdeps/i386/fpu/Versions > +++ b/sysdeps/i386/fpu/Versions > @@ -5,6 +5,6 @@ libm { > } > GLIBC_2.40 { > # No SVID compatible error handling. > - fmod; > + fmod; fmodf; > } > } > diff --git a/sysdeps/i386/fpu/e_fmodf.S b/sysdeps/i386/fpu/e_fmodf.S > deleted file mode 100644 > index f73ce9da1e..0000000000 > --- a/sysdeps/i386/fpu/e_fmodf.S > +++ /dev/null > @@ -1,18 +0,0 @@ > -/* > - * Public domain. > - */ > - > -#include > -#include > - > -ENTRY(__ieee754_fmodf) > - flds 8(%esp) > - flds 4(%esp) > -1: fprem > - fstsw %ax > - sahf > - jp 1b > - fstp %st(1) > - ret > -END(__ieee754_fmodf) > -libm_alias_finite (__ieee754_fmodf, __fmodf) > diff --git a/sysdeps/i386/fpu/e_fmodf.c b/sysdeps/i386/fpu/e_fmodf.c > new file mode 100644 > index 0000000000..15a0f960bf > --- /dev/null > +++ b/sysdeps/i386/fpu/e_fmodf.c > @@ -0,0 +1,2 @@ > +#define FMODF_VERSION GLIBC_2_40 > +#include > diff --git a/sysdeps/i386/fpu/w_fmodf_compat.c b/sysdeps/i386/fpu/w_fmodf= _compat.c > deleted file mode 100644 > index 5a61693e51..0000000000 > --- a/sysdeps/i386/fpu/w_fmodf_compat.c > +++ /dev/null > @@ -1,15 +0,0 @@ > -/* i386 provides an optimized __ieee752_fmodf. */ > -#include > -#ifdef SHARED > -# undef SHLIB_COMPAT > -# define SHLIB_COMPAT(a, b, c) 1 > -# undef LIBM_SVID_COMPAT > -# define LIBM_SVID_COMPAT 1 > -# undef compat_symbol > -# define compat_symbol(a, b, c, d) > -# include > -libm_alias_float (__fmod_compat, fmod) > -#else > -#include > -#include > -#endif > diff --git a/sysdeps/ieee754/flt-32/e_fmodf.c b/sysdeps/ieee754/flt-32/e_= fmodf.c > index ef95c05800..78071df756 100644 > --- a/sysdeps/ieee754/flt-32/e_fmodf.c > +++ b/sysdeps/ieee754/flt-32/e_fmodf.c > @@ -173,7 +173,10 @@ __fmodf (float x, float y) > } > strong_alias (__fmodf, __ieee754_fmodf) > #if LIBM_SVID_COMPAT > -versioned_symbol (libm, __fmodf, fmodf, GLIBC_2_38); > +# ifndef FMODF_VERSION > +# define FMODF_VERSION GLIBC_2_38 > +# endif > +versioned_symbol (libm, __fmodf, fmodf, FMODF_VERSION); > libm_alias_float_other (__fmod, fmod) > #else > libm_alias_float (__fmod, fmod) > diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386= /libm.abilist > index 30665f8b1a..88e7538e51 100644 > --- a/sysdeps/mach/hurd/i386/libm.abilist > +++ b/sysdeps/mach/hurd/i386/libm.abilist > @@ -1182,3 +1182,4 @@ GLIBC_2.35 fsqrtl F > GLIBC_2.35 hypot F > GLIBC_2.35 hypotf F > GLIBC_2.40 fmod F > +GLIBC_2.40 fmodf F > diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sys= v/linux/i386/libm.abilist > index 44932f111d..c99c60161d 100644 > --- a/sysdeps/unix/sysv/linux/i386/libm.abilist > +++ b/sysdeps/unix/sysv/linux/i386/libm.abilist > @@ -1189,3 +1189,4 @@ GLIBC_2.35 fsqrtl F > GLIBC_2.35 hypot F > GLIBC_2.35 hypotf F > GLIBC_2.40 fmod F > +GLIBC_2.40 fmodf F > -- > 2.34.1 > Need a bug report for ABI change. --=20 H.J.