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 [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 271131F44D for ; Thu, 28 Mar 2024 14:52:07 +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=K523DTaH; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 221CA385840D for ; Thu, 28 Mar 2024 14:52:06 +0000 (GMT) Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by sourceware.org (Postfix) with ESMTPS id A5BF23858D1E for ; Thu, 28 Mar 2024 14:51:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5BF23858D1E 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 A5BF23858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711637507; cv=none; b=UgvfYw8KkWB7bryZVkI2hIYVoOSi2hN+SXVLh+zxamp5/PRpZWb2RVph9Ey9irv4ANTaQBcjgY4SeJMeUd9Hfqgo3uD/EUl5xyGh1zKKqW9vWVohxkubzZQgHgo9wgSXY/ze7VgT0QXQRtq8hD7A2tDrhyGA0ECri5sFD9PrsnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711637507; c=relaxed/simple; bh=wFduU39H+rrc/ZnXC5y+CAjTTJPl5Q9JoAdEzOBLxNA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=hHdlaNergdkCRgrejD9IngQfbFGNH7r/mrZeXCg0ZU2vpPzGatuleraeryGRSfInT+bADBA6Ds/fYmsRd3ijz2kS9mXOfSg+zYqTlZ2l/NudO6vGUYJCOdxkMjWs4LTYyI4ewjESxhwCFgAT9pHPwzhOQqJDqlS7ICQW6oqYuZQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-6114c9b4d83so9488837b3.3 for ; Thu, 28 Mar 2024 07:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711637503; x=1712242303; 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=8IM02PS6ix4ClzYioawkgGDpmT2WoZGekMwfkCWQnf8=; b=K523DTaHvklVM8UDUdyYnrOdbjCySc+tucVS+Qt5zB91jxxmNJIEE3oAHWTpLDI+38 dCS+aRTaNN+kpXHwWacDuZPYb7EF3++gDcrxBj3yUZXQ/rbEC3rsJ5ck4KrnHQttrXav Jn9NDY3jD0Ke5WevlGdYsPWHbEa+P3dflVVA4xCTLuVsIOGIf0pd2iGc6mkAVzH0d2+J f6clCIlWVCao4e6kdTOeBqOq8hBbigC8SpOIjVhaFOFChgt0bLoyUmAKDvZhEMTSB3V+ z1D+XeSiDYGuAWSy1KngtuIznFQG75r08uKPv9cUIata5XxAsiQiLNAkUhSo/V8NQBR5 9LUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711637503; x=1712242303; 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=8IM02PS6ix4ClzYioawkgGDpmT2WoZGekMwfkCWQnf8=; b=sy+2MwDPsTsfUbC5pH3A7a+MrGutS0qnzCMBfRIFq5Fug86bsJI6RpRPv6SKEFFiKc YYVnrt/+VxppQhOCDiot1KJwETem/hGsIJ/tbLLflLfjqx6w1YQUyKjlq07ftJbXsDUR VqcrvvYHAgRdr3uwt4r/Wd9MAFmnMDpyFgYA0DNeoh0qlWvb1SfoAXNjEOtlNHAemdm6 xlkOnmx2P6l+6eMjgucVS/T0vHLbO1Fozu7Fs9es+YWrjhhOVN+jZv3DEt0M4pyH8vaf u1qsiU//pZJFTA3fjgMAkwsEQT/t/sQdCkixftFtZjide21+K06vrNSRMxRk/TOlr8wf 8kHw== X-Gm-Message-State: AOJu0Yw843J55eS3dZv0hfcAfAjbAjp07o9kmR8KBacx8e8R6qZqKgSY SgLY2jjIa9ot1p8o7ILvkF3ikoGioiF9SlLciMcsE48IWlcprAhqABomNWvZ9iY3Q9ZsDWCjPjM Fu6V8sG5cnCMscKrVoYR/0g/HnaI= X-Google-Smtp-Source: AGHT+IEpKxOy3Mt3uF409MdQTILrnVqnoYAt9qq1hKB2WvSSL/Ed9Wm+AqNUUXC0ARdIq5B34V7w0BxvNHEvJh8wo+E= X-Received: by 2002:a81:7344:0:b0:60a:21cd:f18c with SMTP id o65-20020a817344000000b0060a21cdf18cmr2852931ywc.36.1711637502938; Thu, 28 Mar 2024 07:51:42 -0700 (PDT) MIME-Version: 1.0 References: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> <20240327194024.1409677-4-adhemerval.zanella@linaro.org> <1936623e-b6c1-40ef-b7c8-249eef54d071@linaro.org> In-Reply-To: From: "H.J. Lu" Date: Thu, 28 Mar 2024 07:51:06 -0700 Message-ID: Subject: Re: [PATCH v2 03/10] i386: Use generic fmod To: Adhemerval Zanella Netto 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 Thu, Mar 28, 2024 at 7:11=E2=80=AFAM Adhemerval Zanella Netto wrote: > > > > On 27/03/24 18:38, H.J. Lu wrote: > > On Wed, Mar 27, 2024 at 1:37=E2=80=AFPM Adhemerval Zanella Netto > > wrote: > >> > >> > >> > >> On 27/03/24 16:55, H.J. Lu wrote: > >>> On Wed, Mar 27, 2024 at 12:40=E2=80=AFPM 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 comp= at > >> 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. > >> > > > > Does it fix a run-time test which fails without the fix? > > > > Not really, but it is one less assembly implementation in favor a generic= one > (which also shows a slight improvement on recent chips) and it sync i386 > with generic code (so less possible issues, such as the static lib in thi= s > patchset). Why do we need a new symbol? --=20 H.J.