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=-1.0 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 [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 4E6D81F44D for ; Thu, 28 Mar 2024 15:15:14 +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=j5p7hHI1; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D6303858D1E for ; Thu, 28 Mar 2024 15:15:12 +0000 (GMT) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 156A13858D1E for ; Thu, 28 Mar 2024 15:14:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 156A13858D1E 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 156A13858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::631 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711638893; cv=none; b=wn8h3oaVD+y3FewyFpB36dL8a6bUNasGpm1a61cfCMZL7TX3yRpUtLG7ABlaU/Co+LZpzTkSx376moKSUYgQTUu69/3VWL213t8CDNFOgSYZJGdtxqxndV5oNEvGGWaxpkar3C1das2V02Nj0efSNjjaLf48CmkaOwQs9inNboQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711638893; c=relaxed/simple; bh=UQ+ypjEFIvGXVC8+GINOD9dvFXld/TH6TZFPDeR4y/0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=q1RQtf5/M8tI+RGV7LsA/dGrJgMoJBEiFVsAYiOCGPg5O3GjLfm7IDV1EiucC1MBbmdfZNiubgpUMCBwVp85LFTQ8cloMlTWn+RmmHLrOmIVjdXMaJ1X/wD4Tr8lnSaX6zT3HdVO3N+puveBkavSL4VZTdOO6/dp0gG5XMzomuc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1e2266655b1so1967325ad.2 for ; Thu, 28 Mar 2024 08:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711638890; x=1712243690; 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=xnhE1H1BiBFXJePYuZ0GyT2CacrHr9cIbjo24JssB+A=; b=j5p7hHI1bGdvtZtEK/2etV41sIe2NvSXRlauQfdwehdao9n014a/hpkvKALDYKljmr X5x6z+S33LN5ELvu15JpG7gr5ixyIp7b+4DJnej/ddsU9YqXSJHjGJ69Sb7BtImp9RyH 2aykkT53HD/U/T/aXza05Juw9MVqX5ZufmjL65I1Ho4g3jEHT2gmxCj/ycVxBv6fwcDN u8hYqXOEvx/WJmsBeOCICOdEaelybfzLjHMi/X8Hu9iYC5bnFMwu40QWFXqUndmTLri8 catYEjchjuM3tNttJ/P3hq5DGVhVc47h6uMA+QdhRoTGyqBwfDGOT7t5Le0QltlXMIgE /NMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711638890; x=1712243690; 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=xnhE1H1BiBFXJePYuZ0GyT2CacrHr9cIbjo24JssB+A=; b=X0aAqbkVrewG4X2eueH3LDEQq8d8+K5m5TqmL0VapPmIgLSfoicv5+FIerylaIyZzx oiBMcYNrf7ki5dD3w7GECeAhJvxB0kx29tmeGzSQb0CmGYyZSyqKBPQVSKZSbE5xkCnf 1XFiJHAFZdqOwCklQ7vIZVsUjk35vqp5DV7YBY5QduWnsHZ+We/IcXXZojpycguEGCbP GygAdgejBCY4TPNISREZyqqdgkmbFQPk/o//UMsh75c0akeurANB15nW0n0h0LEvE+v3 JtVYNbxi1yYSDqj1wasxf2GyYnsQHdDzo8drDpwgIxK4uaYlOKKt+W9fHZqgW5oZO4lD KEFg== X-Gm-Message-State: AOJu0Yx0jDosVLnwtgdeEybaFgCBFqp8heoDthZZJ3MwmVCv3Xun0Hut 1MWOGGFJmj8I8x/JaZ6Jikgh0cXx7RiuLze+ZAjFPhrQ2jD91rSKXQ4wjgYHwZA= X-Google-Smtp-Source: AGHT+IH7B+qny86frF+P/MtnO9mdHhiZuB5ldaQL+NPdftOfxjB59m6Vsv4TFwA9SDo70dtb6AJ0aw== X-Received: by 2002:a17:902:f54e:b0:1e0:b5e8:7467 with SMTP id h14-20020a170902f54e00b001e0b5e87467mr3300329plf.3.1711638889984; Thu, 28 Mar 2024 08:14:49 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:b18e:f80b:dc91:dea1:d972? ([2804:1b3:a7c3:b18e:f80b:dc91:dea1:d972]) by smtp.gmail.com with ESMTPSA id l16-20020a170903121000b001e0c956f0dcsm1696665plh.213.2024.03.28.08.14.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Mar 2024 08:14:49 -0700 (PDT) Message-ID: <1048273f-c636-4c2b-83f6-7535839bce03@linaro.org> Date: Thu, 28 Mar 2024 12:14:46 -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> <1936623e-b6c1-40ef-b7c8-249eef54d071@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 28/03/24 11:51, H.J. Lu wrote: > On Thu, Mar 28, 2024 at 7:11 AM Adhemerval Zanella Netto > wrote: >> >> >> >> On 27/03/24 18:38, H.J. Lu wrote: >>> On Wed, Mar 27, 2024 at 1:37 PM Adhemerval Zanella Netto >>> wrote: >>>> >>>> >>>> >>>> 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. >>>> >>> >>> 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 this >> patchset). > > Why do we need a new symbol? Because the new fmod@GLIBC_2.40 for i386 won't have the SVID handling, similar to what has been done for other architectures with 16439f419b270184ec501c531bf20d83b6745fb0;