From patchwork Tue May 21 16:52:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 797966 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:92:b0:351:d90a:5487 with SMTP id m18csp78611wrx; Tue, 21 May 2024 09:54:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtd04ttn9yCKdkp7RbGrLVo2UpGQGhKXKqwwDH1Zdupw8xw5MqqHWkYDRMXSrT6T/keFnqtO4VisdqoxgiEUFk X-Google-Smtp-Source: AGHT+IHigZ6zm49WzkYdyPrrEjVvKyEFhqLsNZ+pfuz+2e4da0xb1fX22NF7GRZkDdBzgm/hlh/F X-Received: by 2002:a05:6870:4724:b0:24c:6301:3ecd with SMTP id 586e51a60fabf-24c63014787mr400990fac.7.1716310492874; Tue, 21 May 2024 09:54:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716310492; cv=pass; d=google.com; s=arc-20160816; b=A8kIw/K0WfYKC2RcxHoDnfzpBOp9GrUaBLKutKHtkzKNb9oEKtCSzq241HBNEbO1fa P/QaIe5smEgAl11NwRLPoasbFAfkgN4RfCDL40Dho/d2qAC/6bGSv+D1EAjPmPdZ27YF j80zYryM0SxMKqE/g5m6X4rbsqBcb/Gbs/E+lLsKSsk1cFhSa0Ho64/1PupkC2a48KXa bui1lv7vvDiyIbwLh9NUc+96qNcM8i3dcJB8P/YR/99hFMTft34fr2ND072UAgp6hc8P q49Tdl0udpF3MUWPVN3oFbis+XkVobwwwQ5eavywvuj/ad9lUmRpCaQTQM1z4rZXx5BZ qjeA== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ydeZ4ZztqLYjkQK/zDyjG9ZLwQgOBzYVntXDnfZCBy4=; fh=+6orIzRLXQY2FWXAtGF+abYflc8V+YPKzsYFuX0DJM4=; b=syQbtcwWA/6haAbywV/Thi2bXJA3cI5EUqWYIzJwH7+Mj8ByiXAnated7ARkZUVosi C1jMcIVHiVefW9uT3G5DW2wNT8BQlBLMTDrG+q2H3+tddSu3VuZeCk0wGv3Aa0HKCeac bW7KfGFozDnsnTV5AN2stMQk7inOLq2ftWY8aLAhyx9ubGiBrsYMy0LWMQD5JwOJ+Aba IMtSa7SJR10FLOuD6QVMqKdUvpjEkCyKotEf1vhNOrSjcBfZuP44FenQIZSnB5ggVn6T CiJUxWX3wjYJdAddN+E8Fc8eoJ/+dSyZKSkYDgVcL92Kqf4AKTaT3AJJUx1ogmCLX5s7 ZSvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BBFBp//s"; 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 d75a77b69052e-43e3c8b1095si57392581cf.95.2024.05.21.09.54.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 09:54:52 -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="BBFBp//s"; 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 797C5384AB6F for ; Tue, 21 May 2024 16:54:52 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 63E8C3858D1E for ; Tue, 21 May 2024 16:54:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63E8C3858D1E 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 63E8C3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1035 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716310482; cv=none; b=E/BAyAvCVFVAoxPZRacskGC7550MbTdsqLh175u5p4ZwaP1+rQb7gxOJd1zS4Kr9GRdKkoxruM1Dl4kvcvGP2RC4PIsJj/oLiuWWj8Lj6fYmmIq1tFU2p3psUY35fA+haXWXXv2cnPESEu7zHNrbYcJo4ms61YWDggGQoRyUgfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716310482; c=relaxed/simple; bh=nXOctILiUfkFq97jCJDBlhc4gpCSpv6malavqztphls=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JpbkD3xs8TOlC0uWFDY7/QiMeOHqF6F3UdfdzGyUbGR7yaiZviX2rSiC2mTeDPyXZKDuVAbUXX/62n+xFdjGEmcSdO8gSK9kK4cLfFMGRQNgs3vR4qHvdSmrRr0/4QkJxsXcsNXbOk4runPdwywdJr3LfsoM3i82d4FtGYJDj8w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2b37731c118so1396566a91.1 for ; Tue, 21 May 2024 09:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716310476; x=1716915276; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ydeZ4ZztqLYjkQK/zDyjG9ZLwQgOBzYVntXDnfZCBy4=; b=BBFBp//slBwMjlGcCamMlkJjUqLkKwzcx7nm3dEOi0yYTiZm037K+1VqIA5JcpotC0 obrFveWTaFMfTt4/5ja9x4NwkH4eVf+91Dgl0UedpUJMy2T7/BVVI/i7lcNmwhBGnQhm kWbapogQxOUgHC6gfR/cv7q25EXhnxd9G0kY+WIiMaP8E2MLCm1bObSRFTWZmZepGuWD fM5/l7NvKdts+88+m5Ki72OOC/uHx+w5WqTlsLpPGoRWefeoOMirvzfT2PVCT9dvY4fJ 9unXZ881TY+GCZrq4X0LhffmIo6YGciMByKAz8c+Ptcjp7YRHdrAvCTWS4aQmU7rmGe8 uy2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716310476; x=1716915276; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ydeZ4ZztqLYjkQK/zDyjG9ZLwQgOBzYVntXDnfZCBy4=; b=e557zCwCa2874+JXMhDGRwUlzKVbPkiLlhl9cW+iy256mFVKUsgItSNzW7KqpW4Tjm ThcVLvkbrVN/I/XKdxPfkhnt3LHtYbQNVdyZgcBNBKRdpsLJiZKWbDIc5zqjujOXgGQl 5UXAE9sKktxfIdHrEUEjm0x3U7MYFFBpkqwwC2f3NWoRAd3Bgt0aoqunT1W0h0GChW2W F4W+9Uyc78sBUqEUid7hBn/1Q850DHgerHlm45zjwTs0xh7y0TpRuJZ3VefYK9wOnODS 2WXph79+Pe2w9FpIKbeNtKzETciGNMPDRmG/NxMjPcMhWE6ekzCLgju5DpQ3mSZkYuJn y+Vg== X-Gm-Message-State: AOJu0YyNvcG8uC5zmIpmghPOVOaXbRTf2Ut695n35IfcbNO8wuvjjVFU iSCBDuj6CCk3qG9bb8VPcytJ3eiIFCE58SctUmxx2oF5QkU/jCelk3EFNwsw3eDtixTo3mJCT1L T X-Received: by 2002:a17:90a:de92:b0:2b5:6d47:9e12 with SMTP id 98e67ed59e1d1-2b6cc34035cmr27488059a91.2.1716310475876; Tue, 21 May 2024 09:54:35 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:f76a:a4a6:1329:be7a:c724]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bd92b3d2b0sm1620774a91.3.2024.05.21.09.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 09:54:35 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "H . J . Lu" Subject: [PATCH v4 0/5] Improve libm.a static coverage Date: Tue, 21 May 2024 13:52:52 -0300 Message-ID: <20240521165430.2998944-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 Some recent math optimizations removed some symbols from the static build and due to the limited static build check, along with --disable-shared being broken for some time [1], this issue has slipped some releases. Although the fix is straightforward, I added an extra framework to enable static build for math libraries using the generic type framework (which autogenerated the tests for all supported types using the C template files). I have not enabled it for all tests due to the required extra size constraint, this is done with a new define that can be used with make check (build-math-static-tests). As an experiment, I enabled static build for all autogenerated math tests. This has uncovered some extra missing symbols on some ABIs, along with some issues with implementation used on static for some ABIs. On x86_64/i686 it shows that the assembly optimizations for acos, log10, log2, and ldbl-96 y0/y1 show some issues: x86_64-linux-gnu$ grep ^FAIL math/subdir-tests.sum FAIL: math/test-float64x-acos-static FAIL: math/test-float64x-log10-static FAIL: math/test-float64x-log2-static FAIL: math/test-float64x-y0-static FAIL: math/test-float64x-y1-static FAIL: math/test-ldouble-acos-static FAIL: math/test-ldouble-log10-static FAIL: math/test-ldouble-log2-static FAIL: math/test-ldouble-y0-static FAIL: math/test-ldouble-y1-static i686-linux-gnu$ grep ^FAIL math/subdir-tests.sum FAIL: math/test-double-atanh-static FAIL: math/test-float-atanh-static FAIL: math/test-float32-atanh-static FAIL: math/test-float32x-atanh-static FAIL: math/test-float64-atanh-static FAIL: math/test-float64x-acos-static FAIL: math/test-float64x-acosh-static FAIL: math/test-float64x-atanh-static FAIL: math/test-float64x-log10-static FAIL: math/test-float64x-log2-static FAIL: math/test-float64x-y0-static FAIL: math/test-float64x-y1-static FAIL: math/test-ldouble-acos-static FAIL: math/test-ldouble-acosh-static FAIL: math/test-ldouble-atanh-static FAIL: math/test-ldouble-log10-static FAIL: math/test-ldouble-log2-static FAIL: math/test-ldouble-y0-static FAIL: math/test-ldouble-y1-static The powerpc64le also shows multiple issues with the static linking (using gcc 13.1): FAIL: math/test-float128-exp10-static FAIL: math/test-float64x-exp10-static FAIL: math/test-ibm128-acos-static FAIL: math/test-ibm128-copysign-static FAIL: math/test-ibm128-exp10-static FAIL: math/test-ibm128-fmod-static FAIL: math/test-ibm128-frexp-static FAIL: math/test-ibm128-modf-static [...] I have not analyzed what is happening, but it might be due to the '-mabi=ibmlongdouble' along with how libgcc.a was built (I saw some issues on GCC bugzilla). I also tested this patchset with build-math-static-tests=yes for all ABIs, and there is not more build failures. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=20845 Adhemerval Zanella (5): math: Add support for auto static math tests math: Fix isnanf128 static build (BZ 31774) math: Provided copysignf128 for static libm on alpha, s390, and sparcv9 math: Provide frexpf128 for static libm on alpha, s390, and sparcv9 math: Provide modf128 for static libm on alpha, s390, and sparcv9 Makeconfig | 5 + Makefile.help | 4 + math/Makefile | 120 +++++++++++++++++++++- 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 + sysdeps/ieee754/float128/s_isnanf128.c | 4 + sysdeps/ieee754/ldbl-64-128/s_copysignl.c | 4 +- sysdeps/ieee754/ldbl-64-128/s_frexpl.c | 4 +- sysdeps/ieee754/ldbl-64-128/s_modfl.c | 4 +- 16 files changed, 143 insertions(+), 11 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