From patchwork Tue Dec 7 19:03:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 48606 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 56C0B385843E for ; Tue, 7 Dec 2021 19:12:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56C0B385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638904342; bh=LAONUMJ0mZQzMVb5EKfS5F4ojKPvVLRk78a9cZutzs4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=aaDQpIs21xJfMNQT5azP7dPoujqr6UNOOp3H87B13TCbejtfHt759a2F7eiAy9ca4 r0/QfMl/A9PMFBr7wsSHMW6sB6faYfVbVaLHF4Q8H2t3lk3/orxYvsP2eLKD25ulIw i7bJ8djCevEgFKGU51EKq6Ai9ZZf+/MwbLtwdoag= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by sourceware.org (Postfix) with ESMTPS id 0795E3858432 for ; Tue, 7 Dec 2021 19:04:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0795E3858432 Received: by mail-ua1-x930.google.com with SMTP id p37so301871uae.8 for ; Tue, 07 Dec 2021 11:04:42 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=LAONUMJ0mZQzMVb5EKfS5F4ojKPvVLRk78a9cZutzs4=; b=eI1oxRsGezFlF0n7qmNnqJOZH7zCztiCQKHAqmByg8p2ng2CrRigZyY8ZvEgaM0sff TnE9bxmClWW5qH5Fq3fxVNYs4MwDWI2mr1xKyDVAr7jgOzb9djJ7xqX2jyk7GmVmcgH5 VMuLSqZ6AvPxxRq76qOF1HQQac4IjIT8T4FPnugeT68WDa9c1EsOHSmOO/GnquLKX5b5 a1RwwbdLLVH9wIaP79RwjOfKvBG2BEHte3GZ0zyZ0CKEGY2C3UgZ44LBSwUKicTP16WG CslA8er7CFrnvw1eJbIwVrFns99Hzr/l5yYQcOkb+wouC319jH8fXb+8UukvP2qoOtyZ ejeg== X-Gm-Message-State: AOAM532dqk44Nwg/0HHNwoGCyAjKjz5HQYDVyG3OQC71H4Y5VRuWim0v dGEf+ER+a3rfc35yHjHFc2vZMAuJVr4lzQ== X-Google-Smtp-Source: ABdhPJyzVT7f+APSAKf03QKyMJTLnD2xr96+iRBln6k9xHkcqj18VvtqrG1FPbZo6SwLb8qe9LxR5g== X-Received: by 2002:a05:6102:1354:: with SMTP id j20mr47697038vsl.41.1638903881022; Tue, 07 Dec 2021 11:04:41 -0800 (PST) Received: from birita.. ([2804:431:c7ca:a776:246c:70fd:1377:eec7]) by smtp.gmail.com with ESMTPSA id l190sm312904vsc.26.2021.12.07.11.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 11:04:40 -0800 (PST) To: libc-alpha@sourceware.org, Paul Zimmermann , Wilco Dijkstra Subject: [PATCH v5 11/12] math: Use fmin/fmax on hypot Date: Tue, 7 Dec 2021 16:03:52 -0300 Message-Id: <20211207190353.3282666-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207190353.3282666-1-adhemerval.zanella@linaro.org> References: <20211207190353.3282666-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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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" From: Wilco Dijkstra It optimizes for architectures that provides fast builtins. Checked on aarch64-linux-gnu. --- sysdeps/ieee754/dbl-64/e_hypot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c index 6fedf0d61f..0bdab989e4 100644 --- a/sysdeps/ieee754/dbl-64/e_hypot.c +++ b/sysdeps/ieee754/dbl-64/e_hypot.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "math_config.h" @@ -95,8 +96,8 @@ __ieee754_hypot (double x, double y) x = fabs (x); y = fabs (y); - double ax = x < y ? y : x; - double ay = x < y ? x : y; + double ax = USE_FMAX_BUILTIN ? fmax (x, y) : (x < y ? y : x); + double ay = USE_FMIN_BUILTIN ? fmin (x, y) : (x < y ? x : y); /* If ax is huge, scale both inputs down. */ if (__glibc_unlikely (ax > LARGE_VAL))