From patchwork Wed Mar 27 16:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87711 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 352AF385DC0F for ; Wed, 27 Mar 2024 16:46:12 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 0EAC63858C98 for ; Wed, 27 Mar 2024 16:45:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0EAC63858C98 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 0EAC63858C98 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=1711557939; cv=none; b=gRMbtXnwvvePhdV+b5NCWuWHw3wmZwfzVQtTD3CUy/ojotsE2zW2OcV6nUWDL3MddQVpRdSzI+u/u1qsdXW6vM0mT8Gz+pz+Uv2WhrWO2wVZTQid5U47rn5nsKwVfIoyhVvkG9HlL+I9pXHea6mVT3OxHOcVIixlsUh72ftulBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557939; c=relaxed/simple; bh=TmwJdU86itK5iLqvFT7K3Lwmv+jwRtk0S1NFuax1vdY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ZKYYZs2fIvuU8R48TRAIKupU7sIb95jRvcjchUUW0pox+KAb/U20RmWPCC5aVI3jFYyy3GFC8tky/9SglTmTEO/kWKNybFv/C9EHKeKYnLpqcdxwI+223RDXh5MpeGE+JyxEfpyAGshlWxMfkmz5NNTTQMYBfhG44oobkcIUu2Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1df01161b39so183525ad.3 for ; Wed, 27 Mar 2024 09:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557935; x=1712162735; 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=xM0bEaL2ABl3Ls/8bCAVCkPzu+hbOKNXOxMT6+5zfns=; b=UhQSFrywfaN1rYBPPVNjDTWWwg23sI4mzZAURGhVin1BWRvEnBmDPJNa+CMkBYtIZy EL3AiORIkDatXcdZk3zKNV4dCFTNVAqJz3ThVrYR3OtwHiKU7aO7yjndk17yP60qNVI8 s6Uj/YvbKY429OMAI/p/Eog0RROcoMvvrXuSebom4ILhipe8r8XdtdTwACcRZNgcZnoT SWh8ElKnAUsmQ/FpTWKX6dYju9WzXLmlaZ5uU/J8luKkS0gHKKsjOVkQZkM5EAqbQGCB 7ZgO5MD40sYpIm9dvlX8HZx+8j/KNWT2waVvEaLwTYHYXQrq86fkOrbWvUkFDJq2RtFw 4YUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557935; x=1712162735; 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=xM0bEaL2ABl3Ls/8bCAVCkPzu+hbOKNXOxMT6+5zfns=; b=egAfKxsjqrX6WWvNqty43nSJ3HfXsm7xa8BLumnaF1hgTIb1fSou/ny0hu7eQoJQc/ uHIcT6Snr9FoUBnBL+kNDZLYHvhm/fFwSL2BMhnIk+hcfO7PSIMpoc1vnHwUNdCET05Q nKaj9ZrSANEr2BdtAk0ySpBXLQtr52YeyDGucW40JU+LSn+YtB4Ss9tqGxS3wy4kjW3T vVRZb3wTnZlDLJYzA4b+4vXg2S1Xy/W9gBLHvyavZQydBjleWV/pwaMLhn48e1077CBL XCe3aZ5D3+BFQYcpU1JZqZGwb4tW6lyNqq7AoVRL7sts2b0yWjumMaCwOh30AB6LVzhH 8aSw== X-Gm-Message-State: AOJu0Yy2pO8MehvbzrUsGJ0kTHey7cLmhoCDczLFeLiWydtAdFEfgnIQ pKGHKk311AjHaPcp/z7C4jFuL9QP1H/oo6ZuWFmmavplRBA5IlR2O9vjpJ5id9SrhNdHOz2YcEV g X-Google-Smtp-Source: AGHT+IF8zv1dhgNkd1lvZ3684cR12a0PfggiqBIlj9AVHFCdD8+CQOzzGqRFlC/B4BLpyHub5tG5dg== X-Received: by 2002:a17:902:d58f:b0:1de:faa5:552 with SMTP id k15-20020a170902d58f00b001defaa50552mr184641plh.56.1711557934903; Wed, 27 Mar 2024 09:45:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:34 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 01/15] math: Add support for auto static math tests Date: Wed, 27 Mar 2024 13:45:13 -0300 Message-Id: <20240327164527.3717523-2-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.1 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+patchwork=sourceware.org@sourceware.org It basically copy the already in place rules for dynamic tests for auto-generated math functions for all support types. To avoid the need to duplicate .inc files, a .SECONDEXPANSION rules is adeed for the gen-libm-test.py generation. New tests should be added on the new rules 'libm-test-funcs-auto-static', 'libm-test-funcs-noauto-static', and 'libm-test-funcs-narrow-static'; similar to the non-static counterparts. --- math/Makefile | 103 +++++++++++++++++++++++++++++++++++- math/test-double-static.h | 1 + math/test-float-static.h | 1 + math/test-float128-static.h | 1 + math/test-float32-static.h | 1 + math/test-float32x-static.h | 1 + math/test-float64-static.h | 1 + math/test-float64x-static.h | 1 + math/test-ibm128-static.h | 1 + math/test-ldouble-static.h | 1 + 10 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 math/test-double-static.h create mode 100644 math/test-float-static.h create mode 100644 math/test-float128-static.h create mode 100644 math/test-float32-static.h create mode 100644 math/test-float32x-static.h create mode 100644 math/test-float64-static.h create mode 100644 math/test-float64x-static.h create mode 100644 math/test-ibm128-static.h create mode 100644 math/test-ldouble-static.h diff --git a/math/Makefile b/math/Makefile index 79ef4ebb65..fb537955fb 100644 --- a/math/Makefile +++ b/math/Makefile @@ -274,8 +274,10 @@ endif libm-vec-tests = $(addprefix test-,$(libmvec-tests)) libm-test-support = $(foreach t,$(test-types),libm-test-support-$(t)) -test-extras += $(libm-test-support) -extra-test-objs += $(addsuffix .o, $(libm-test-support)) +libm-test-support-static = $(foreach t,$(test-types),libm-test-support-$(t)-static) +test-extras += $(libm-test-support) $(libm-test-support-static) +extra-test-objs += $(addsuffix .o, $(libm-test-support)) \ + $(addsuffix .o, $(libm-test-support-static)) libm-vec-test-wrappers = $(addsuffix -wrappers, $(libm-vec-tests)) test-extras += $(libm-vec-test-wrappers) extra-test-objs += $(addsuffix .o, $(libm-vec-test-wrappers)) @@ -364,6 +366,63 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ $(make-target-directory) $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out$* -C $@ + +libm-test-funcs-auto-static = +libm-test-funcs-noauto-static = +libm-test-funcs-narrow-static = +libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static) + +libm-test-c-auto-static = $(foreach f,$(libm-test-funcs-auto-static),libm-test-$(f)-static.c) +libm-test-c-noauto-static = $(foreach f,$(libm-test-funcs-noauto-static),libm-test-$(f)-static.c) +libm-test-c-narrow-static = $(foreach f,$(libm-test-funcs-narrow-static),\ + libm-test-narrow-$(f)-static.c) +generated += $(libm-test-c-auto-static) $(libm-test-c-noauto-static) $(libm-test-c-narrow-static) + +libm-tests-normal-static = $(foreach t,$(libm-tests-base-normal),\ + $(foreach f,$(libm-test-funcs-all-static),\ + $(t)-$(f)-static)) +libm-tests-narrow-static = $(foreach t,$(libm-tests-base-narrow-static),\ + $(foreach f,$(libm-test-funcs-narrow-static),\ + $(t)-$(f)-static)) +libm-tests-vector-static = $(foreach t,$(libmvec-tests-static),\ + $(foreach f,$($(t)-funcs),test-$(t)-$(f)-static)) +libm-tests-static = $(libm-tests-normal-static) $(libm-tests-narrow-static) $(libm-tests-vector-static) +libm-tests-for-type-static = $(foreach f,$(libm-test-funcs-all-static),\ + test-$(1)-$(f)-static test-i$(1)-$(f)-static) \ + $(filter test-$(1)-%,$(libm-tests-vector-static) \ + $(libm-tests-narrow-static)) + +libm-tests.o += $(addsuffix .o,$(libm-tests-static)) + +tests-static += $(libm-tests-static) +generated += $(addsuffix .c,$(libm-tests)) \ + $(foreach t,$(test-types),libm-test-support-$(t)-static.c) + +libm-test-c-auto-obj-static = $(addprefix $(objpfx),$(libm-test-c-auto-static)) +libm-test-c-noauto-obj-static = $(addprefix $(objpfx),$(libm-test-c-noauto-static)) +libm-test-c-narrow-obj-static = $(addprefix $(objpfx),$(libm-test-c-narrow-static)) + +# Use the same input test definitions for both dynamic and static tests. +.SECONDEXPANSION: +$(libm-test-c-noauto-obj-static): $(objpfx)libm-test%.c: libm-test$$(subst -static,,%).inc \ + gen-libm-test.py + $(make-target-directory) + $(PYTHON) gen-libm-test.py -c $< -a /dev/null -C $@ + +.SECONDEXPANSION: +$(libm-test-c-auto-obj-static): $(objpfx)libm-test%.c: libm-test$$(subst -static,,%).inc \ + gen-libm-test.py \ + auto-libm-test-out$$(subst -static,,%) + $(make-target-directory) + $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out`echo $* | sed 's/-static//'` -C $@ + +.SECONDEXPANSION: +$(libm-test-c-narrow-obj-static): $(objpfx)libm-test%.c: libm-test$$(subst -static,,%).inc \ + gen-libm-test.py \ + auto-libm-test-out$$(subst -static,,%) + $(make-target-directory) + $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out`echo $* | sed 's/-static//'` -C $@ + # Tests for totalorder compat symbols reuse the table of tests as # processed by gen-libm-test.py, so add dependencies on the generated # .c files. @@ -505,6 +564,18 @@ $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c: echo "#include "; \ ) > $@ +$(foreach t,$(libm-tests-normal-static),$(objpfx)$(t).c): $(objpfx)test-%.c: + type_func=$*; \ + type=$${type_func%%-*}; \ + func=$${type_func#*-}; \ + ( \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + echo "#include "; \ + ) > $@ + $(foreach t,$(libm-tests-narrow),$(objpfx)$(t).c): $(objpfx)test-%.c: type_pair_func=$*; \ type_pair=$${type_pair_func%-*}; \ @@ -539,6 +610,13 @@ $(foreach t,$(test-types),\ echo "#include "; \ ) > $@ +$(foreach t,$(test-types),\ + $(objpfx)libm-test-support-$(t)-static.c): $(objpfx)libm-test-support-%.c: + ( \ + echo "#include "; \ + echo "#include "; \ + ) > $@ + $(addprefix $(objpfx), $(libm-tests.o)): $(objpfx)libm-test-ulps.h define o-iterator-doit @@ -548,6 +626,13 @@ endef object-suffixes-left := $(libm-tests-base) include $(o-iterator) +define o-iterator-doit +$(foreach f,$(libm-test-funcs-all-static),\ + $(objpfx)$(o)-$(f)-static.o): $(objpfx)$(o)%.o: $(objpfx)libm-test%.c +endef +object-suffixes-left := $(libm-tests-base) +include $(o-iterator) + define o-iterator-doit $(foreach f,$(libm-test-funcs-narrow),\ $(objpfx)$(o)-$(f).o): $(objpfx)$(o)%.o: \ @@ -563,6 +648,13 @@ endef object-suffixes-left := $(libm-tests-base-normal) include $(o-iterator) +define o-iterator-doit +$(foreach f,$(libm-test-funcs-all-static),\ + $(objpfx)$(o)-$(f)-static.o): CFLAGS += $(libm-test-no-inline-cflags) +endef +object-suffixes-left := $(libm-tests-base-normal) +include $(o-iterator) + define o-iterator-doit $(foreach f,$(libm-test-funcs-narrow),\ $(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-no-inline-cflags) @@ -584,6 +676,13 @@ endef object-suffixes-left := $(test-types) include $(o-iterator) +define o-iterator-doit +$(addprefix $(objpfx),\ + $(call libm-tests-for-type-static,$(o))): $(objpfx)libm-test-support-$(o)-static.o +endef +object-suffixes-left := $(test-types) +include $(o-iterator) + define o-iterator-doit $(objpfx)libm-test-support-$(o).o: CFLAGS += $(libm-test-no-inline-cflags) endef diff --git a/math/test-double-static.h b/math/test-double-static.h new file mode 100644 index 0000000000..d53f46819f --- /dev/null +++ b/math/test-double-static.h @@ -0,0 +1 @@ +#include "test-double.h" diff --git a/math/test-float-static.h b/math/test-float-static.h new file mode 100644 index 0000000000..7834c9e1f1 --- /dev/null +++ b/math/test-float-static.h @@ -0,0 +1 @@ +#include "test-float.h" diff --git a/math/test-float128-static.h b/math/test-float128-static.h new file mode 100644 index 0000000000..5f8206456a --- /dev/null +++ b/math/test-float128-static.h @@ -0,0 +1 @@ +#include "test-float128.h" diff --git a/math/test-float32-static.h b/math/test-float32-static.h new file mode 100644 index 0000000000..2df27d1ca0 --- /dev/null +++ b/math/test-float32-static.h @@ -0,0 +1 @@ +#include "test-float32.h" diff --git a/math/test-float32x-static.h b/math/test-float32x-static.h new file mode 100644 index 0000000000..62f78b49d8 --- /dev/null +++ b/math/test-float32x-static.h @@ -0,0 +1 @@ +#include "test-float32x.h" diff --git a/math/test-float64-static.h b/math/test-float64-static.h new file mode 100644 index 0000000000..807c174df1 --- /dev/null +++ b/math/test-float64-static.h @@ -0,0 +1 @@ +#include "test-float64.h" diff --git a/math/test-float64x-static.h b/math/test-float64x-static.h new file mode 100644 index 0000000000..a7801dbc10 --- /dev/null +++ b/math/test-float64x-static.h @@ -0,0 +1 @@ +#include "test-float64x.h" diff --git a/math/test-ibm128-static.h b/math/test-ibm128-static.h new file mode 100644 index 0000000000..b66a57050b --- /dev/null +++ b/math/test-ibm128-static.h @@ -0,0 +1 @@ +#include "test-ibm128.h" diff --git a/math/test-ldouble-static.h b/math/test-ldouble-static.h new file mode 100644 index 0000000000..beabedb817 --- /dev/null +++ b/math/test-ldouble-static.h @@ -0,0 +1 @@ +#include "test-ldouble.h" From patchwork Wed Mar 27 16:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87714 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A9FB385843A for ; Wed, 27 Mar 2024 16:47:15 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id B96413858C36 for ; Wed, 27 Mar 2024 16:45:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B96413858C36 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 B96413858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557940; cv=none; b=eTwwis9yVzhoUXoo5HPepNqwTQHBgoNpFkwYQtsfxfA2/9OyqQ08ACb4dDpgrY/Uy9h1UXEyUjpHHCejhqhvsGz41Wkvdb4JqOaX/dFVbI7ShUriAxLWMVVuBNfLGN7JpRCNvhFQ3ZbvSCqLANTg6zPdHLV4tXJhGb5xWFH41gU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557940; c=relaxed/simple; bh=4aR3m2SjWqChSXYKCt63Vv0Bjg6RMaEe6T3zRnV9swU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=X11Wqn0Qc/2kkaZi1BJbAK43ItJoBegJGIvumjJOBuEhmR0OXlWSAqfU45F/Jc3xA7ZCHlKyWmwvuIwTsDJULXB3cwxJYhGA78ArL74cCTvfQd5n6d+mNIqFhIOm18xKgqyYG6FIgQ2SwF37HVwXYyPXTu3wJ8rVyty84KJdYSE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1df01161b39so183865ad.3 for ; Wed, 27 Mar 2024 09:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557937; x=1712162737; 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=HTwxuMR5ucDSMpp4J0Kk3EI0Ie85RaR9Xaq7XFWHhq0=; b=G+QGS+wqM4Waw5uQXeOZK977hREhvems3Ifzh+b//aL9w/l3NRqey+f90/dB05pFof /OMvj2VAT+qSFSYlLDWU6o4jdYm8abP/SRhK2p78FgL0AtbNkwyyk0dTk8SydcFW5hBM ozjb4wrPqJANc9TDvhfQEqUNkWzAi6B/+9T38Pl494n3nuCaAnQvwLiO7CzXxWmNaSs4 tbAKcaS3FD/8eI7RZaQvqGKiyRBZWVj3hXhjHH032wTDAr88FZlDU9HGI5KGF9iKJESR dWU4zg81zI/7VLh+/3XdTRGU4MbzNf2xzspI5JB2C1SGDAOZ9mgQVrmJdKbIdiKOzkqc 2iFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557937; x=1712162737; 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=HTwxuMR5ucDSMpp4J0Kk3EI0Ie85RaR9Xaq7XFWHhq0=; b=LcBTWtp3z+tYfm0Le83w/Lsi7AD83HNfFLSvLB9Utr9PkdvHaUFolxTYYiC9T5Fg45 M2QYoxGKJcrIxDs1xsvd7gjnQJwa//FsbhkUFxe+2l/uf9Vg3KO2/FYaTkxw+o++2K0D 5oJ/35hKvUJ/RTiX78XFJPBzMvG9zP0sd1gs87/oGweAovuwF1GqgXi1PFVoyRJBAPvO bmo1BTRL2ytJgu8t7Ax2z/CfU58u4vrH/KLxqzDH5q4S9l9RzUiHNUuEWRSa428JykT3 0pd83e80OLxH4dbKl5UZRllfZ2B54Mm02SelTJH/qFTKZlVG4fLuaCW7wX9bCLCuYiTP brgQ== X-Gm-Message-State: AOJu0Yys7Jm3UgK0ilh9zGytGSekpOu0VXlDMbS4xL9AfjV4tvy0IwvR /FjTXtes17NTmDoPSVbJwvFRg+XA5Ws741yxSVNlgJwgokkMsao4rCtQI3r1rz183nBSijQv2PT k X-Google-Smtp-Source: AGHT+IFN0l6fGdT5G6cUn7kGhSY7bPyKfLMqhe8KyUUVgjhxSsqAb1cLauFfChihSIcCU3FEWHdk2g== X-Received: by 2002:a17:902:f54a:b0:1e0:fc73:8f81 with SMTP id h10-20020a170902f54a00b001e0fc738f81mr282804plf.64.1711557936997; Wed, 27 Mar 2024 09:45:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:36 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 02/15] math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) Date: Wed, 27 Mar 2024 13:45:14 -0300 Message-Id: <20240327164527.3717523-3-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.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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+patchwork=sourceware.org@sourceware.org The commit 16439f419b removed the static fmod/fmodf on i386 and m68k with and empty w_fmod.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_fmod{f}_compat.c implementation. To statically build fmod fails on some ABI (alpha, s390, sparc) because it does not export the ldexpf128, this is also fixed by this patch. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. --- math/Makefile | 4 +++- sysdeps/i386/fpu/w_fmod_compat.c | 7 ++++--- sysdeps/i386/fpu/w_fmodf_compat.c | 7 ++++--- sysdeps/ieee754/ldbl-opt/s_ldexpl.c | 4 ++-- sysdeps/m68k/m680x0/fpu/w_fmod_compat.c | 5 +++-- sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c | 7 ++++--- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/math/Makefile b/math/Makefile index fb537955fb..964bf2be71 100644 --- a/math/Makefile +++ b/math/Makefile @@ -368,7 +368,9 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = -libm-test-funcs-noauto-static = +libm-test-funcs-noauto-static = \ + fmod \ + # libm-test-funcs-noauto-static libm-test-funcs-narrow-static = libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static) diff --git a/sysdeps/i386/fpu/w_fmod_compat.c b/sysdeps/i386/fpu/w_fmod_compat.c index 5ac9995ffd..528bfc2a13 100644 --- a/sysdeps/i386/fpu/w_fmod_compat.c +++ b/sysdeps/i386/fpu/w_fmod_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif -#include -#ifdef SHARED +# include libm_alias_double (__fmod_compat, fmod) +#else +#include +#include #endif diff --git a/sysdeps/i386/fpu/w_fmodf_compat.c b/sysdeps/i386/fpu/w_fmodf_compat.c index cc417e07d3..5a61693e51 100644 --- a/sysdeps/i386/fpu/w_fmodf_compat.c +++ b/sysdeps/i386/fpu/w_fmodf_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif -#include -#ifdef SHARED +# include libm_alias_float (__fmod_compat, fmod) +#else +#include +#include #endif diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c index 1afbe7d8ad..932cc4341c 100644 --- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c +++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c @@ -17,13 +17,13 @@ License along with the GNU C Library; if not, see . */ -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED # define declare_mgen_alias(f,t) #endif #include #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED long_double_symbol (libc, __ldexpl, ldexpl); long_double_symbol (libc, __wrap_scalbnl, scalbnl); #endif diff --git a/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c b/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c index 527d4fbed2..57f38091e6 100644 --- a/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c +++ b/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif #include -#ifdef SHARED libm_alias_double (__fmod_compat, fmod) +#else +#include +#include #endif diff --git a/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c b/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c index 5043586b91..88db07f443 100644 --- a/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c +++ b/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif -#include -#ifdef SHARED +# include libm_alias_float (__fmod_compat, fmod) +#else +#include +#include #endif From patchwork Wed Mar 27 16:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87718 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 772FC385C6EE for ; Wed, 27 Mar 2024 16:48:03 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 9E4973858C31 for ; Wed, 27 Mar 2024 16:45:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E4973858C31 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 9E4973858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557942; cv=none; b=EOITG7JpkPHkXnuna3s4prxcAL2328tlauiJCuA1sttRsf89fKJ7CLwJ7MeQtvdgmI4AJna9oQNE0OWVNMDcqytKIdgFH25RxJdb9Ar8V5Y4QSfefiBiZNam1AtBT4RDwEnRIf8X5aqAYFdQfPBCHQ7BALLVhG13D77NEm+0owc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557942; c=relaxed/simple; bh=FWgJkfkwseYq7F5C+DGVquhkJLx5vPNk1M7TtjMJhC8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=bfba0OnOFDFmfORSg32SLmynu077EYRyK07WlSKVgQspDZqzWN4yMNS3eVP6hmoLeiv5IA2LGlbICT5NgD41ytzxyYp4VkOk+80oyp1QKkKCiSu21Fr6Ky9PZb7QQzz1rN/m9sQXjRrkXQdsAd7FbBuZZUXnalO1WXluMbWVNtw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1e00d1e13a2so348705ad.0 for ; Wed, 27 Mar 2024 09:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557939; x=1712162739; 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=dcR2ma1WvOPlvqy70XySXYoVacImk32cK9Z3i7CYpHc=; b=T/ag9lzp8BhYPPqYv/Et32+F3/qXuC51KQfFyy/ncxb1jo5WDaJNIpJMrF5P2ZdkMZ B0hdRKoy0nuvJfMqKO7jhavlEfzC2as9G626geU2B5Rv5mI/4J3FCXLo58qgCney2Vqj uPbYNDLPbM790CVtbCaC7rC8SypZ+U/F69QXaOlclhO3vSxaaiAD1dCz6vOn9q0Jwd00 7NTJKHe5JaC34eT73FCuc9ReO7OLNOQXgcIUGIxyZxYGO9pQx4ybC4VnLCabbgYh+LOl G5zJiu9oLWhneAOH0DUqyFrIQvUcRHZIkS77PZcqOuw6L8VDZScCrmY14T/NDYaBbCtY zzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557939; x=1712162739; 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=dcR2ma1WvOPlvqy70XySXYoVacImk32cK9Z3i7CYpHc=; b=rvBOXVw5+IZcgfl3qKtmefG5rDXWP394IB9xngjMuLS+2Ia6ZFZA7lsstMQlMgXMA6 4Pq2TxRObnYFhkYDhkyUmHaqtkaqQDxtAZShoCVTTH9+dwdL9wr70HEK+9DXSlcON6Tg nQsxyJqwR3apxrT88GJA9THtnpXntSJL8CVkE7b1F1I7jLXPqskvTNs2BwO3EWYaZfFV UWn6FF6dosgzEdvSv16CtGsF04wLWXb3W2+E3OKPRrvSX9j+SDLwCEQ6HgxG4McG/a4M ILAp31fk0j9JcqpjIz9DIVw1HWjX4USQK9Rt3g6Xvg0hFkz/4EqhbIe+hJwFgsyqYX2B gT8g== X-Gm-Message-State: AOJu0Yzl1ydRWECiSc2+tuU04ZzDud88vUH5SfQl81VGvnryo7pqD+o0 1DWbX6qDuNFGkr94p76LqkybXzU7Qwqecy6otxJBn+Yo26WX5FbblOU2JHI+MybKp7QY+YZ0x/F o X-Google-Smtp-Source: AGHT+IEIXil2l4UkK19Q5vdu102nIcVv0DXYGmc+sHCObP36bvDZTGJXzxv1cPL1OBgB8ixn03sMCQ== X-Received: by 2002:a17:902:fc4c:b0:1e0:f6de:afae with SMTP id me12-20020a170902fc4c00b001e0f6deafaemr243936plb.57.1711557939104; Wed, 27 Mar 2024 09:45:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:38 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 03/15] i386: Use generic fmod Date: Wed, 27 Mar 2024 13:45:15 -0300 Message-Id: <20240327164527.3717523-4-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.4 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+patchwork=sourceware.org@sourceware.org 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; + } } diff --git a/sysdeps/i386/fpu/e_fmod.S b/sysdeps/i386/fpu/e_fmod.S deleted file mode 100644 index 86ac1bcfaf..0000000000 --- a/sysdeps/i386/fpu/e_fmod.S +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Public domain. - */ - -#include -#include - -ENTRY(__ieee754_fmod) - fldl 12(%esp) - fldl 4(%esp) -1: fprem - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret -END (__ieee754_fmod) -libm_alias_finite (__ieee754_fmod, __fmod) diff --git a/sysdeps/i386/fpu/e_fmod.c b/sysdeps/i386/fpu/e_fmod.c new file mode 100644 index 0000000000..3625758f97 --- /dev/null +++ b/sysdeps/i386/fpu/e_fmod.c @@ -0,0 +1,2 @@ +#define FMOD_VERSION GLIBC_2_40 +#include diff --git a/sysdeps/i386/fpu/math_err.c b/sysdeps/i386/fpu/math_err.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/i386/fpu/math_err.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/i386/fpu/w_fmod_compat.c b/sysdeps/i386/fpu/w_fmod_compat.c deleted file mode 100644 index 528bfc2a13..0000000000 --- a/sysdeps/i386/fpu/w_fmod_compat.c +++ /dev/null @@ -1,15 +0,0 @@ -/* i386 provides an optimized __ieee752_fmod. */ -#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_double (__fmod_compat, fmod) -#else -#include -#include -#endif diff --git a/sysdeps/ieee754/dbl-64/e_fmod.c b/sysdeps/ieee754/dbl-64/e_fmod.c index b33cfb1223..7651cd212a 100644 --- a/sysdeps/ieee754/dbl-64/e_fmod.c +++ b/sysdeps/ieee754/dbl-64/e_fmod.c @@ -175,7 +175,10 @@ __fmod (double x, double y) strong_alias (__fmod, __ieee754_fmod) libm_alias_finite (__ieee754_fmod, __fmod) #if LIBM_SVID_COMPAT -versioned_symbol (libm, __fmod, fmod, GLIBC_2_38); +# ifndef FMOD_VERSION +# define FMOD_VERSION GLIBC_2_38 +# endif +versioned_symbol (libm, __fmod, fmod, FMOD_VERSION); libm_alias_double_other (__fmod, fmod) #else libm_alias_double (__fmod, fmod) diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist index 8f40ddb150..30665f8b1a 100644 --- a/sysdeps/mach/hurd/i386/libm.abilist +++ b/sysdeps/mach/hurd/i386/libm.abilist @@ -1181,3 +1181,4 @@ GLIBC_2.35 fsqrt F GLIBC_2.35 fsqrtl F GLIBC_2.35 hypot F GLIBC_2.35 hypotf F +GLIBC_2.40 fmod F diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist index 5d89aaa08e..44932f111d 100644 --- a/sysdeps/unix/sysv/linux/i386/libm.abilist +++ b/sysdeps/unix/sysv/linux/i386/libm.abilist @@ -1188,3 +1188,4 @@ GLIBC_2.35 fsqrt F GLIBC_2.35 fsqrtl F GLIBC_2.35 hypot F GLIBC_2.35 hypotf F +GLIBC_2.40 fmod F 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 X-Patchwork-Id: 87721 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E2B93858286 for ; Wed, 27 Mar 2024 16:48:58 +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-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 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+patchwork=sourceware.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 From patchwork Wed Mar 27 16:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87715 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 519BA385EC49 for ; Wed, 27 Mar 2024 16:47:18 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id ADD41385DC06 for ; Wed, 27 Mar 2024 16:45:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ADD41385DC06 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 ADD41385DC06 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557947; cv=none; b=vYt8G43EPQTEuKXz/o7AlbQabfGtE0s3Yv15XEpRoV4ihve4+PVbzkJhuJzquokeqaT+xejPI9s1FVEtyaiUV1l2XifNdKT8PHMB2NsC+6NVk8Sn3K6onUTjoHYIv4KZSZlDoNE27bI7EIl9YQQVNBe8Yu5Gufk7jesiepnWruo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557947; c=relaxed/simple; bh=wHbvmdicYImSDZMFciUEE4a81Gu6In5X3H4kMS5X25o=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=A343zw8oKPZScG4VA72PisO7LK3oVMNv+JN880Zgrmkvb9GhWggIDZZjIKIMRblKmxeuZGQjIHu5ws/KMozWt5QKnSF0aoiZA4kT4F+s9nCXxcG91R5GmbVmE8Q/x5kfSuhKEy7lfqNOOXjLNgwUN8y8Rk6XGFzXh3YFphQ3A9Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1e0f0398553so219435ad.3 for ; Wed, 27 Mar 2024 09:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557943; x=1712162743; 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=DnjP5zBH6db4XAECtZPSD0FlQ9mZafYAi0YvzhHcxqE=; b=eoggeu2pajrwq6XsMiZTIqfjXbqlbNWI3Ku3COc9xFVprjc6iHcXxoMXINMChRMPhH PFIfSCwyjP7KhKIFdWwzciLwxMk//tcv5yqutLp1dHYPjNyuyzmcD/KYFqLpTi4FXn5G Y8kj5ySHonOT7Txn9Noq17M49ti3ivp9t7L75eVkMUnY3lX3w11nRkmhUcIvv+RxMV0w yQDShGb3HHdBaxCk7oqXSxV1xRxs25ytv9wvMs14Eh4qLeNztyZUqvjMVK3xhCl+bSTy ybh4Yz6sbsTkLg7NQDw114yqHdVPRi/D3clDU1ciUrR5kZttaMQtEJztayldRSusU0fo 4/Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557943; x=1712162743; 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=DnjP5zBH6db4XAECtZPSD0FlQ9mZafYAi0YvzhHcxqE=; b=gcg08ZILpvYV4h44MU5CXByx0zGrimA0okLJ7di0qVQ4Oz/gLJoCYBVKFZaLKytSMJ Pts6sMiSkRNDi8DigY3YVX0OGp00WxdybSFM1wRNUhSO1xUVBhPN0NP8zrZKttEQvEnK wl9SfPn9J0QUtdBLUIKTC7g0KwpIAfJE/zUJxFW8uYW7OZaXXeCubfxT68AkHrvY7QG0 3FeYUNQs14FiJw4fxJJ6EAruNEcOTiFdXx9/QSJYyfTP8s1wTJlfnQd3s0d5nBgmjVk/ uqbViKKlboBkP9Q+SfGLl2+nabc30YqChzsiu8iead6Fhq3jJ8yE4NzR4O26N6tQ89BP LHsw== X-Gm-Message-State: AOJu0Yxpd6ZTeBiUzV5e95aLSWkQ/gNoQNDqtQrXCEwW3wz59x6YVdMh eUJiFDZHZVHIiiXKmOz1EDb1Fx3BQ/0p5hcST0jNfWJE/02wU0511An5N5FIyHN6zk7c1E4nOHN O X-Google-Smtp-Source: AGHT+IGM3YsAz47+opOp0GyD8VlFX4zSAfLFAuhyTnk1N/sqI6n7x+qdNFmqV0jykl6XYjNexGOfOw== X-Received: by 2002:a17:903:32c9:b0:1e1:a74:5531 with SMTP id i9-20020a17090332c900b001e10a745531mr293798plr.36.1711557943264; Wed, 27 Mar 2024 09:45:43 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:42 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 05/15] math: Fix i386 and m68k exp10 on static build Date: Wed, 27 Mar 2024 13:45:17 -0300 Message-Id: <20240327164527.3717523-6-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.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+patchwork=sourceware.org@sourceware.org The commit 08ddd26814 removed the static exp10 on i386 and m68k with an empty w_exp10.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_exp{f}_compat.c implementation. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. --- math/Makefile | 4 +++- sysdeps/i386/fpu/w_exp10_compat.c | 9 +++++++-- sysdeps/m68k/m680x0/fpu/w_exp10_compat.c | 9 +++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/math/Makefile b/math/Makefile index 964bf2be71..f1d210797d 100644 --- a/math/Makefile +++ b/math/Makefile @@ -367,7 +367,9 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out$* -C $@ -libm-test-funcs-auto-static = +libm-test-funcs-auto-static = \ + exp10 \ + # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ fmod \ # libm-test-funcs-noauto-static diff --git a/sysdeps/i386/fpu/w_exp10_compat.c b/sysdeps/i386/fpu/w_exp10_compat.c index b53455386e..49a0e03385 100644 --- a/sysdeps/i386/fpu/w_exp10_compat.c +++ b/sysdeps/i386/fpu/w_exp10_compat.c @@ -1,3 +1,8 @@ /* i386 provides an optimized __ieee754_exp10. */ -#define NO_COMPAT_NEEDED 1 -#include +#ifdef SHARED +# define NO_COMPAT_NEEDED 1 +# include +#else +# include +# include +#endif diff --git a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c index 0d3e718626..350f2e4b4d 100644 --- a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c +++ b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c @@ -1,3 +1,8 @@ /* m68k provides an optimized __ieee754_exp10. */ -#define NO_COMPAT_NEEDED 1 -#include +#ifdef SHARED +# define NO_COMPAT_NEEDED 1 +# include +#else +# include +# include +#endif From patchwork Wed Mar 27 16:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87712 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB211385E448 for ; Wed, 27 Mar 2024 16:46:57 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id ECD233858286 for ; Wed, 27 Mar 2024 16:45:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECD233858286 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 ECD233858286 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557948; cv=none; b=L2Ib919m4Ta+4n8AivKnVa+FFE/dXBMzePFsKCvQ8BE6Fp2qI1dn9T2oopWDxdfTVy4y2r3XkeE9p7H2AReOci/8LRd7bDK5yPsuMMAsnohe9u1e1qhWGcayKr5u3f3y12CG8MwJRi2fpS2GccFAY1ZdQrw0pciAmqNDRjmrAnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557948; c=relaxed/simple; bh=7lsd+JEB6OXhLwzIRmgXKA+7kg76cGxq/9jNxZ2FcCw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=n+xGA3F2U36jvYoHd3CBmDelzss9z1qXXDx9YRmLYUHnuiAaaty3BnlZ+8fgtdAT1D0XYQx3+Qpuw2KcemU/Fyx4RexvJqgGAAFA+dIL4wyTuP8OUvTKecfXKz7XWB4NBIhVjMxiu1dn7p3SR7eRD/I2oYXRmkK92yiNLT6p9v4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e0d654590bso185675ad.2 for ; Wed, 27 Mar 2024 09:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557945; x=1712162745; 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=3gTSKqePJhhgVkKF2Oni/s3e8N6TubY4O/UTslyMKiM=; b=OnhXJKtwHFtZdToq/XyABvnPGk06Um84/PqQsJXwRTVtRFLYM2xOST14K3vjAGj6tJ etvMbLvR4suGljKRurTWw5SycLcVxVruV3H5hmzwBMO/Xskfcr4IA/N4Q/rEaGCB0eum tbKLxoyOhBVnVvQ7nQJJ413ZMVJJTsaLzsAHUt0eYdo02E0RU3SDjl29DXdW/hDtazNR Z8WxpRjKmQh69VqEbGff2U0glRPG2Savc8X5vaLLYFk0olyORj9KRzv3G3NRRxRQgUFy V3xZEVS2hNO0ptLrdYq6b+NXR+SKGzqo84lqeHENX6f7i1HhOC6m4pslI5FgmYuzjtet o57w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557945; x=1712162745; 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=3gTSKqePJhhgVkKF2Oni/s3e8N6TubY4O/UTslyMKiM=; b=iV+PZcO8mBpbXo/yBxoYWCmDrcV8WErWYoCLyJdxMs1mY2tcX/oFOgCeA8WVsoiIUm IRXWe9WndGKgb/N5HplrKMgDo/gPPZt+6FS1jjvRXxsKUo4jaL5nI+GxBvSbBeORnBU1 1o0h6ot1jDytLQmgREnH5WaT/16ACgvUKmWbzzfMACMfG+WDtGBjag+NjdGzrBoHLcoJ SPKibehOWI3DeplpFQnfOWZjS1IOnKB9X2U/S99peOG0qafyKMW9JwD0vdOXWJw6rkYm 695njnkCvy9/W1fVjUZOoW1etk2XcMY9926ZPavMTf9TZp7O7CTOdd0ih1zNG9TWwcbt u7EA== X-Gm-Message-State: AOJu0YxPXN2m/aMhsEbuBaFZjcf2C+7JT+aDYdAacD4U8k1gRpNIwLbb 7muMcIqxL/Os60HOwW6MwRxNSw05AhMqfiK2l01k6LunyyQbYwG32yPhrv9uvkjlg7GqH7QNmxK 1 X-Google-Smtp-Source: AGHT+IFKDQi6+OcOxZO2R6epATgnVkbaWOWNR+qbEsHgpzrzx3HIW7gYhEj4H2Qk8nC9kRF+4kelUg== X-Received: by 2002:a17:902:f786:b0:1e0:8e7:310e with SMTP id q6-20020a170902f78600b001e008e7310emr271141pln.16.1711557945344; Wed, 27 Mar 2024 09:45:45 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:44 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 06/15] i386: Use generic exp10 Date: Wed, 27 Mar 2024 13:45:18 -0300 Message-Id: <20240327164527.3717523-7-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.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org The resulting performance is slight better (Ryzen 5900, gcc 13.2.1): * master "exp10": { "": { "duration": 3.70091e+09, "iterations": 5.8534e+07, "max": 91.279, "min": 62.6225, "mean": 63.2267 } } * patch "exp10": { "": { "duration": 3.70793e+09, "iterations": 6.328e+07, "max": 259.592, "min": 52.1145, "mean": 58.5957 } } Checked on i686-linux-gnu. --- sysdeps/i386/fpu/Versions | 1 + sysdeps/i386/fpu/e_exp10.S | 51 ----------------------- sysdeps/i386/fpu/e_exp10.c | 2 + sysdeps/i386/fpu/e_exp_data.c | 1 - sysdeps/i386/fpu/w_exp10_compat.c | 8 ---- sysdeps/ieee754/dbl-64/e_exp10.c | 7 +++- sysdeps/mach/hurd/i386/libm.abilist | 1 + sysdeps/unix/sysv/linux/i386/libm.abilist | 1 + 8 files changed, 10 insertions(+), 62 deletions(-) delete mode 100644 sysdeps/i386/fpu/e_exp10.S create mode 100644 sysdeps/i386/fpu/e_exp10.c delete mode 100644 sysdeps/i386/fpu/e_exp_data.c delete mode 100644 sysdeps/i386/fpu/w_exp10_compat.c diff --git a/sysdeps/i386/fpu/Versions b/sysdeps/i386/fpu/Versions index 9509f9b7c7..7326f25583 100644 --- a/sysdeps/i386/fpu/Versions +++ b/sysdeps/i386/fpu/Versions @@ -5,6 +5,7 @@ libm { } GLIBC_2.40 { # No SVID compatible error handling. + exp10; fmod; fmodf; } } diff --git a/sysdeps/i386/fpu/e_exp10.S b/sysdeps/i386/fpu/e_exp10.S deleted file mode 100644 index 902f70b77f..0000000000 --- a/sysdeps/i386/fpu/e_exp10.S +++ /dev/null @@ -1,51 +0,0 @@ - -#include -#include -#include - -DEFINE_DBL_MIN - -#ifdef PIC -# define MO(op) op##@GOTOFF(%ecx) -#else -# define MO(op) op -#endif - - .text -/* 10^x = 2^(x * log2(10)) */ -ENTRY(__ieee754_exp10) -#ifdef PIC - LOAD_PIC_REG (cx) -#endif - fldl 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fldl2t - fmulp /* x * log2(10) */ - fld %st - frndint /* int(x * log2(10)) */ - fsubr %st,%st(1) /* fract(x * log2(10)) */ - fxch - f2xm1 /* 2^(fract(x * log2(10))) - 1 */ - fld1 - faddp /* 2^(fract(x * log2(10))) */ - fscale /* e^x */ - fstp %st(1) - DBL_NARROW_EVAL_UFLOW_NONNEG_NAN - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret -END (__ieee754_exp10) -libm_alias_finite (__ieee754_exp10, __exp10) diff --git a/sysdeps/i386/fpu/e_exp10.c b/sysdeps/i386/fpu/e_exp10.c new file mode 100644 index 0000000000..340254fc6e --- /dev/null +++ b/sysdeps/i386/fpu/e_exp10.c @@ -0,0 +1,2 @@ +#define EXP10_VERSION GLIBC_2_40 +#include diff --git a/sysdeps/i386/fpu/e_exp_data.c b/sysdeps/i386/fpu/e_exp_data.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/i386/fpu/e_exp_data.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/i386/fpu/w_exp10_compat.c b/sysdeps/i386/fpu/w_exp10_compat.c deleted file mode 100644 index 49a0e03385..0000000000 --- a/sysdeps/i386/fpu/w_exp10_compat.c +++ /dev/null @@ -1,8 +0,0 @@ -/* i386 provides an optimized __ieee754_exp10. */ -#ifdef SHARED -# define NO_COMPAT_NEEDED 1 -# include -#else -# include -# include -#endif diff --git a/sysdeps/ieee754/dbl-64/e_exp10.c b/sysdeps/ieee754/dbl-64/e_exp10.c index 225fc74c4c..c63b852f72 100644 --- a/sysdeps/ieee754/dbl-64/e_exp10.c +++ b/sysdeps/ieee754/dbl-64/e_exp10.c @@ -99,7 +99,7 @@ __exp10 (double x) /* Reduce x: z = x * N / log10(2), k = round(z). */ double_t z = __exp_data.invlog10_2N * x; - double_t kd; + double kd; int64_t ki; #if TOINT_INTRINSICS kd = roundtoint (z); @@ -147,7 +147,10 @@ __exp10 (double x) strong_alias (__exp10, __ieee754_exp10) libm_alias_finite (__ieee754_exp10, __exp10) #if LIBM_SVID_COMPAT -versioned_symbol (libm, __exp10, exp10, GLIBC_2_39); +# ifndef EXP10_VERSION +# define EXP10_VERSION GLIBC_2_39 +# endif +versioned_symbol (libm, __exp10, exp10, EXP10_VERSION); libm_alias_double_other (__exp10, exp10) #else libm_alias_double (__exp10, exp10) diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist index 88e7538e51..01c5633663 100644 --- a/sysdeps/mach/hurd/i386/libm.abilist +++ b/sysdeps/mach/hurd/i386/libm.abilist @@ -1181,5 +1181,6 @@ GLIBC_2.35 fsqrt F GLIBC_2.35 fsqrtl F GLIBC_2.35 hypot F GLIBC_2.35 hypotf F +GLIBC_2.40 exp10 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 c99c60161d..3413cfdbe7 100644 --- a/sysdeps/unix/sysv/linux/i386/libm.abilist +++ b/sysdeps/unix/sysv/linux/i386/libm.abilist @@ -1188,5 +1188,6 @@ GLIBC_2.35 fsqrt F GLIBC_2.35 fsqrtl F GLIBC_2.35 hypot F GLIBC_2.35 hypotf F +GLIBC_2.40 exp10 F GLIBC_2.40 fmod F GLIBC_2.40 fmodf F From patchwork Wed Mar 27 16:45:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87713 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C59C385DC1D for ; Wed, 27 Mar 2024 16:47:01 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 2C466385E449 for ; Wed, 27 Mar 2024 16:45:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C466385E449 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 2C466385E449 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557951; cv=none; b=IRcba/t/3YPc1vI1+5eKrlRq9JOvse51XWbCjXsmvUVWRVMz/zhsPL+lPWhecVbYfexUuKYXAcobHEXDioKkQfLSs/VqvTa+DBEfFpcQAanI1sHMVIYTJ6kkgcpV0GVomgdXfWlwNLiq9N/RwwAeNdRrlunpXHFGOxHz45N0E7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557951; c=relaxed/simple; bh=V2QOHmynST+A06BJ1vVs7hRXKEsIYCDGCjaalv4frLA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=QvBS1OP8m8DeIEEwUHXg+llE34eSMaKLJQfeHlq3HqgIRBXnT1WYUMmt0wFSDtQq6/bnXrN9pacrhGk9Uh1OgwKWJ5tjeHVN/2u/kYyXJNZkNsA1/kD86KvBg+r9LzxLC0T/XL7spfRgyJIjlx36EtkLF6E/RlpYYd1cAww1qeM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1e04ac4209eso289315ad.1 for ; Wed, 27 Mar 2024 09:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557947; x=1712162747; 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=b/uJsYX5TjTzzmu5D77iSjXX+egw1x7sUXQBSMn9NVQ=; b=NzIy2orztUY6MoK+1ELOiDQg5QBFZ1h4R7q8oU1WvPbdHRC6d4WUPdr3ZAdUoBPabR dXco7n3wm+8Qr0NS0/hcZ2D6jM0p8ywJdNag56jTS1CzN9AMv1NPdoXcmNYmNZvzxE+I euNH9WTPU7zfCrJHHhh41AfMj0Ttw5D7qdewyw6q+DH05qMCa58HYx1P1mjrBVxa6kWO KQ9YeC2Bsf9i6cGX3tb63MkfrN5/SEgVL9wYVhoK5WJ2K1EXVwY2YJLzy68u7iUcQpfu xL5LaTFPEEK+Ph6d7d1QNRUOb0gkUbfrza8++aRBYhIRxQMazLQO9I7ZRfUz1VImAa/a /Pzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557947; x=1712162747; 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=b/uJsYX5TjTzzmu5D77iSjXX+egw1x7sUXQBSMn9NVQ=; b=HmWKqB0zjfkLpDpujaPHH32hVmgyukfqTk5g+Bj7g7LGffQhF3UMuQzlePtrAaRo+I gNHHFi9QxyF3Uq1whtr4oHHZcnlP/9p2gVSl2FuMDk4+3iPf04Hz7BvQjIwgMYCW1EVP zGCnr2qxDN80OTvwvU9kIafjzADH0yiLN1W8OO1kAsm8ugK0DpQdnLw5KmhhhUO0+LYU YDlvH9rYbnmzgQvS8cTzINOJssKPSmmlAgdw1TWT6iPwDhJVnsXHQFCwG6369v8W3vt+ AJMEAu1jIvNS4pAjgvCL1ViXxiRXqeBOeZ3tv0lklfb0rTM8cHE0WX5TBVdP57u8Sn6y lq/w== X-Gm-Message-State: AOJu0YytV9yN9nsekQgF8MMVp0Dq1jjH1+QISWTxosuwiqEszunsx2yF OMJYgncBA/q71g4m1VYgDNSr5pcYLbhZZGCWsFHo2C99uvzvyfWXXN34boMSzu6q/5ug/g0WHp3 V X-Google-Smtp-Source: AGHT+IH8DnKj18Cs39bQKQP7EPMH3JH38UoYmnL08nrJj2wumeZO5kYU5Tlxs3e9s09a+2UrYOJGjQ== X-Received: by 2002:a17:902:ce05:b0:1e0:e1dc:f27 with SMTP id k5-20020a170902ce0500b001e0e1dc0f27mr205423plg.69.1711557947483; Wed, 27 Mar 2024 09:45:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:46 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 07/15] math: Fix isnanf128 static build Date: Wed, 27 Mar 2024 13:45:19 -0300 Message-Id: <20240327164527.3717523-8-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.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+patchwork=sourceware.org@sourceware.org Some static implementation of float128 routines might call __isnanf128, which is not provided by the static object. Checked on x86_64-linux-gnu. --- math/Makefile | 1 + sysdeps/ieee754/float128/float128_private.h | 2 +- sysdeps/ieee754/float128/s_isnanf128.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/math/Makefile b/math/Makefile index f1d210797d..516fa72a26 100644 --- a/math/Makefile +++ b/math/Makefile @@ -372,6 +372,7 @@ libm-test-funcs-auto-static = \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ fmod \ + isnan \ # libm-test-funcs-noauto-static libm-test-funcs-narrow-static = libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static) diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h index 38a8bdd0fe..672bf3cccf 100644 --- a/sysdeps/ieee754/float128/float128_private.h +++ b/sysdeps/ieee754/float128/float128_private.h @@ -352,7 +352,7 @@ #define frexpl frexpf128 #define getpayloadl getpayloadf128 #define isinfl isinff128_do_not_use -#define isnanl isnanf128_do_not_use +#define isnanl isnanf128 #define ldexpl ldexpf128 #define llrintl llrintf128 #define llroundl llroundf128 diff --git a/sysdeps/ieee754/float128/s_isnanf128.c b/sysdeps/ieee754/float128/s_isnanf128.c index 59f71533ce..b73a4e80d7 100644 --- a/sysdeps/ieee754/float128/s_isnanf128.c +++ b/sysdeps/ieee754/float128/s_isnanf128.c @@ -11,7 +11,11 @@ #include "../ldbl-128/s_isnanl.c" #if !IS_IN (libm) #include +#ifdef SHARED hidden_ver (__isnanf128_impl, __isnanf128) +#else +strong_alias (__isnanf128_impl, __isnanf128) +#endif _weak_alias (__isnanf128_impl, isnanl) versioned_symbol (libc, __isnanf128_impl, __isnanf128, GLIBC_2_34); #if (SHLIB_COMPAT (libc, FLOAT128_VERSION_M, GLIBC_2_34)) From patchwork Wed Mar 27 16:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87717 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F9FB385DC1D for ; Wed, 27 Mar 2024 16:47:55 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 3CEDD385843A for ; Wed, 27 Mar 2024 16:45:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3CEDD385843A 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 3CEDD385843A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557952; cv=none; b=Am88TWYAlKNPffe/MzKN4IvAMlmsFDSXdmLD+efRtxp20tnOyr+RNZ120uqgrzFH7zfih0X23qC5zx/GaHn4+ZWxMnBq4Xv1oIoBlH66LhHESXwtcaBHIuuYJcf6bpoKScBUd/pq0KMGg4rYPdif3m5ij9EWHKjKoCkN9nkhev0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557952; c=relaxed/simple; bh=wX45uKGaEumacqHgV0XE5fPzRX3klc784/S2m/Ik2O4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ngb4UivSSWpJUso6wD7PBexEX99zoe6ej5j9+wzP0vZsBoUthrskKFTI66L6gCl2jX3go80B2UAHClW1myeZWwgl4VymMqM9MUxbUGZ/BuazmS8RmDNRaJfVijwXb0flcUH8y9YtUzrGyCgQz0nSPh4BFk2AmFXRsflGJuVYGHY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1dee5ef2a7bso289675ad.1 for ; Wed, 27 Mar 2024 09:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557949; x=1712162749; 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=mgzBHY8eIbS5Bsjmn6NMaIRe85fsSw17SEUeNUUQPqk=; b=sR1dmmOY+X6pPd8qbdV6/ebgq/Np+4WQZWKsQORt7JrgC1CQC2iGGiG14Dd6hXDHjc WhZLXa7zx/rZ0sZ/OC7osljVRFSYkeDO9P8W0ZlcApMnBsSOvdeD4327N949C58uByrl w+AdO2DXASiWY7xZxdxtJpsvEbeLdVCT1KVAyDeRMZtqXS9shT/WoF6P8QQe7Rwmful6 QuLlFadfOflupOZXAgCBfvTciNC0ZDWS3GLvtCmmdYdJMnZ18/atgCZ57xiRZhnEio7k Vpm6aA8KsOInEFatvO3sfZO+uN+Ds9eYkLC3JRvd5bqwikYnW6Y9gCvF2Hj9TrEbk+Wz IR1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557949; x=1712162749; 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=mgzBHY8eIbS5Bsjmn6NMaIRe85fsSw17SEUeNUUQPqk=; b=wqkR6qr/Wf3H5mxQVd1B2lZsTee7vLmN2ixAfvjqtPS6luo1b1+2r9KvyijmM45imj upKdJTZQM5BtROq05C8Essf+tEf9c3ez8K8DKCpcQzObgq/e4K1fiUwJu5y0TcOnYovO 44fjmhiq1mNQ7jziQd8V8X9mCZjY3VWhj+SkeEXsGSwtWnzbbMcabFDMKRKQeploonra bzdkIJqIqFUEYm3v3QEDjtc21U9LHUA45aUN42jENRcn3vhQmuCUyUNV4A3tsj3tRkmB 2xPOw2mGVNaf4u/YYwlXSHaKrqgoWSvXqX5kYjg2CKRSHvVoKprXs5omrviO+Z9tzE1t SZwA== X-Gm-Message-State: AOJu0YxcplUSkRykyuaI4k6dTMO09QRY+cZ3Fxmty767tJmE+MwiBW64 3wkvTUyhJCkpZHxJdN7A1aS99V7iNm6osTOOazwp8S1BTfd6vRmSNRfEu8njBQJ+G9kF2qQLjbL U X-Google-Smtp-Source: AGHT+IEGDiYlov4vrswWPxMicBi04QbZbkitEzQrKMSVGNz2tU+kujErGW2oikYQ/6ZGX0UEy+VYUA== X-Received: by 2002:a17:902:f709:b0:1dd:779d:dd4a with SMTP id h9-20020a170902f70900b001dd779ddd4amr231199plo.63.1711557949621; Wed, 27 Mar 2024 09:45:49 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:49 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 08/15] math: Provided copysignf128 for static libm on alpha, s390, and sparcv9 Date: Wed, 27 Mar 2024 13:45:20 -0300 Message-Id: <20240327164527.3717523-9-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org Checked with a static build for the affected ABIs. --- math/Makefile | 1 + sysdeps/ieee754/ldbl-64-128/s_copysignl.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/math/Makefile b/math/Makefile index 516fa72a26..61736159d1 100644 --- a/math/Makefile +++ b/math/Makefile @@ -371,6 +371,7 @@ libm-test-funcs-auto-static = \ exp10 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ + copysign \ fmod \ isnan \ # libm-test-funcs-noauto-static diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c index 11b42d04ba..80137847d3 100644 --- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c +++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c @@ -1,10 +1,10 @@ #include #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED # undef libm_alias_ldouble # define libm_alias_ldouble(from, to) #endif #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED long_double_symbol (libc, __copysignl, copysignl); #endif From patchwork Wed Mar 27 16:45:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87722 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 758D8385E446 for ; Wed, 27 Mar 2024 16:49:46 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 0B916385E02C for ; Wed, 27 Mar 2024 16:45:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B916385E02C 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 0B916385E02C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557956; cv=none; b=d3PKPokMnk9GvrK77fETFG3zY6aQ8k/XquVVos2jKMyvqK/HZ3vkGR4Ry6hlwg6ofsrlf2g0Sf0poDg9SPgDcWHbwbEiUlNiG7/TxyHU3NOiNB13VbxtImi4DyQoskDowIilJqt0Mk7maB1IT8i2tZBiEZ216NXNWNSrG1uWMTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557956; c=relaxed/simple; bh=zK0STUkqWkMaFV4Mjh7D4y4NBZjYZDhFN7KQsB6A7eI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ndgRHhZe3LOkhjhon5OFKdRqrTaPp7Jjl/bM0E3Lx7eOo56N+IYCRWBJ27tLgeXfJOslJdmrr8+NjTavwK+kQ5/v2nRx8DGz0OpNYnCvaLrsWkzcV4GRDktfXd5VJQqQOIL1o52wvo5mpaEbBk77XTg7j5tiZFHeySp8YtzE5FM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1e0f3052145so268785ad.2 for ; Wed, 27 Mar 2024 09:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557951; x=1712162751; 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=arRKjEUA9fLaWUU6cs4FH4l0x0zrMQFWVGEvxXC82/M=; b=sjDPC8pguQiYSYGZPcl6y0ITQQOnnmhxy/KPf1xIPfmNdgH34YT772L4N0tKWCmA9L 2Bzvr+1PR7HKyKODJSYhthKRNLOcbk1J5f5jg7dS6p5+4jtsQC6bxn93Wkz7crjD4OKL cnSs8Kq1nKhs/I+BBAbmD9zyQ8+9EIkYm5ZpS0p/HoLPbOgm3z5I5AtKumCILmksRZYw qRRhYHpNlA71JcZsblUHcDsks2zBN0kVL6iv847B4ebfPEXXJfqFEMVH62JBrJXXtFVN kVob2kPOdG+uESY881IWPTZbLDanlQp/2Yup8Kf9NbroIm+sXRrP14jDlnWiXrgCmGco 7lLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557951; x=1712162751; 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=arRKjEUA9fLaWUU6cs4FH4l0x0zrMQFWVGEvxXC82/M=; b=cNX6+EZcEHc1qcUt2AqJgTcukx0QUIL0rk09NiilzjWfqpFAC1kC6q8q5w+9MK2drz FrLuVNixszl6lAf9qiXgkXS3SGrlQDvXWmwU5fTjbRs6MYHi5lluPlwMbloZCmRv66YQ 26It2dR6ISKZbQWhsrR4FJjuuS/u/t3JFXrzPvJmayscp58t9BcMo3nNCLwAsBf+Aswz hM+1dvFhDoCbz7kSb70hOxWAj1AuKPV+9u8ciQK3Zflujeqjp9Y7jtyCFhzWx7EhRw7K TjKauDaJ+4aH331PNN91K4hAxZ/qV2zmwya6LvI3gu4wXlXLPVaFMkLmGWT5uURLdhb7 uI9g== X-Gm-Message-State: AOJu0Yw28aNBMGfZqH4t2Vq20bHUj/QtZJrLj4C3oYcwjVuDjrwx4lWm smlM4fZP2Df0AV63tZv3xDx/5oCx5bpeQ0OiribcfHyOC7qG8JycSmD9w0/kH2KEv5QO8mBTaUp q X-Google-Smtp-Source: AGHT+IEinubMXDkQcxttEZRQe9MAQsvsfn3It4w9F/ump2Q4LkNWC+ipmeeEK7rLTQyYet0fga/3Jg== X-Received: by 2002:a17:903:32c7:b0:1e0:7bbf:bef4 with SMTP id i7-20020a17090332c700b001e07bbfbef4mr206076plr.41.1711557951725; Wed, 27 Mar 2024 09:45:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:51 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 09/15] math: Provide frexpf128 for static libm on alpha, s390, and sparcv9 Date: Wed, 27 Mar 2024 13:45:21 -0300 Message-Id: <20240327164527.3717523-10-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org hecked with a build for the affected ABIs. --- math/Makefile | 1 + sysdeps/ieee754/ldbl-64-128/s_frexpl.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/math/Makefile b/math/Makefile index 61736159d1..655f6ed4e3 100644 --- a/math/Makefile +++ b/math/Makefile @@ -373,6 +373,7 @@ libm-test-funcs-auto-static = \ libm-test-funcs-noauto-static = \ copysign \ fmod \ + frexp \ isnan \ # libm-test-funcs-noauto-static libm-test-funcs-narrow-static = diff --git a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c index 73ac41e40c..f5f7d349f7 100644 --- a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c +++ b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c @@ -1,10 +1,10 @@ #include #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED # undef libm_alias_ldouble # define libm_alias_ldouble(from, to) #endif #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED long_double_symbol (libc, __frexpl, frexpl); #endif From patchwork Wed Mar 27 16:45:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87719 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F2297385E446 for ; Wed, 27 Mar 2024 16:48:05 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 5A66D3858427 for ; Wed, 27 Mar 2024 16:45:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A66D3858427 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 5A66D3858427 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557957; cv=none; b=KgdaChK/zruvFs7pFGn42NB4ieYjRL/ChcttDJh0FYkLFzyLNRgsXYzoB4x83zcDOOiRB8iSVZEAteH7aJhrSlHC0BFE25t97zF5ix0NbiCRW+Gh5UIFWLnbLNy2i3SqLh53NylXgr5GVhtEk/jJgk+FEDm19K8gvx/OAUn7crw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557957; c=relaxed/simple; bh=/Xf7aJ0aBDDwls/BEo72jFQHS+OKW6FU016uLRxh+I0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=JM/G4iJBc66bnj1tFBJI/ne1ETxY+x5cMUvp0WbjgT9OoVAMcWb003iDdluGTSn1hdDZN86mugSdI+4EPPsNz8CCvkRD4Rl7go4p6WhxpHpa11fZSnVgBmHQGW2p+mFXSKcZ17C3Kxwk1i2IYeNbNRGcOTJj90ZoGYO04+JIIMg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1e0f2798b47so397915ad.1 for ; Wed, 27 Mar 2024 09:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557954; x=1712162754; 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=XEBGnvKMJc/FekL1l9x46E5WjtTLo3MX29wvCcbEgeE=; b=ZmmKBNXv2ypbWUuVqyga+dcdfDDzk+ftCuB61bMi4OvbD6pNyvfzDnaSnaqw9XjP/l /jfvHztW4XY8kBFSebK2Z/2HPIwzNU0qUTpLZ1yrKmJHnaW/QCrfah/Tqd2V/GzzJC9K z/RnO9RUKgWmkFANE61Pt58oUZ7k6vmdyaneIRCHlQASuTo6L0sUQIMXVMHhLGZ+cvbS h7QSB0IUr+ZwGeTnmdrT3gb5e6/9e0raxS1jpVPK+Sb66d3YqgRBsud076b0hgQxHJkD xPzoD39/89AGqS6i8YZ0fNkkdbqqLioRLXgfmk1F8FxT2qs6FqgaU3I844R2+bjp9bAX HZtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557954; x=1712162754; 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=XEBGnvKMJc/FekL1l9x46E5WjtTLo3MX29wvCcbEgeE=; b=tcqWuZDDiFKExvNp5T9RQrUaMP1WNkoqBFsEdYXxLcXNTUAeW0Vf0t463W6V70O1oA +b/AbiLH1aG16JyshYd+dEW3/q63owD/U1T9XI5LpTghkk5qcpGwYnlosaB+N40uuTO4 Z/s8BKXgSSB8i2g7Y6ijQahwRSPGY4Tcv13E2nmh0JDxHO72emHYePigJFjCy6q1smuo 1yeGMyOUq5lzE3HRtMp1urSy+0qSWCf/VvT7bO9v3Zlz0zBLWtCVplY8nA+bI6xiz3c7 OsjaQ7yD/1MrwL9xyzZebXgIbTpzkJbpSNqtHPQ/vTsocBikAfgwsN/ZCgPnaSDlKB+z uFVQ== X-Gm-Message-State: AOJu0YzV0pUoh/Y6KH+3RMvgvuayOh7NEa72thyDEgL22qZRdO7AQjj5 XiB45Oig2HLnKCZrl9Gxv8lnmLVBy82q7xbAB+xtnDB2VllvHyUROJYk1L2JLMSSnE4LAgoCZzb Y X-Google-Smtp-Source: AGHT+IE4sSANpo31QqjLybmHyg1X4UefeH3lrTaAfDOXkh39kR1qYKExlFXzyBtYAdFFW0UE7ZrJ6w== X-Received: by 2002:a17:902:d505:b0:1e0:188c:ad4f with SMTP id b5-20020a170902d50500b001e0188cad4fmr204622plg.26.1711557953790; Wed, 27 Mar 2024 09:45:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:53 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 10/15] math: Provide modf128 for static libm on alpha, s390, and sparcv9 Date: Wed, 27 Mar 2024 13:45:22 -0300 Message-Id: <20240327164527.3717523-11-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org Checked with a build for the affected ABIs --- math/Makefile | 1 + sysdeps/ieee754/ldbl-64-128/s_modfl.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/math/Makefile b/math/Makefile index 655f6ed4e3..af1909d0c7 100644 --- a/math/Makefile +++ b/math/Makefile @@ -375,6 +375,7 @@ libm-test-funcs-noauto-static = \ fmod \ frexp \ isnan \ + modf \ # libm-test-funcs-noauto-static libm-test-funcs-narrow-static = libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static) diff --git a/sysdeps/ieee754/ldbl-64-128/s_modfl.c b/sysdeps/ieee754/ldbl-64-128/s_modfl.c index 7d7aeae111..ba3d31334a 100644 --- a/sysdeps/ieee754/ldbl-64-128/s_modfl.c +++ b/sysdeps/ieee754/ldbl-64-128/s_modfl.c @@ -1,10 +1,10 @@ #include #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED # undef libm_alias_ldouble # define libm_alias_ldouble(from, to) #endif #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED long_double_symbol (libc, __modfl, modfl); #endif From patchwork Wed Mar 27 16:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87724 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43F413858C36 for ; Wed, 27 Mar 2024 16:50:35 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id BA7CB385E448 for ; Wed, 27 Mar 2024 16:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA7CB385E448 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 BA7CB385E448 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557959; cv=none; b=bOeH29Qdr9nAID09ngJ9wTOIq2v2vGp4P4pFfNTgou2fSkp3p8xSdiv3MebGSy+RvOemOBaPVaeHgyRAR+mnmtOOaiY1+6xK1Upb8TqhDdvXDqpfZCYNCbyp/Qe/P42x7A9lWHjniuOfdzOdDXU5zn4C9sUUNMrYO5qVHToogdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557959; c=relaxed/simple; bh=rr8tM5m4NJ9NHwHGEs52TlBc33W7hoA0JwGSKpgLU8Y=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=fRRSiD0k64zEQahrcclEY+eEqryoiBowssnui4Aj6AGJIBrx6i9rhShwLrxuytgsMkcUD764p4z2v3VcpEWGhiY1Idovd1ntpnydIDlFjkfzxHyruEYUHoaI5VnC320Rq69Ash6/fhVCl4OWJAhRDT/CvcrMUtw8gvJ5Zua8+8Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1dde26f7e1dso335055ad.1 for ; Wed, 27 Mar 2024 09:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557956; x=1712162756; 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=E6meBW8o0nRpvTFaLF8Ch+/RWgMkapQ5IYEczi9JJmo=; b=jJwG1MdY+kofq/FgFygUfMXDtyLQEFpXo31FAttzONL5LYlbkcEYT4IpSha6acQHe1 w7xoTn+gxsFe6QgHGL0jwGGiQhcO4UFKMsJpnSBfYFcBtGPvFyY9QuL336nQshx85yAh viq5WjPPNvjL/XJs/Z9f14Svhwpqzg1q45VSh8PpSpyvs23t1wFjGqxcJAGLZVr8LZg6 e9jGHgHTDDLHO3ckhgL8ct9P6e7MxHENnm3kOnW40eLvpDKJmXN+ttoV1ePaK1XcDPj0 oqxykeEgeDB4lUneepw8ZI0Jv0HFjq8QKtXkbfXYQSJAQ7/8T1FFjQJsA+pENLl17cCh vWlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557956; x=1712162756; 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=E6meBW8o0nRpvTFaLF8Ch+/RWgMkapQ5IYEczi9JJmo=; b=VSU3JwaAKHO+G4ao907Mg7Z0ZOGdpO4uIgeTmf4To09qq1ohKGt4kRlGaUTeMiB1LJ xGD4fAnjChYjLUWbDCYVL0Uq0w+n0b+AY6HEintg7Q/7ylaZnJe4IV6ofwBY3EL82zst bnWhhVGsGrf8rmqv0sEGrOVhpniE6dx/CDUZdv5jyY/c4gcSvmcakjAbgm4a2HP5eNuU XDSczmC30aIpfRNSAZBu83tAGhqVBsq2ChOnsyH1/xLL30x6fdu1FusU3qQynCQKNS1c haAgFwrzgR7FuLHGCHTpEl70CxwWln3sbhpykqGm+olFpveukpHmJzltZ4KrV9AG+J36 DK8w== X-Gm-Message-State: AOJu0YxIg9vsm58bVXf2bIupm2igH4//bw6jAzaeXsch8sP6AKeWsGzB 3WPHjw07Vb+Ucw6c78CMjY66DM9N1b6IyPQHw+FtSIThyVi2L7EqjkJKwZzfwzLPkQklvfWjCm6 e X-Google-Smtp-Source: AGHT+IFulmJK12YAIUOSlgJKnGtK6Vl+c/RQX48F3He37N9jimvGjFJAPL/OZTyhvb7Sqle8AvLvAQ== X-Received: by 2002:a17:902:ce86:b0:1e0:b62c:3ae2 with SMTP id f6-20020a170902ce8600b001e0b62c3ae2mr303470plg.10.1711557955939; Wed, 27 Mar 2024 09:45:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:55 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 11/15] math: Fix acos template for arguments greater than 1 Date: Wed, 27 Mar 2024 13:45:23 -0300 Message-Id: <20240327164527.3717523-12-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org The template is used by some ABsI for static build, and it fails set the expected floating exceptions if the argument is outside of the range (on x86_64 this triggers an overflow calculation in __ieee754_acos). Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_acos_template.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/math/Makefile b/math/Makefile index af1909d0c7..2b2683a9fa 100644 --- a/math/Makefile +++ b/math/Makefile @@ -368,6 +368,7 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = \ + acos \ exp10 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ diff --git a/math/w_acos_template.c b/math/w_acos_template.c index fe6d6c01db..f4b0e91ae1 100644 --- a/math/w_acos_template.c +++ b/math/w_acos_template.c @@ -30,8 +30,13 @@ FLOAT M_DECL_FUNC (__acos) (FLOAT x) { if (__glibc_unlikely (isgreater (M_FABS (x), M_LIT (1.0)))) - /* Domain error: acos(|x|>1). */ - __set_errno (EDOM); + { + /* Domain error: acos(|x|>1). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return __builtin_nanl (""); + } + return M_SUF (__ieee754_acos) (x); } declare_mgen_alias (__acos, acos) From patchwork Wed Mar 27 16:45:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87725 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7096E385DC18 for ; Wed, 27 Mar 2024 16:51:16 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 73975385E446 for ; Wed, 27 Mar 2024 16:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73975385E446 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 73975385E446 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557962; cv=none; b=vBk9MmfcfrvjZRa4dUYJuzaMF/qiVGKIeVj93H0qjyStFi89+phBE3U3m37ntVf6ZXo1tGAEaYfdWCr1+m8KGQ8upWxWEJNIe4w4kRPAw1t0zx0Qw2lZC0ad9gW5hCPn32yaJUC0sV5jZBCe538l7yxQdHmlhyijvhoa65lT+BQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557962; c=relaxed/simple; bh=RjHRhGP/pIRZOxjZfNvDZ1XPORsgV8/EYTiLPgAY00U=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=bqwKe6QWTc2g5o6wdqRp7z0uObT5eK6gDuAhyE0CsHMnnGLzTJGVN7c4hepggGLKnYg3Swq/ABeIIrNXjgyl9euXWvR2Ko83cARqDY6f+u3wBvVDqvbiDQMWFrY2hiwDJMbOnZh9E8ZNcni4tRv9a9WnHBY59ikdSUaDW0/3ero= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1df01161b39so187385ad.3 for ; Wed, 27 Mar 2024 09:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557958; x=1712162758; 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=oNW9JRi+n1bRpdFaZUcEXP6xRQd7PQT+ja4l492NHQU=; b=S4oggJMa+wsqsmuZL9aybAE3janMVYHFJGX9pIRY4JXMVOMW7TJ4/bx3Y6RCPVixPD d6fmPTfgXd/0qvTebxQOZR2ggJwQ2DtaE4eIaKPpR7SFmdaAXaq8UmCgXnlBwByh8PDW rkS96OU8ezPOz8LYq5xidXBNAzbpZ9C/9qDiCy27Pxy6I/OYKbm3sgOwn98P+SbwAK4N N4vLyCV/SK0jc9ZfLue9PDgAOLsSC2kTsJVxxU6wh4l9J94+P6FuIUtV85AnITqjeTBA 0JI+MiBov7IwmDw6DIUNoocpTHYIxPOL0SKJKkNEJ59sL2BukgcKbWI8xkW7qgY/etNn +oqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557958; x=1712162758; 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=oNW9JRi+n1bRpdFaZUcEXP6xRQd7PQT+ja4l492NHQU=; b=dxdyV5uQtUR9cWKoxpm1yzFx0ulCgCjInpnyszGhIL+R6Ycj8v7/aHYsdJsLYe/et5 nGcAnreo++iOqqD/2RiRuNeSJ8neuXUaUdeTfwXHviKT6v0jNoj1RwOkFA+vC4mLwLzj axH49FhwacjSZ1lEuxCGWxchbD0jPb+N9j1NYNFUijio29NcyTzCjH4qVoUqVYOEjpqV BzxtU8ENwS5gmRX4pAVQVhxGTuAWkFm+v9a9wtwBy6fSIxhOTq9071qimcosCYit3mqD 7RFh0pFgVHDcaTRJz3L44lxlDecCzXLEXDXegO3T14mCwW8P2fa5NImlGbEUPO6R16mW 8K4w== X-Gm-Message-State: AOJu0Yz31e2AnQ4jOF9ADIrtdnlDr+qcdyOwwDFOx8mi8sEl3wwOTJgX zTvp5Zwr6ntbUSTRsfuWUpZaI7u17A+3eOVmUEVqQgZV0Mwe0nu3USHx+//OvADWMPoxY9dEFiB w X-Google-Smtp-Source: AGHT+IFOkc69kOyBEGJpDNA7DaXaob50tM9VDe5y5N3ArME01rxq4nLvOO4QJt9D71+q7A/+mXERpw== X-Received: by 2002:a17:902:7248:b0:1e0:afbb:7a89 with SMTP id c8-20020a170902724800b001e0afbb7a89mr209266pll.22.1711557958094; Wed, 27 Mar 2024 09:45:58 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:57 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 12/15] math: Fix log10 template for inputs less than 0 Date: Wed, 27 Mar 2024 13:45:24 -0300 Message-Id: <20240327164527.3717523-13-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org The template is used by some ABIs for the static build, and it fails to correct set the floating exceptions if the argument is less than 0. Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_log10_template.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/math/Makefile b/math/Makefile index 2b2683a9fa..aa57171f77 100644 --- a/math/Makefile +++ b/math/Makefile @@ -370,6 +370,7 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = \ acos \ exp10 \ + log10 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ copysign \ diff --git a/math/w_log10_template.c b/math/w_log10_template.c index aca38d4e1e..cc7b503f01 100644 --- a/math/w_log10_template.c +++ b/math/w_log10_template.c @@ -32,11 +32,19 @@ M_DECL_FUNC (__log10) (FLOAT x) if (__glibc_unlikely (islessequal (x, M_LIT (0.0)))) { if (x == 0) - /* Pole error: log10(0). */ - __set_errno (ERANGE); + { + /* Pole error: log10(0). */ + __feraiseexcept (FE_DIVBYZERO); + __set_errno (ERANGE); + return -INFINITY; + } else - /* Domain error: log10(<0). */ - __set_errno (EDOM); + { + /* Domain error: log10(<0). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return NAN; + } } return M_SUF (__ieee754_log10) (x); } From patchwork Wed Mar 27 16:45:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87716 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 098E7385E45E for ; Wed, 27 Mar 2024 16:47:19 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id B178F385843B for ; Wed, 27 Mar 2024 16:46:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B178F385843B 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 B178F385843B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557963; cv=none; b=L7fRkZh1Bl4aQf/yu+uswZYVb1tojenvgFRqyGNLEkTjz+Sf1I5IMLYnZEG9PE4bLGLfOQRUJPj+N1HOiOtJjZSOptRR1tWbHyPrubEe81K4deoyyV5szseCRUzwLaGblQQWOMNFQmmsSP+2dUS5iuEi4zq3ngw3i6fSeQZ/9EM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557963; c=relaxed/simple; bh=x+kArivzxvN8hcZBiHq9bKAjCxH//BHD7Hfi3o2dTmk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iEk81uoPG4ts3VUDD/Ytnb7WyWsQFy+MjBS0d9kIwJtoil2ODhxfznTwBCS2dVQyVkA2UVH1ozCWI2yKv0GUw4CVIP4Yr1t9bPdqbSXuea/eHMnaba5ZH7mRxH19uTIZfz46vhNGqXvSKIRGHlzcHU27kzOvLAIY4RQZpFzoVRI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1def89f0cfdso9091615ad.0 for ; Wed, 27 Mar 2024 09:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557960; x=1712162760; 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=C8SvVzRbyUaeCjml/gbQthQjBarqYX4J2exTyVV+POs=; b=uMzcZlPcrOVCTF38iXm5xmMiCjYnfnvc7al9B1VdhNFzlYtLfLP+Xa21lMPjF9X+c3 0WwmzduSCd1pOziNY+YSLD2PCExRvztZBbl1LgwxllcZtQJ6qPrmcXS2geDCG1EgZ/S3 3EnrDCi81ftIPyxhA97/wAPwrric1jwF+SXgmt8MOACFZe9X5kikOlSvlM5J++Wx79Fx OocBhUUgCFxL5MPvIl12N91PvtdImuzpptR55JYwRpwhxlwNJNGJkrjvViAiUMoCiiY4 pLvweNEldHyhiB4jRqqW+djy0OVE3dTEftIPonQ3WcO/vcS76ckH7j3DuFWxIGlwKAu1 QPZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557960; x=1712162760; 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=C8SvVzRbyUaeCjml/gbQthQjBarqYX4J2exTyVV+POs=; b=kadU3XWwRODSyVuq1hFwbUjIJWsYw0GbMjG9gcXrhu4tOFIpCCZb8xCMZK2YlbWEfe ddjdyfAUdQ5yn5LyiGOw02Ag7/d29t8dT/hOvueviqtwCtW7XbzZIBg6RunNnIGXhXms Yrh6MmY8nSBR7R5narPWB45nFpyYxM7P5DewMvO1vs9Jr3uC8eslEPFnyxUbllc000M0 MR/SG6KYTHglLq6bupSscHPFWmsxocKXmcS3I3J3xdFf2ZY1oOYYWRWQU5jH55/OL/D7 kvQ34qPpIC3f92OqtOjt7OFdUWZCDGoFy7AmFwcqzUtJfU/TM88awMlsnZuK0389LXp2 heMA== X-Gm-Message-State: AOJu0YzOTrJQFIXFpeyqvMxPS7sfngsH39+X3GJ93KZvPXOpBSpMXLp/ dOqpUCkVnpHy2kWjBGgKX2b3TXdQseY1BG3HZGp8dGJpmyZVcgJOo87gUY3XWJNh/m1dxTyRGkK i X-Google-Smtp-Source: AGHT+IFAMeAvwdBUxkjZMxoah6+I0MTpOFg5OTtrgKYdRqgsKdWIWU753Ty5+qwWyVGWqZXWCk498Q== X-Received: by 2002:a17:902:e54e:b0:1e0:188a:5ade with SMTP id n14-20020a170902e54e00b001e0188a5ademr207385plf.11.1711557960234; Wed, 27 Mar 2024 09:46:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:59 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 13/15] math: Fix log2 template for inputs less than 0 Date: Wed, 27 Mar 2024 13:45:25 -0300 Message-Id: <20240327164527.3717523-14-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org The template is used by some ABIs for the static build, and it fails to correctly set the floating exceptions if the argument is less than 0. Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_log2_template.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/math/Makefile b/math/Makefile index aa57171f77..7391f2bd41 100644 --- a/math/Makefile +++ b/math/Makefile @@ -370,6 +370,7 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = \ acos \ exp10 \ + log2 \ log10 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ diff --git a/math/w_log2_template.c b/math/w_log2_template.c index f3ac0aab49..8933f2cd62 100644 --- a/math/w_log2_template.c +++ b/math/w_log2_template.c @@ -32,11 +32,19 @@ M_DECL_FUNC (__log2) (FLOAT x) if (__glibc_unlikely (islessequal (x, M_LIT (0.0)))) { if (x == 0) - /* Pole error: log2(0). */ - __set_errno (ERANGE); + { + /* Pole error: log2(0). */ + __feraiseexcept (FE_DIVBYZERO); + __set_errno (ERANGE); + return -INFINITY; + } else - /* Domain error: log2(<0). */ - __set_errno (EDOM); + { + /* Domain error: log2(<0). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return NAN; + } } return M_SUF (__ieee754_log2) (x); } From patchwork Wed Mar 27 16:45:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87726 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF99B3858C36 for ; Wed, 27 Mar 2024 16:51:51 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id E7B15385E45F for ; Wed, 27 Mar 2024 16:46:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7B15385E45F 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 E7B15385E45F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; cv=none; b=sxUE8N++RlIBHePWnOu7yjN0O5WE3EEAReP3avYFU+9VNRF/Agn1qteicWhPdfQJKw+GxC7nq7iStI3H8LwkBgz/nuNUlR7weSl58bUo/DcxlqrSAJgop6pg4HT4GghiKUUBiBsx7LI1C4ILEe+/XwQcX1FYulxU5uAeU/OxiIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; c=relaxed/simple; bh=IHVmuW9MM4fKmTcotIQy+gCOD3rsiBO17gs+zD0Nztw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=eFDzgQ1UjoXw3LMXUqmBO4YDctBmnCm/t/Y2h6sOgiH7KCwA3SOq/4MsQ/IkGJ6jxak7ZvPbwarGeY0jXfGjDH89dIvwnUC4nmSShvujDYQe2NCflqjBPZQbvqV87RbkIMtTrnPocShbuRCb64xqm5ihizqtVeQnNKTdI8bkRrI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e0878b76f3so649025ad.0 for ; Wed, 27 Mar 2024 09:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557962; x=1712162762; 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=ah4URH/aGPZ0QCEKaSIjDoKiv15ADYgX/jTm5C2jEzI=; b=bi8U2v60z6z422qVu70UWsd3Mw/PcY8RfzRnothUmh6SarLcyY7UgfSyIBKpySgUAp KwZ3OZuUqIc9Y84SLI7gIck7hRbrTHYa9Ri2IB2DkLyeDmqFwXvS77VJyS4BkcRDLIAZ RFJcnY5C9O6bmEXkHw1nsk1jj4lw/7gt05PrZ9MaOa8943pxNGWT0CZrzjNtnhG7lZ8A fqPHVfU1FvuaEitAAOf+adDmgm/d0P7a9YoFF15e3LDJd6Q+I2yCc6rk3jaTnOhVa9WA 6iMGWkaj6PoJi0ZB/y9RhbDzrwpNceq4twkBo4bOMsyyZmsiaCQgZ1MGirWsn+QdsfDI vPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557962; x=1712162762; 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=ah4URH/aGPZ0QCEKaSIjDoKiv15ADYgX/jTm5C2jEzI=; b=Upn9MVaBsl1W6wFcOU2Cl07k0EkecxH6AuVl/TulA1Yvb2TmnOc1IVjAe2HXwGuI9a oX8zCB++XIY4ZnularuKhehxA+jSqtou6/0gz5HwpwqtXEfDBcj5tn8pH+rMRK0vUR3W 6KzeWqDjKVBWWQAlOFqraedp6OimVyy5eJ5I139GM7bD+nnz2lTqN6ZZ9LFbnN6mEprl pf0ktjEnyrLFuHaga3TWbf1OT/gKaC2q5DRDqQEE9y6h+4egX0cHKxog8VWbUu52noQD YW3OiOBR/xrWPlFtDdWQFxDST8Mj+Snzuc3PakHy3aw+qka4S6IIkQ7uEnCRCNOTBkfw fWDw== X-Gm-Message-State: AOJu0Yy/ybRpLk78H4Gz7IacvYNUeb/h9sq9vjCntH0JSf2hCkwUPw8+ Gtzp0UmWDovS2YolYMWEyzyUvWQM1VjJoJh0TlYFxhRfOAY5j9ocP5Y4Go0b4WdlUtPWcf1tyCf h X-Google-Smtp-Source: AGHT+IGQ2BtR6xQZ1UBXY89k/CsTqi6fKaGpBlbKC1kOBkxV55U6ujLaTdXLfXqQioZFJXkQEA/NdA== X-Received: by 2002:a17:902:e84c:b0:1dd:69bb:7f96 with SMTP id t12-20020a170902e84c00b001dd69bb7f96mr190653plg.6.1711557962298; Wed, 27 Mar 2024 09:46:02 -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.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:46:01 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 14/15] math: Fix y0 template for arguments less/equal than 0 Date: Wed, 27 Mar 2024 13:45:26 -0300 Message-Id: <20240327164527.3717523-15-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org The template is used by some ABI for the static build, and it fails to correct return if the argument is less/equal than 0 Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_j0_template.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/math/Makefile b/math/Makefile index 7391f2bd41..5807e949d7 100644 --- a/math/Makefile +++ b/math/Makefile @@ -372,6 +372,7 @@ libm-test-funcs-auto-static = \ exp10 \ log2 \ log10 \ + y0 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ copysign \ diff --git a/math/w_j0_template.c b/math/w_j0_template.c index 1822fc8213..afa2056f96 100644 --- a/math/w_j0_template.c +++ b/math/w_j0_template.c @@ -39,11 +39,19 @@ M_DECL_FUNC (__y0) (FLOAT x) if (__glibc_unlikely (islessequal (x, M_LIT (0.0)))) { if (x < 0) - /* Domain error: y0(x<0). */ - __set_errno (EDOM); + { + /* Domain error: y0(x<0). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return NAN; + } else if (x == 0) - /* Pole error: y0(0). */ - __set_errno (ERANGE); + { + /* Pole error: y0(0). */ + __feraiseexcept (FE_DIVBYZERO); + __set_errno (ERANGE); + return -INFINITY; + } } return M_SUF (__ieee754_y0) (x); } From patchwork Wed Mar 27 16:45:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87720 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 254E7385E02C for ; Wed, 27 Mar 2024 16:48:56 +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 CFDDF385DC18 for ; Wed, 27 Mar 2024 16:46:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CFDDF385DC18 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 CFDDF385DC18 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=1711557967; cv=none; b=mwLlpRyhle27g7JgFWVhdrYXmFxrY0DmPAf9e63UuylDN4Re3LktC/3l1fKn/bmQSpeSeLpJt2GwK8QJTJTdH3KFLfpq91iEaAh0Aa6dCCo3Tj2Empkzw11Vf2mSIUbU3pZXzyIiq8hWui2GZzoqWK873/qaQZqYAI6IvLGW3gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557967; c=relaxed/simple; bh=Mal+E7LUP0cRsZMKfE9wEUgdvKAA4VRP1nVlPqotcCM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=TjHeOzaS9eaQkJSDWaIs3Hp5Nn4QwyNsJAOTHdCSQ9OhkQqTZb/ISqfIqmx6DLq6VoPEgZkzG75X2tPmdTkLjQl9PXJKQMTsbGVgn5t8rVlWHbuu+ZUXCxnxabMgNGFzRX7sfkT+8HXQEi3POrbtX2pljWIQkEd8QBDdmPVToAE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1e0f2798cd8so273525ad.3 for ; Wed, 27 Mar 2024 09:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557964; x=1712162764; 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=hU0PJbP2URljP7w6Sb0tW3oRuLveUFIgdOvH220fqI0=; b=vQ85pN+Bv4AsIizOMn73HaRtIdq/Px6mBqR1aSaGnZx8v/SyugOpAWsmm65TWyf2wS EWyWEmVVAn5vt73lCZCHEhgHrPBnKeo0PkL3BC4+rUPuZMCwukpHW3wQ391whLmupcc+ 9td3iqRXNUMQxLjbdXubdT2r/UvIu+8QrGD01TGMtDBk6KpucNY1nzb1LE0XNLJPBRyW 9+IMz/Ela01Had2NLmF8NkpVvyRe79oUzLhqMiGC1DhaTjIGvZTZVYMSBAvw5psA5b4z D20x0FDlWu//Vt1Z8GH4k0x7SSDKJjrZM67PlLdHMjqeO78S4NDEW4+/arQvKWERvcZQ KeEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557964; x=1712162764; 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=hU0PJbP2URljP7w6Sb0tW3oRuLveUFIgdOvH220fqI0=; b=V6WkdmFb+TNdEegJpI9NqEgIS/KkImBVVronuvUZWOau9qPEtQrvjuTCtoufeZ5VGh fL6UTy8ztxCwEspr7MOggDMp02xoxM/UuUZSLaDxGcVJO2nOsU2cjJwQClmbKKdtnASY zXd0wZEmLYAaOGYujH9SKWbh0sNvKWyMLypUdOGGI9jHHmoncHw9Rsk98kHiAXJm3lhw MHnoKg8dd3SMHFTl8bnP8vycqjjNswu34Xmc87UE5vN3MqYy5HwzBNitzNvYjRAowmt0 JDoFjf6R6NB0i9PE2d0TA5Ov4FWvWVCf1XSaFyx/yJHHIcqMKrlB9kaGEb1wrhVCjELe Prcg== X-Gm-Message-State: AOJu0YzVZyQTzKmAPYP0GCEIf/PkQfGC9XA26IV6qWJZ6wHbjSQhCtMb mAPsTevsYTs/TefjnIPRJ3YCcCxS6wGucsMJAOEJRvQGitffPirV9s+tX+jR6xn2YzoWTd3X1Ty Y X-Google-Smtp-Source: AGHT+IFo511J1acuCyHvyGjD+sU6sp1p4MNFolS8wmJn0azi0aY+Qr9/BY4lI72cU9LH44pmUK12Hg== X-Received: by 2002:a17:902:d549:b0:1e0:d62e:77d with SMTP id z9-20020a170902d54900b001e0d62e077dmr303951plf.23.1711557964493; Wed, 27 Mar 2024 09:46:04 -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.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:46:04 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 15/15] math: Fix y1 template for arguments less/equal than 0 Date: Wed, 27 Mar 2024 13:45:27 -0300 Message-Id: <20240327164527.3717523-16-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.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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+patchwork=sourceware.org@sourceware.org The template is used by some ABI for the static build, and it fails to correct return if the argument is less/equal than 0 Checked on x86_64-linux-gnu. --- math/Makefile | 1 + math/w_j1_template.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/math/Makefile b/math/Makefile index 5807e949d7..b58fca85e4 100644 --- a/math/Makefile +++ b/math/Makefile @@ -373,6 +373,7 @@ libm-test-funcs-auto-static = \ log2 \ log10 \ y0 \ + y1 \ # libm-test-funcs-auto-static libm-test-funcs-noauto-static = \ copysign \ diff --git a/math/w_j1_template.c b/math/w_j1_template.c index 0a97cf9219..addcf4fac9 100644 --- a/math/w_j1_template.c +++ b/math/w_j1_template.c @@ -39,11 +39,19 @@ M_DECL_FUNC (__y1) (FLOAT x) if (__glibc_unlikely (islessequal (x, M_LIT (0.0)))) { if (x < 0) - /* Domain error: y1(x<0). */ - __set_errno (EDOM); + { + /* Domain error: y1(x<0). */ + __feraiseexcept (FE_INVALID); + __set_errno (EDOM); + return NAN; + } else if (x == 0) - /* Pole error: y1(0). */ - __set_errno (ERANGE); + { + /* Pole error: y1(0). */ + __feraiseexcept (FE_DIVBYZERO); + __set_errno (ERANGE); + return -INFINITY; + } } return M_SUF (__ieee754_y1) (x); }