From patchwork Wed Mar 27 19:40: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: 783153 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2374986wrt; Wed, 27 Mar 2024 12:41:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWl+uL2v0S1LLvM5Oct90IJ/Z9y186JPtx2XZfD4RSDwlh5kqj+gJ5T6q7KVOa/79lUlXP/yALD6U1zp0U+auk X-Google-Smtp-Source: AGHT+IHuZgh/+xrz9A9XOpjhr4EOpyExAGQA3LqC5CbZdXb4yoFWapDTdEL5k8HtJF68BRvba4nM X-Received: by 2002:ad4:50d0:0:b0:690:bae1:dd2 with SMTP id e16-20020ad450d0000000b00690bae10dd2mr544463qvq.12.1711568511040; Wed, 27 Mar 2024 12:41:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711568511; cv=pass; d=google.com; s=arc-20160816; b=SeQiiTakQ63fDaq7kP4gy5i3wJSg+uzJHBGMOi5ZCNwzzk3mYBfNWnD2oOp1XcT8yW WTq360azEIMnDrvl9lWvyv9CGMb1032aifZHLGTqVBElvD77ioQPWZ6TF/SCRNbS6Giv ldVhPMJbOrP0aiXCOALwnOQyQR4FnS9MZ4DHQ+qoTTeOdlji30G4rXYLBHuKULVFUfsJ EKef6torKnCl/J5hBd6NUmLTE7G9amEM5lsaML730KPfndsFW/4v5AHNFmHsCQWv8Hkn TFI0fVWeaYhqSzWUnvhUWW7kD36SUnpYNb+NTXzlHeb7l79TElkiUzaZR+hF7SHWG0w3 qREQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=xM0bEaL2ABl3Ls/8bCAVCkPzu+hbOKNXOxMT6+5zfns=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=pR9bQaHgEQwGarV7ke31hFeZF4ZDxCYvSvVbn8Uhosm3x21klAO3dgF10URilsIBBW GBTZVtCs3bZckH4Br09ZebjA1RwJ+ofz9mpjNQrpBQMRqMGJIETYi25ICzh1nvursgFs oBijzw+NOA0NRFZz9W5gYWf1F5a2qAyINmVRRrmRjF5tIjodVLyBkQ78OlPqA9LGdViB JRsw76ix5cet14lDT2zc+sD0BMQxmUPoRSaAcpLEayv4C7fBX5c7YpA6EbYRPLRkECUj 0uxAabh6kyhfdBWBZeuYemDQW8xa156VHHaq/W8h6eAcY53A5s+DQXf6xS3gZo9CMuQZ IXmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Eep8Z3bi; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id jx11-20020a0562142b0b00b0069673ce3360si11108018qvb.486.2024.03.27.12.41.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Eep8Z3bi; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9962F385F025 for ; Wed, 27 Mar 2024 19:41:50 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id E7A613858D20 for ; Wed, 27 Mar 2024 19:40:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7A613858D20 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 E7A613858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::531 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568435; cv=none; b=H4jYGT4ExjmUTQ96RUO9lYZU37niedK53d1/EyITMhioR/uaUxrK8KdvCmtI0lakw07zOe9twJQJ54iltQWip0QPdq0L3i2WC0CJym4T1fkA+BT9qcIAXHx4yMN7Hy7ovguVPAOPaRYfGiZB7f7i08P7+Nz2jPX8oNILOpmAVd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568435; c=relaxed/simple; bh=TmwJdU86itK5iLqvFT7K3Lwmv+jwRtk0S1NFuax1vdY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ZCFf6OCPXzv07AB8f28VUv52anG8tkahfAHiLKoykuMjyt+GTpmSOh+jDiUHB4K9HPSrkMgR/JsHvc6SatD+NU70RXT8qq8j2Z82JCs0Rz8cU77tgiIpvjXwG+BbErEV4ZJsh4gZKMnRLmgNHc2Cm8ZCKOPgA7j/lw7i/8d9fSc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5dbd519bde6so94539a12.1 for ; Wed, 27 Mar 2024 12:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711568431; x=1712173231; 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=Eep8Z3biQiG0YrggbPX66XFsi0rL1/pD0HAYR+vWRs0qnx0fO7yGMi6cZcag4tv/An lj5Z95CbcTx6TE7xBLj14s723Xa7znFIjtvyXPNmh9HWZektgD7lK79GBPQGelJmS5LT lhp5rxqTv75VpPjOiy3+yCSTC+6hNCqxZga/DBnPHY924lxjY/ispk6agpyWxkKmyWIi L5xfnVD6sqU1KZwsCHz0qmS05E58fQ81y0jMp6xtDoEM0+Tu0GtL81XRLsHtEsIKZxCm 0CiJ6yO1S/QDWtBBadlybjT2iYmXbW/w3w5g4kR6j30lvUueQzrA6vkaiUDybShpnTjN NQgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711568431; x=1712173231; 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=oAV+fZBtqngcKAUcodsr4csYNmZYcjqP7Vn07O8aqwodzM0KwvTdgfa2GJmLfLnGNU C08ZbV43cHoAZdueeapwligH76lPF8NAxpZ57Syt6QnF8BMEQ6XzKi3q76BlprzUroJN 3wQ/pgrjIXoAvCkzPf68zUvCwqrxSn5qw6qKyKJpROYAmbkT0aeyQqobfMVUMBUxmVS5 DQ0/G97Nt23pA/UJGou9ifGbPmLoAcjFtW4pQECOhDRG2LTGdJ3apr/W1Jl1l7+Nk/gb MvD65O4xoPtkAkyAp4h/H/jCGKDtOnwWMZMhI9SHZNx/11clLnNtIMTvm5s7ibIPsxtf GNeA== X-Gm-Message-State: AOJu0YyVJ9TXk+l4ZtYrClKbZJsPlfDCT1bKfj3wgGBaCY+chahCaquo VU5xLXoaz25GlAuPmgMMNkf8F8eQslYcfWcmn60KLtVyI5/qdeqLsi03XRLwDzs/YBsal5GHM40 b X-Received: by 2002:a17:90a:9384:b0:29f:e0ef:4d8c with SMTP id q4-20020a17090a938400b0029fe0ef4d8cmr598774pjo.44.1711568431177; Wed, 27 Mar 2024 12:40:31 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id p11-20020a17090a348b00b002a091be027esm2277357pjb.31.2024.03.27.12.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:40:30 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH v2 01/10] math: Add support for auto static math tests Date: Wed, 27 Mar 2024 16:40:15 -0300 Message-Id: <20240327194024.1409677-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> References: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org 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"