From patchwork Mon Dec 19 14:04:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 88474 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1173716qgi; Mon, 19 Dec 2016 06:05:07 -0800 (PST) X-Received: by 10.84.216.21 with SMTP id m21mr35062218pli.119.1482156307189; Mon, 19 Dec 2016 06:05:07 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r64si18500525pfa.128.2016.12.19.06.05.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 06:05:07 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76076-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-76076-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76076-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=hSE60SBJ3138BMxF+Rf64uSfGoRAhTB 3dMx/oSTwNrZWfyzt+30ChWPgtpzpICQpAjQDQL0fhPv99ihKe7bxP9hrlgZMztu QvmpCBHOKvegcQuNbzAHWzgIGTPqnqHLn7YiIu2rmwZZ3JXATt67iLGJWOO4vvcQ KKhyaZrXUSU0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=cnoABHdH+Q1vbX+zrSkTnQD9K9g=; b=HmVfP H7N+vyVO3s7jdwEEoL5TW2vlx36SFrkLIwnbeSq8qz2HCX8nFbfiobbEFZUGPgb8 VajRoixF4VG+NGHUTgFUXztiwV9E2lsRK31XRlkWnZvqN8wzUFa6g5n+Hsw/iCu4 i6RxNdnpAZBkJT16BClApMq1EIozzaLc0KplNw= Received: (qmail 115928 invoked by alias); 19 Dec 2016 14:04:44 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 115892 invoked by uid 89); 19 Dec 2016 14:04:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=sinh, tan, benchtests, sk:ba4d068 X-HELO: mail-yw0-f171.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=PqVc70ktocDDI8SdBFwJgYd4yVBOLxy+N5klD3rItl4=; b=Kou3koYiBji4nNpudHArUNUaZ93VM2LMynMTCXnRBKVsPxKoQ8Kd2vHweqf/kgPoow ELrC75B6+usjqXD908gJtKtvcVyv1UhiFydvihGJmcpPqo4TrI2B55kFphPhWgxuxnLa c1xCjdk2w7vr8ENsDjQk8f48YR4QFqxIApZgf/1yqlsbI5j5r/qlR4/GfUgKklmiIz3z 8hNrbJr3pckoHt7Cpl305/IK2hDMK7wFCB05YUlDZb1oHaI34NDMU6jvTE3OhNyKb1Nb 5Fy52M8wH0WSAW2uSqiBUoM8VHE1iq/d8S182KYf2vlNQ5PBVIPGEvs3h2agErs0WEK7 w0sg== X-Gm-Message-State: AKaTC02P7SX1h24tWlYQP0qQeqRUgFxKopQ2KYZ4ETKEXn8SWaYCS6iAXMdSKEYqVvzRoZa4 X-Received: by 10.129.167.1 with SMTP id e1mr12653435ywh.323.1482156272061; Mon, 19 Dec 2016 06:04:32 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] benchtests: Add fmax/fmin benchmarks Date: Mon, 19 Dec 2016 12:04:21 -0200 Message-Id: <1482156263-22267-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1482156263-22267-1-git-send-email-adhemerval.zanella@linaro.org> References: <1482156263-22267-1-git-send-email-adhemerval.zanella@linaro.org> This patch adds fmax and fmin benchtests. It is based math/s_fmax_template.c implementation which checks for basically four different classes: 1. if x is greater or equal than y. 2. if x is less than y. 3. if x or y is signaling. 4. if y is nan. Cases 1 and 2 are used for default input number (by mixing normal double numbers and infinity), while case 3 and 4 are used each for on for a benchmark class. Checked on x86_64-linux-gnu and powerpc64-linux-gnu. * benchtests/Makefile (bench-math): Add fmin and fmax. * benchtests/fmax-inputs: New file. * benchtests/fmin-inputs: Likewise. --- ChangeLog | 4 ++++ benchtests/Makefile | 2 +- benchtests/fmax-inputs | 23 +++++++++++++++++++++++ benchtests/fmin-inputs | 23 +++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 benchtests/fmax-inputs create mode 100644 benchtests/fmin-inputs -- 2.7.4 diff --git a/benchtests/Makefile b/benchtests/Makefile index ba4d068..a3b53e1 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -24,7 +24,7 @@ subdir := benchtests include ../Makeconfig bench-math := acos acosh asin asinh atan atanh cos cosh exp exp2 log log2 \ - modf pow rint sin sincos sinh sqrt tan tanh + modf pow rint sin sincos sinh sqrt tan tanh fmin fmax bench-pthread := pthread_once diff --git a/benchtests/fmax-inputs b/benchtests/fmax-inputs new file mode 100644 index 0000000..18eb8fe --- /dev/null +++ b/benchtests/fmax-inputs @@ -0,0 +1,23 @@ +## includes: math.h +## args: double:double +## ret: double +78.5, -78.5 +-78.5, 78.5 +0, 78.5 +78.5, 0 +0, -78.5 +-78.5, 0 +__builtin_inf (), 78.5 +__builtin_inf (), -78.5 +78.5, __builtin_inf () +-78.5, __builtin_inf () +## name: qNaN +__builtin_nan (""), 78.5 +__builtin_nan (""), -78.5 +78.5, __builtin_nan ("") +-78.5, __builtin_nan ("") +## name: sNaN +__builtin_nans (""), 78.5 +__builtin_nans (""), -78.5 +78.5, __builtin_nans ("") +-78.5, __builtin_nans ("") diff --git a/benchtests/fmin-inputs b/benchtests/fmin-inputs new file mode 100644 index 0000000..18eb8fe --- /dev/null +++ b/benchtests/fmin-inputs @@ -0,0 +1,23 @@ +## includes: math.h +## args: double:double +## ret: double +78.5, -78.5 +-78.5, 78.5 +0, 78.5 +78.5, 0 +0, -78.5 +-78.5, 0 +__builtin_inf (), 78.5 +__builtin_inf (), -78.5 +78.5, __builtin_inf () +-78.5, __builtin_inf () +## name: qNaN +__builtin_nan (""), 78.5 +__builtin_nan (""), -78.5 +78.5, __builtin_nan ("") +-78.5, __builtin_nan ("") +## name: sNaN +__builtin_nans (""), 78.5 +__builtin_nans (""), -78.5 +78.5, __builtin_nans ("") +-78.5, __builtin_nans ("")