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,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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 E069B1F461 for ; Wed, 27 Mar 2024 20:38:05 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=GDSNohsn; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 364E9385E00B for ; Wed, 27 Mar 2024 20:38:05 +0000 (GMT) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id E97F53858D34 for ; Wed, 27 Mar 2024 20:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E97F53858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E97F53858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::530 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711571865; cv=none; b=EXRVOMCIw2oXis3N7ICuc1tZccn1IpW98W2poPfMA+RhTPxv7H2BWFJ59x7iI/erzZ+uJIePeMGEn0ZMG1dtzADQtIve9pY8ec/B3B6F7Dq8hPbaH0MHJvVR70R0sjadicgtRwk3N7FKuD/0if0JBtW4dK2s0ODPFgl0ubXRHCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711571865; c=relaxed/simple; bh=4Kf2wl/MLXdxVRIzWUpOAduaYw1ttDavV37UDjZdh0w=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=JbOaheM2/9cJJ/wc/GOxOGNCUo2yGcrEqjQMLNOR7/jsXIkQl5qh9XMA8964y7mpsDMpR3o/htkWC0bCmPpbK2TzqF8bj+6yO6VNfu4uq/HmfvM4lKgneIka39ClWsZsPziCV6U14vU5pGFMqpvkIbydd98TL32nkpWSR7FsHlg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5d4a1e66750so143101a12.0 for ; Wed, 27 Mar 2024 13:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711571862; x=1712176662; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=IL+o7CgmSC+MRFrrq7eS4gykp1GsFZrSKsUfi+sZuz8=; b=GDSNohsnzRifGPdvsBG4tUTGrMRWvxO5yIvE+J90SLyCdp14Vl2tRyn4B2xo3AYVPx aDTkiOcg/5dgAH4GOoU+KwvUikU2yvkyH2xFFfX8ffubVwir9ciPnClafGT9GfOrSAFN cegSSLGoIRyBE4AOPYCYrt5sofMirfnG/h9iW7w078I0g0B4eJvSOAzdH8ASRXhHP0E0 ATxt1rTdHU81Lv4VVqQMJx1qO8tm6urRd6dYoXB5VGQH9QjvAwSjuFBXAKzHtUZMpVs3 AvRaDKNlPCPfev1ih0K6d0tMmeFV0HiHhP1ZlTJdQk4SjtePuo6CBJGmNVuZcQushw+t 2KIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711571862; x=1712176662; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IL+o7CgmSC+MRFrrq7eS4gykp1GsFZrSKsUfi+sZuz8=; b=Q3W9iUxVabU/kaVLY/vUzRkB/FOocNcdqywY/inV412RlI4+oas8hFJqlzggznui7D pyeL5+fxrZf/7Wuz4EXD6bJaYqg55qNEdaqL7oW0g1pDZR/YeAnIdvfBKKIwq4eluYm0 IzTjhCuOn6st1n0njLelGn1yMrL6cjLgp2LMhCVE7J2sO49bMRC4WS5D3yPT5Mdlu95z XQXTlhvwWuP5rxrMyAkG1aow13Rlhho0FFts/PButZ4p/sjIlR9wubBRauykG4htrv1O J47/QyYtfdVrKRiXxGkCCOmPtFE7QntMeVssiOi4br7fpoQsHR+CbJxQOeZG6IM00bWN eKZw== X-Gm-Message-State: AOJu0YzDQpe61ZLM1bWwGciBh1T+0njgUiXtLstGU6R2JEbGNcwOvHiL 5rhJ8CShN5ygs2GfPOgvB2jAv8pNVcTiU3JV6MIRVObhar50BJaojYuv4iBin+o= X-Google-Smtp-Source: AGHT+IGoCKCgE3/YYGXWXvvqBM7B7T5IsF2lyLE5MjsF3odqJsVbSqjbF+5kE1HsLr2UNwfSW0UFYg== X-Received: by 2002:a17:902:6546:b0:1e0:2a62:2ddd with SMTP id d6-20020a170902654600b001e02a622dddmr761136pln.31.1711571861818; Wed, 27 Mar 2024 13:37:41 -0700 (PDT) Received: from [192.168.15.31] ([187.56.129.71]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c20d00b001dd82855d47sm9438777pll.265.2024.03.27.13.37.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 13:37:41 -0700 (PDT) Message-ID: <1936623e-b6c1-40ef-b7c8-249eef54d071@linaro.org> Date: Wed, 27 Mar 2024 17:37:38 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 03/10] i386: Use generic fmod To: "H.J. Lu" Cc: libc-alpha@sourceware.org, Joseph Myers , Florian Weimer References: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> <20240327194024.1409677-4-adhemerval.zanella@linaro.org> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 27/03/24 16:55, H.J. Lu wrote: > On Wed, Mar 27, 2024 at 12:40 PM Adhemerval Zanella > wrote: >> >> The benchtest results shows a slight improvement (Ryzen 5900, gcc >> 13.2.1): >> >> * sysdeps/i386/fpu/e_fmod.S: >> "fmod": { >> "subnormals": { >> "duration": 3.68855e+09, >> "iterations": 2.12608e+08, >> "max": 62.012, >> "min": 16.798, >> "mean": 17.349 >> }, >> "normal": { >> "duration": 3.88459e+09, >> "iterations": 7.168e+06, >> "max": 2879.12, >> "min": 16.909, >> "mean": 541.934 >> }, >> "close-exponents": { >> "duration": 3.692e+09, >> "iterations": 1.96608e+08, >> "max": 66.452, >> "min": 16.835, >> "mean": 18.7785 >> } >> } >> >> * generic >> "fmod": { >> "subnormals": { >> "duration": 3.68645e+09, >> "iterations": 2.2848e+08, >> "max": 66.896, >> "min": 15.91, >> "mean": 16.1347 >> }, >> "normal": { >> "duration": 4.1455e+09, >> "iterations": 8.192e+06, >> "max": 3376.18, >> "min": 15.873, >> "mean": 506.043 >> }, >> "close-exponents": { >> "duration": 3.70197e+09, >> "iterations": 2.08896e+08, >> "max": 69.597, >> "min": 15.947, >> "mean": 17.7216 >> } >> } >> --- >> sysdeps/i386/fpu/Versions | 4 ++++ >> sysdeps/i386/fpu/e_fmod.S | 18 ------------------ >> sysdeps/i386/fpu/e_fmod.c | 2 ++ >> sysdeps/i386/fpu/math_err.c | 1 - >> sysdeps/i386/fpu/w_fmod_compat.c | 15 --------------- >> sysdeps/ieee754/dbl-64/e_fmod.c | 5 ++++- >> sysdeps/mach/hurd/i386/libm.abilist | 1 + >> sysdeps/unix/sysv/linux/i386/libm.abilist | 1 + >> 8 files changed, 12 insertions(+), 35 deletions(-) >> delete mode 100644 sysdeps/i386/fpu/e_fmod.S >> create mode 100644 sysdeps/i386/fpu/e_fmod.c >> delete mode 100644 sysdeps/i386/fpu/math_err.c >> delete mode 100644 sysdeps/i386/fpu/w_fmod_compat.c >> >> diff --git a/sysdeps/i386/fpu/Versions b/sysdeps/i386/fpu/Versions >> index a2eec371f1..d37bc1eae6 100644 >> --- a/sysdeps/i386/fpu/Versions >> +++ b/sysdeps/i386/fpu/Versions >> @@ -3,4 +3,8 @@ libm { >> # functions used in inline functions or macros >> __expl; __expm1l; >> } >> + GLIBC_2.40 { >> + # No SVID compatible error handling. >> + fmod; >> + } > > This changes the ABI. I assume that it fixes a real bug. Is there a bug > report open for this? > The new version is the way to provide the system without the SVID compat support, which we for all ABIs but i386 on 2.38. For instance: find . -iname libm.abilist | xargs grep -w fmod ./sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist:GLIBC_2.0 fmod F ./sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist:GLIBC_2.38 fmod F [...] For i386 specifically, the old SVID symbol will be kept as fmod@GLIBC_2.0. >> } >> diff --git a/sysdeps/i386/fpu/e_fmod.S b/sysdeps/i386/fpu/e_fmod.S >> deleted file mode 100644 >> index 86ac1bcfaf..0000000000 >> --- a/sysdeps/i386/fpu/e_fmod.S >> +++ /dev/null >> @@ -1,18 +0,0 @@ >> -/* >> - * Public domain. >> - */ >> - >> -#include >> -#include >> - >> -ENTRY(__ieee754_fmod) >> - fldl 12(%esp) >> - fldl 4(%esp) >> -1: fprem >> - fstsw %ax >> - sahf >> - jp 1b >> - fstp %st(1) >> - ret >> -END (__ieee754_fmod) >> -libm_alias_finite (__ieee754_fmod, __fmod) >> diff --git a/sysdeps/i386/fpu/e_fmod.c b/sysdeps/i386/fpu/e_fmod.c >> new file mode 100644 >> index 0000000000..3625758f97 >> --- /dev/null >> +++ b/sysdeps/i386/fpu/e_fmod.c >> @@ -0,0 +1,2 @@ >> +#define FMOD_VERSION GLIBC_2_40 >> +#include >> diff --git a/sysdeps/i386/fpu/math_err.c b/sysdeps/i386/fpu/math_err.c >> deleted file mode 100644 >> index 1cc8931700..0000000000 >> --- a/sysdeps/i386/fpu/math_err.c >> +++ /dev/null >> @@ -1 +0,0 @@ >> -/* Not needed. */ >> diff --git a/sysdeps/i386/fpu/w_fmod_compat.c b/sysdeps/i386/fpu/w_fmod_compat.c >> deleted file mode 100644 >> index 528bfc2a13..0000000000 >> --- a/sysdeps/i386/fpu/w_fmod_compat.c >> +++ /dev/null >> @@ -1,15 +0,0 @@ >> -/* i386 provides an optimized __ieee752_fmod. */ >> -#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_double (__fmod_compat, fmod) >> -#else >> -#include >> -#include >> -#endif >> diff --git a/sysdeps/ieee754/dbl-64/e_fmod.c b/sysdeps/ieee754/dbl-64/e_fmod.c >> index b33cfb1223..7651cd212a 100644 >> --- a/sysdeps/ieee754/dbl-64/e_fmod.c >> +++ b/sysdeps/ieee754/dbl-64/e_fmod.c >> @@ -175,7 +175,10 @@ __fmod (double x, double y) >> strong_alias (__fmod, __ieee754_fmod) >> libm_alias_finite (__ieee754_fmod, __fmod) >> #if LIBM_SVID_COMPAT >> -versioned_symbol (libm, __fmod, fmod, GLIBC_2_38); >> +# ifndef FMOD_VERSION >> +# define FMOD_VERSION GLIBC_2_38 >> +# endif >> +versioned_symbol (libm, __fmod, fmod, FMOD_VERSION); >> libm_alias_double_other (__fmod, fmod) >> #else >> libm_alias_double (__fmod, fmod) >> diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist >> index 8f40ddb150..30665f8b1a 100644 >> --- a/sysdeps/mach/hurd/i386/libm.abilist >> +++ b/sysdeps/mach/hurd/i386/libm.abilist >> @@ -1181,3 +1181,4 @@ GLIBC_2.35 fsqrt F >> GLIBC_2.35 fsqrtl F >> GLIBC_2.35 hypot F >> GLIBC_2.35 hypotf F >> +GLIBC_2.40 fmod F >> diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist >> index 5d89aaa08e..44932f111d 100644 >> --- a/sysdeps/unix/sysv/linux/i386/libm.abilist >> +++ b/sysdeps/unix/sysv/linux/i386/libm.abilist >> @@ -1188,3 +1188,4 @@ GLIBC_2.35 fsqrt F >> GLIBC_2.35 fsqrtl F >> GLIBC_2.35 hypot F >> GLIBC_2.35 hypotf F >> +GLIBC_2.40 fmod F >> -- >> 2.34.1 >> > >