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 6F4F01F44D for ; Wed, 27 Mar 2024 16:48:56 +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=AhAZ6ucF; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B000F3858427 for ; Wed, 27 Mar 2024 16:48:55 +0000 (GMT) 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-Google-Smtp-Source: AGHT+IEdDSJZWHJc7KjzZ8ky9M//DSPf1Gu1XimCh6AR8a+zTxsnOanydgYHVDicvuven+uHEp7KCA== 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 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 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 -- 2.34.1