From patchwork Tue Dec 7 19:03:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 48604 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 BF7143858409 for ; Tue, 7 Dec 2021 19:10:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF7143858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638904252; bh=A80gN6iv54vBsutYoc11dBDq8c7nqa3TUeO1DMEVn1E=; 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=OG6AGPi2ORwpPvMB0hTr3FTc6Y7NKw88q9kn2dpO6CUtGN017KIWBIMw4JPcJIuGm HTJrrUK6KNVeWVdBrLtAPNrZY1SJCkYllJ3Bds52kmxm0NQzWL6L1Ui2hutV4GL0z1 hF3p00+jLhorfh7hVu1HVzbUpIWtoTorH1eQT9w0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-vk1-xa2c.google.com (mail-vk1-xa2c.google.com [IPv6:2607:f8b0:4864:20::a2c]) by sourceware.org (Postfix) with ESMTPS id BD7633858423 for ; Tue, 7 Dec 2021 19:04:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD7633858423 Received: by mail-vk1-xa2c.google.com with SMTP id m16so9881472vkl.13 for ; Tue, 07 Dec 2021 11:04:38 -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=A80gN6iv54vBsutYoc11dBDq8c7nqa3TUeO1DMEVn1E=; b=JZJyxd8cmCPqunt/AIkzbr5bH0UX9rNIDDFjXGSAG3pgAEoQBBoG5D1kTd6qYZitrn zoOBkN+FAKbATil6RHQTwY+51qMXLW7Rk6Rhf8KqvophSvK5hj7JCkGu0H1zxxhkwf+P jxgmXa6ZArUy6crWANb371rl/0PaBOZJPRsv5A7NHG6OZKSNcN4IJI0L1ptB7Zy0n1f2 e7elJO3Eowt6VbBUqRPJ24laC51npDP9ugI7q19PjRdAbqAr5MboeVk55VOhz1I2N9Cn hyT3j0a9SrRyEPvPQ1S8R7ahe3BimnhwHwlrzsoijdmSyug8CL9y1ZB2x8/pdPdhQLgM CCqA== X-Gm-Message-State: AOAM533d4fdjsFSjq+WsrIO2oheZB1puWndoc3af/0mK7PlZqdk3Wxvv /UzuXKXVmds/JTOvflIhpmAkqCAqIfQxpQ== X-Google-Smtp-Source: ABdhPJyLHLHs6F4hTarT8wH46Rgu98v+56Z5RjooWah4T8DNb4BYpcJ2xWjCIz1DmKCux+tdYkWJYA== X-Received: by 2002:a05:6122:1796:: with SMTP id o22mr54948127vkf.23.1638903878239; Tue, 07 Dec 2021 11:04:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 11:04:38 -0800 (PST) To: libc-alpha@sourceware.org, Paul Zimmermann , Wilco Dijkstra Subject: [PATCH v5 09/12] math: Add math-use-builtinds-fmin.h Date: Tue, 7 Dec 2021 16:03:50 -0300 Message-Id: <20211207190353.3282666-10-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, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It allows the architecture to use the builtin instead of generic implementation. --- math/s_fmin_template.c | 6 +++++- sysdeps/generic/math-use-builtins-fmin.h | 4 ++++ sysdeps/generic/math-use-builtins.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 sysdeps/generic/math-use-builtins-fmin.h diff --git a/math/s_fmin_template.c b/math/s_fmin_template.c index 565a836266..d673704289 100644 --- a/math/s_fmin_template.c +++ b/math/s_fmin_template.c @@ -17,11 +17,14 @@ . */ #include - +#include FLOAT M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y) { +#if M_USE_BUILTIN (FMIN) + return M_SUF (__builtin_fmax) (x, y); +#else if (islessequal (x, y)) return x; else if (isgreater (x, y)) @@ -30,5 +33,6 @@ M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y) return x + y; else return isnan (y) ? x : y; +#endif } declare_mgen_alias (__fmin, fmin); diff --git a/sysdeps/generic/math-use-builtins-fmin.h b/sysdeps/generic/math-use-builtins-fmin.h new file mode 100644 index 0000000000..d2383ce00c --- /dev/null +++ b/sysdeps/generic/math-use-builtins-fmin.h @@ -0,0 +1,4 @@ +#define USE_FMIN_BUILTIN 0 +#define USE_FMINF_BUILTIN 0 +#define USE_FMINL_BUILTIN 0 +#define USE_FMINF128_BUILTIN 0 diff --git a/sysdeps/generic/math-use-builtins.h b/sysdeps/generic/math-use-builtins.h index e07bba242f..24fba47575 100644 --- a/sysdeps/generic/math-use-builtins.h +++ b/sysdeps/generic/math-use-builtins.h @@ -35,5 +35,6 @@ #include #include #include +#include #endif /* MATH_USE_BUILTINS_H */