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 X-Patchwork-Id: 707091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tj2jp5Q5tz9vF7 for ; Tue, 20 Dec 2016 01:05:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="NwhJ36Jd"; dkim-atps=neutral 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=hGx32QQlt5XXZ3xKxKJe+yCqWiI8a7L daphL30Zit/rxUKIVyLI7jgrwtFD1fpzehDNXpKWX6wPOG+XlcMgXXTmlw4px9d5 h6UUBUvurED8TJK9rhyCUJOtmRC2hXLYTJBPhd8JisYluHYOvFvEEo4cFUbZy93S svnY2UITSMdQ= 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=NwhJ3 6JdNMSQa3pVxl1x03O9nMZwFmQ4JPjJoKNMSBe1u33P5eTn/WgHbO2RrxF8WPGNs iWU+7mWlJsa38boxdKeVVVa8FVgbyZqhiOYgvMRvAOg0uqs3yaLIuregXO+XHfEJ OyNpG/1/OogCKovscJF6hd8r1r64QbEIP/fIiI= 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 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 ("")