From patchwork Wed Mar 27 19:40:18 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: 783155 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2375170wrt; Wed, 27 Mar 2024 12:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlA1qFhymS6hNu3kpxQF4H2/TJp/B569z6NcpDS7iOgGU0t39tQMjNGL+/RFzYOw0SiyArkSGZWEi6IkLu72o2 X-Google-Smtp-Source: AGHT+IFLwEp+jiZl1fYzYTkxVW5QEkliNA2kxa9cGXxefQJ6W3T5C6pcYfPTdnQvlZm3HZx8jT3O X-Received: by 2002:a05:6808:ec4:b0:3c3:d6cb:4b3d with SMTP id q4-20020a0568080ec400b003c3d6cb4b3dmr1113551oiv.13.1711568534341; Wed, 27 Mar 2024 12:42:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711568534; cv=pass; d=google.com; s=arc-20160816; b=VOntePnzrWZx5V8/7bYfE+lY06pEj5PfksTOx+p2nP6duvxdjvMBr06mAn9rFmWHU/ ITBTPdt0dYGIpuLXvLTfoaiIjyEqhfYEFrRpn+5bzV9mwPjcMwRLX1qzwJNm7JpBluOc cDjPsJZwZyUehGdcDDtXUE5wJ9fqEPtg7RV+r1zQPtx/sWhACmjXFC3Wd5S/gNRFENy5 Ta/yEWTcnO3e4D+sAwtrw6NWAqFe71qXoJjbyH5RiHM3UamuGqFRgPWGn5qZff/bNNz5 FaykmNtEeNDQ/M9OIUXu8lu60bxwu+1WnTU3+fWvJqXQ1lNks6HF9OClOwB8GvdCycRu +nGg== 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=o5QoHvTSqQQNkoXE7EEgPlhQjQID3TIPWDP1cQ6tkZx+i/ni8A2xcEBYrtp/pDRYm8 x14xWRuy/arW1fguodfZUk+fLoXQJ3WJJOslfxXhsErpKBxS6YxO5a0CSvc6HzGnnulZ 9Wd5dsz+0OWAkrkCYdqAC7HTeDOdydlfde2kcjAKFyqIxKO9I4NA+cjw/KiWJxUiU+Ki TCKVKos42iCHYCkwzi9mx+B4r2bHTb9vGO+Ny0BS7GZ/ZHb8Iscch9tq+17OMKpDFR4z MCHyLdw7VcCmAbjzb4LWJgnVwUeKTLF05psaX0J/QHjzJGWyHwi6hiDZb3xPhBw6rMRp GSuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dgkNLtdm; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id u34-20020a05622a19a200b00431627ee3a7si5982496qtc.118.2024.03.27.12.42.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dgkNLtdm; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 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 E8467385E830 for ; Wed, 27 Mar 2024 19:42:13 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 8F30B385DC0F for ; Wed, 27 Mar 2024 19:40:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F30B385DC0F 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 8F30B385DC0F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568442; cv=none; b=nElRzcrFwaxAEbJ0Kji/7GBVAVr4j0Moj8T+Fv3IYRXIwWEQZxmjXnqTJZrPqPsAfzaRF5beAKNSVJ6DPL8GGPz0zwQnFX0hsmbI7WBFQuoON6ZPSx5JesxWBsdPt34w7t9QTMqxaJfE1yHIWMpHP/Dv+Xrzt05r4tSUkMXok4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568442; c=relaxed/simple; bh=Lj4xaog2tdjPc2qDBaWYQmFkmaPXpB5xrXtcNLqjTv8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=MGJAdQ7dKsbhwY+XqHbPMmtGbvHbVd/PeJxDOP+erGVdv195PbWOM9ClyYIBkQlRI0k5Mw7pKixjR5YHtVcIJJF+bU8mqlfmtY+MBq0t0LbZZ9TAKuL9/zRF5TFXiGJL0xtlkhBYE6YIkGh0y4FnmC7mdV28lSIrAiECRI56rl4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso71945a12.2 for ; Wed, 27 Mar 2024 12:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711568438; x=1712173238; 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=dgkNLtdmk5dChd/ogS32q/1rhlS4XoOFTBnaQayoEbcOJWKwYTErws/ubnmDYUzRXf Jhpp8PGz4OoeY+gdVvnBuDn3aR/tzp4ghRuhzjool/ldIaKlTX7Auak4kM/oHJ9VZBxa 2+dw1W9bQmrzWGriLB370A8//rk+ZEmk08I0GL0UNpjiy4tFwiDkxkE5lTPdYdmDLYb5 yQG5o1uE9jHlHiQ6dsOAmEdYvGM/Qcj3T1u1AcxqnOINe7yf9SaOLYx6Jtps/Sz/SNID eWZCGV+GJBAgtL3b+DS1MtIn5f99r6l0jtqHbFMt6afNk16Ntm/bFWI2BZxp+NI23owJ IvJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711568438; x=1712173238; 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=D1KbrLofB6iafR7Bs1JGqHIaWNhwbxn4BSLJ0mQUB5Hqf0aZY1NJWOiPPnemZ5l20n nOCL0+XALDf73h0IHe/WgGNB1qFKudOIT3bBznsoe0+AirmedjR8G20nxRV+GZ8+flTT IwCH/fEpnt+bV1dWy4SeAiEbtbpq8CENtjVraFoKgUqmVZAleo8/BAFhk83u2SEtyrBm hrVLzhg45hWxvc/Tgt8ogo3Au6N6t1HkwbFtltyghBJ4D4gDUjUCkji3YOh3/ASrz64n RBIdUrqf+F6WBUUCeWM8MPib29AMiUpb+No9vvVGyUadPeyMuJplAiLpZzoESlp/ncgh pruw== X-Gm-Message-State: AOJu0Yzt1qT3Q6aZY41U1h/O8r/Mik6lxSksD0OUQQ4arNeKDfrXOGxi McCyXsnE+w4GH6uGGNsiAkrjSSpTQyeTAXBwGBAkuCKMq++NB3HzKmey6X5yBNbFXbZ1tY+EV0f P X-Received: by 2002:a17:90a:df18:b0:29b:b28d:ac66 with SMTP id gp24-20020a17090adf1800b0029bb28dac66mr773158pjb.5.1711568437832; Wed, 27 Mar 2024 12:40:37 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id p11-20020a17090a348b00b002a091be027esm2277357pjb.31.2024.03.27.12.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:40:37 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH v2 04/10] i386: Use generic fmodf Date: Wed, 27 Mar 2024 16:40:18 -0300 Message-Id: <20240327194024.1409677-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> References: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 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