From patchwork Fri Dec 3 00:01:02 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: 48448 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 21860385BF9B for ; Fri, 3 Dec 2021 00:09:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21860385BF9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638490178; bh=GtntpGtdqgHfX0Fmy9BZYfmITV+lNia4vCnvI35/sfA=; 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=TrdApB51tuJquikda20vgHVT2sbFCc5cBBDdn6rO+yATD3N8qjpeHUn6hdmWob9WI w/l2JzINdCFgKQ/BzqRMZ08UBsPyRGO9W47ihLcxIdIF6HerCemgSKJG0zmeazUCfE d1FrVU0aAqsCyv7IF8p/GoN6AXpeeE4hjbdCffLM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by sourceware.org (Postfix) with ESMTPS id D828F385C41A for ; Fri, 3 Dec 2021 00:01:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D828F385C41A Received: by mail-qt1-x82e.google.com with SMTP id p19so1533723qtw.12 for ; Thu, 02 Dec 2021 16:01:25 -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=GtntpGtdqgHfX0Fmy9BZYfmITV+lNia4vCnvI35/sfA=; b=8Ir+PFuLPj7BnNhpD3muBMSgeoZST9i+WYTIHeyc6xl2EGn1c0RzmCEwHgbe7L3Mqn 2D6wPZiPcLshPH08bWzo6RdQU0krgUNjeuLHvXvaDvwstPo0AOTnz4baOlbu5DdYYcIe HfFGl1gGMtB1sEFlUofMVAN6vB1zCGhEOwwk8vipHNCeG89+0+tFlr0CLJ1LIIMmkWUx FZ5I/9lN7PrZB//VqA9BTJcs8cPRjw5hrjL4T4NIWrYkLAxLvHj6aMEyUDScsDdfgs4q uCYyCElowgS8gYMovZFAHIx6WH0i4d62whUz8yPopT3/+OXEtj3Rij6Y2+w8aUhCKdfY gbFg== X-Gm-Message-State: AOAM5323kZUCOGiZx0S3y4sIKx/ttu40FWppI2mTpEQvMik+y67QSFx7 RfKCWfs6Hw6Zk6iDHF516Yv9I8A504hUxw== X-Google-Smtp-Source: ABdhPJztx1R+IRYyg8Js+IKsjcOM5H742HVPCRbt6WAcngal+wfzwU/tJbrZoze0X9tqOoVUSdd0Ww== X-Received: by 2002:a05:622a:30b:: with SMTP id q11mr17433586qtw.348.1638489685316; Thu, 02 Dec 2021 16:01:25 -0800 (PST) Received: from birita.. ([2804:431:c7cb:30f8:3030:59d3:d31c:ed39]) by smtp.gmail.com with ESMTPSA id m9sm938714qkn.59.2021.12.02.16.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 16:01:25 -0800 (PST) To: libc-alpha@sourceware.org, Paul Zimmermann , Wilco Dijkstra Subject: [PATCH v4 11/12] math: Use fmin/fmax on hypot Date: Thu, 2 Dec 2021 21:01:02 -0300 Message-Id: <20211203000103.737833-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211203000103.737833-1-adhemerval.zanella@linaro.org> References: <20211203000103.737833-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 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 f53061badc..ce51784d27 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))