From patchwork Tue May 31 21:34:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 54595 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 8A9063834F0E for ; Tue, 31 May 2022 21:35:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A9063834F0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654032928; bh=XBV6DLc9QS44/4BXxcKiVTfGYfrLmulmDL1gjyqmbxI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZNsdcQocMXARsGqWlWGMJTNzGF7Q8PpLQ2wyBeYfyiqtoykJGPIHMKD+ZIjPWcCuA DuGhar9RRPaoZeRmAfX77TlbDMkI1l76rf1usrGlT+aIJ8QMG+Y8tn/98Oy5VgRRLP mLirFKCx1pcDXx5vr443p/JUBMz3cX6kqSP7Q8xc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 71065383E68C for ; Tue, 31 May 2022 21:35:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71065383E68C Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-f2cbceefb8so123784fac.11 for ; Tue, 31 May 2022 14:35:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=XBV6DLc9QS44/4BXxcKiVTfGYfrLmulmDL1gjyqmbxI=; b=y0iqp57g025HlKr0s1/fG4aVCHQRt8NbWDrLTZK4AuDXmtAqxzDoCzdtvxQKJjm62F TQo0UjBa1TN1/EoYbdRfPk9s7VPEAmAq9z64zoCC6U5pIXuWn75gG45LzHRlwZIRCrsO 4RYpKu83hrcC+nQPGCC1ttVEehPbenqXVyjkOJvar+aMblQ79WtUkwh8JOjXc075V1Ip uQ1meSdUzVL5k/AZWDRKl8R51fX+3L2db8EFlrupDVpLGsPOzQflGv+SLaQQVV5rdGuA ZaZ6cytSHK4OLRtuqQ542dn+sCY/B1AKP99dF/3jWFfwKxbaeLk2v4JOGA74Jt5+GVpr oUTQ== X-Gm-Message-State: AOAM531o449G/zKKEqx4yYz6aoj75pV55FElGuI85vZ2AWktgDG98Q68 yOUI7nqSVM73+3DPtNF2wFeJDY6Xg7M+Bw== X-Google-Smtp-Source: ABdhPJx78/TRWTnYigzh3sC8ZlkkcUFowQWIY3EsPFdFON72najFSzy5+X/bV29goCZDE7kOo2C0qg== X-Received: by 2002:a05:6870:ec93:b0:f3:3856:f573 with SMTP id eo19-20020a056870ec9300b000f33856f573mr6301479oab.17.1654032906561; Tue, 31 May 2022 14:35:06 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:e39c:980f:eaf1:7a30:10ef]) by smtp.gmail.com with ESMTPSA id s31-20020a056830439f00b0060613c844adsm6890802otv.10.2022.05.31.14.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 14:35:06 -0700 (PDT) To: libc-alpha@sourceware.org, "H . J . Lu" Subject: [PATCH 0/5] Use generic sinf, cosf, and sincosf for i686 Date: Tue, 31 May 2022 18:34:57 -0300 Message-Id: <20220531213502.227895-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Performance seems to be similar, with generic implementation showing slight better performance for sinf large inputs and for sincosf. Although generic implementation shows slight lower precision (the ulp data required some adjustments), the code size shows a good improvement: i686-linux-gnu-master$ size math/s_sinf-sse2.os math/s_cosf-sse2.os math/s_sincosf-sse2.os text data bss dec hex filename 1555 0 0 1555 613 math/s_sinf-sse2.os 1551 0 0 1551 60f math/s_cosf-sse2.os 1754 0 0 1754 6da math/s_sincosf-sse2.os i686-linux-gnu-patched$ size math/s_sinf-sse2.os math/s_cosf-sse2.os math/s_sincosf-sse2.os text data bss dec hex filename 1059 0 0 1059 423 math/s_sinf-sse2.os 1067 0 0 1067 42b math/s_cosf-sse2.os 993 0 0 993 3e1 math/s_sincosf-sse2.os And it also simplifies the code base a lot with less assembly implementations. Adhemerval Zanella (5): benchtests: Add workload name for cosf i686: Use generic cosf implementation for SSE2 version i686: Use generic sinf implementation for SSE2 version benchtests: Add workload name for sincosf math: Use generic sinf implementation for SSE2 version benchtests/cosf-inputs | 2 +- benchtests/sincosf-inputs | 1 + sysdeps/i386/i686/fpu/multiarch/Makefile | 3 + .../i386/i686/fpu/multiarch/libm-test-ulps | 11 + sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S | 552 ----------------- sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.c | 3 + .../i386/i686/fpu/multiarch/s_sincosf-sse2.S | 585 ------------------ .../i386/i686/fpu/multiarch/s_sincosf-sse2.c | 3 + sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S | 565 ----------------- sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.c | 3 + sysdeps/ieee754/flt-32/s_cosf.c | 5 + sysdeps/ieee754/flt-32/s_sinf.c | 5 + 12 files changed, 35 insertions(+), 1703 deletions(-) delete mode 100644 sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S create mode 100644 sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.c delete mode 100644 sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S create mode 100644 sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.c delete mode 100644 sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S create mode 100644 sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.c