From patchwork Wed Mar 27 16:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 783143 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2300850wrt; Wed, 27 Mar 2024 09:48:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwuCJYTbCFPxdK8igy5ZKRS1B8zyHFyYOD/fDdccBrngIhqj5YKSK4vV8irYuqzozCTMU1oGiR55X770bo1bx2 X-Google-Smtp-Source: AGHT+IFbwh64oY2VFp0uswnRAHhGQNNIWYSrUfmosBM4KnmLT3mjotujbR7lmwOHvwqXFZGBiq5c X-Received: by 2002:a05:6830:1350:b0:6e6:e52e:a856 with SMTP id r16-20020a056830135000b006e6e52ea856mr367036otq.14.1711558124694; Wed, 27 Mar 2024 09:48:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711558124; cv=pass; d=google.com; s=arc-20160816; b=Jzk9scohVoce1q4GSsdlm3SbMZQLTqjo3uH/do+Vm7qXCs5rwD8FF1PkvSjtbcf7rH HU9uFvGygCB5O0LoWALp90i4rM9SACktko/7+c9wU1RN1t15PeiydAPMsVfhLY7oCacx DzqHA8geveG4Jpikd1IgML3u0SFHjVTBk1jmn2RxNnmSKC2tA7Hs/UHTn0xF6RoCepm1 T2ey7wIaJa839zEZkig1bSezRLmJc+sdzo/qkxXULIXR86vjo/FE05geTR727M/bTlGp aryob/BToG4pBKKMEubl9pA6nHUsTIkf1Xc13TNKUA0TVYCw+jaWsrublje6UlEXdEPc qTWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=xxVrNOvOe0mPi/BVXSb7kTUlPxIfJx2Q3Oom6CeE+A8=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=mM2V4I+pb1Hl4ajSSsu629MGJhjCMLdk79FGgG+5tEwn3F4Gp2voWkb7xG5fyz+vDc a2toNJRcnXvHcMjIfq21jkKGEYPpjtGM1VTeW8ZMdYm2MZPqWbp1yq1Dybb0obT1VTWX hHyBC4CDIuXA1RLzduw0MBFRb4g25cHwvZvn2Bc5O7gSIkhnLBVWpXfKQsZL17SpUzEJ 9gSAZ1DvPaDzIx1ZV3EJ9fe2hdkAWrI6ubqn2yjsuGK1EPWydj7GxvwS+ussdCTy6pUz EJpAw6H1XqcEuDx3xwdXEkCFs2NtpRpMC5iLr+vVy/AIcJzgAYGPXtTqdrEsNro7yAbq OraQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AhAZ6ucF; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id h16-20020a05620a21d000b0078a5f289feasi4740291qka.419.2024.03.27.09.48.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:48:44 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AhAZ6ucF; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 52CA73858407 for ; Wed, 27 Mar 2024 16:48:44 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id D601B385C6EE for ; Wed, 27 Mar 2024 16:45:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D601B385C6EE 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 D601B385C6EE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557946; cv=none; b=OK09+k54KIA98+OUch1QEqRiBTNn1Uce3zEuZDvPBb8mAmqOuf15eou4mY7ZFZ+Zsie82clqBiMa0ssGGt6yYntLP6L3rorrEMyrTILIyEK2z+Hkvl8fZ5OiTApMkINVP/laHxIbc3Dxr21J5gnzs7AFfu8nDrbfmf9daXny42Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557946; c=relaxed/simple; bh=Lj4xaog2tdjPc2qDBaWYQmFkmaPXpB5xrXtcNLqjTv8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=q2fOEiOSD0UpCQs12XKsyYKcA9KiP6O3lfYSnhN/xD0iTKqRGW0BPfnYNjONQRBNTqw+AVvwT12YDXmWoHhiZB7UorJXgdoPm+2RU2RuLcxOgNmr+o8Yi73VGiGNjbOtqvoy23TMgKTIvfVWIC7zTeELY0jBcxNM/ByCTD42COA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1de0f92e649so405795ad.0 for ; Wed, 27 Mar 2024 09:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557941; x=1712162741; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xxVrNOvOe0mPi/BVXSb7kTUlPxIfJx2Q3Oom6CeE+A8=; b=AhAZ6ucFJhM2cZGT2ZcQX6r0k0aPCSCa1r2yOKUL8mlWOnvm9rG+j30JWUBwte/tDv Ufn00gfKB9NTVU/2ACQaEkCkhyIVVdHCkKhtWGg3aNDcbtzY6ZlQXOTu5L7orKQcAUDp +snT95aCqSQxNsCU0TTirG2sQkb2PTuVe9KFSibbXDpo5mCjU2BuRk9rUwPZyIChM486 Bk/C+Ugbb6VtM04kY7y0D4Ox8Ij7XYpQgE3NaquhTG6HPdTGgO8k4dlZ+oh1rai3Xu75 yR2D+KNgCLUzmPYmyWpNL4LIjS+bka+lXYx/fbWnd/hyhcN8/xOP5eCWJmh562BMMPKL V0jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557941; x=1712162741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xxVrNOvOe0mPi/BVXSb7kTUlPxIfJx2Q3Oom6CeE+A8=; b=F8pOvOHsLfr/kcjFWi/x+ZNLX8OPqT3k2//pWVHJz0ueXoEJAWU3+wNXzmwC/sHjRk tR7EaQT1XdED56oP5sR+fm9hd6+4SG510BEBp3RgWEcf91O0/2/jcqolEgBIz4S0zEQJ /MDOMWX32Kr2/5q3u9S1QfPsqry+8+BG7xGQISsACaF4WQAeT3xM+qCtB0s+lij332Oz FQSYGS9/v/IWqr6TfVH5LDBMs25Q8zDGZvQBsybv7gTH4+hBI5Mj8BrDV+jQxEEwrxYG wFN1PBCe5nmGtM1ZuFdpU8X7BpRQb4LyVPiuJtx5rinBYaNRA/Qi0AsFcNChNQVQowig 5G8g== X-Gm-Message-State: AOJu0YzYCx9W51pO5w6NGPtFOdiAKuaA55ltD27qPQvl3Zx5hAmRmjwf NDTZhxICbvI0X3w+214dtFgM24HLwXQEbU2toW/Wi7JxTHSgY3UVFB2vcfz3THMM+INH2MSn1rf A X-Received: by 2002:a17:903:18f:b0:1e0:94a1:95c1 with SMTP id z15-20020a170903018f00b001e094a195c1mr318110plg.29.1711557941213; Wed, 27 Mar 2024 09:45:41 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id c4-20020a170903234400b001e20578b524sm858593plh.252.2024.03.27.09.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:40 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 04/15] i386: Use generic fmodf Date: Wed, 27 Mar 2024 13:45:16 -0300 Message-Id: <20240327164527.3717523-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240327164527.3717523-1-adhemerval.zanella@linaro.org> References: <20240327164527.3717523-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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+patch=linaro.org@sourceware.org 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/sysv/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