From patchwork Wed Jan 17 08:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Zhu X-Patchwork-Id: 84229 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 3CB77386F409 for ; Wed, 17 Jan 2024 08:20:27 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from va-2-33.ptr.blmpb.com (va-2-33.ptr.blmpb.com [209.127.231.33]) by sourceware.org (Postfix) with ESMTPS id 7DC84386EC02 for ; Wed, 17 Jan 2024 08:18:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DC84386EC02 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=oss.cipunited.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7DC84386EC02 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.127.231.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705479532; cv=none; b=A6+DQNZ7zcadf2RX9n1ML2GsKtTNEZB4gXhqiAscnXydQwAUJn6n++cxfJoWw0sU2yQEaAkisY8goGuFHMy1aBFU0OV8WRbpIhNL/iwnv7EJiOAjc+TAF8bGfRKrVJIaP5zSgxMM1s3SXyNwRvYg0IuBTdCjNu0sdxd/2GJKuBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705479532; c=relaxed/simple; bh=exV+m5sU8OkxpktSai1f93yJpzzw6+WCJc2oqZFipx0=; h=DKIM-Signature:Message-Id:Mime-Version:From:To:Subject:Date; b=a/XTqB5Yo5E8xs3HjHV6MTI+cdCXzC72f0RXV2Be3Cj7hzfiDV5nnnutiYB7XY+LPO788GSxKOHxQDbOQkGRs1vYbccvVcQqmAjpHDRzKD5+0aZLS1vlZSQb7yVBwxKO2uUZGcMmalSRXEoEfYHQBE8ZBPIOChyRS9JZ4MvYmjs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2303200042; d=oss.cipunited.com; t=1705479517; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=7LhFyQjCkPAeCSCjAtiYZ8jSwrevFo7dwjTWA+dbPxo=; b=HtlPz1tEyFR45arP6O/HhTv07p5lhgj/7bcvbHL9JpqAQgJQMrkmWWBOwZd2ZE6k4/s3ZB fYfDmc2JMf+xWrPI8WVuVfpAVtQlYg22iUmqXj9A21S6a9jLuI4hGwXOwbf1jQJ21lTeiT R+5oufxHY4MrQ9Y5ixJmDumm97JZbHic3JZU56anqMzJnmWZojLxDTCNvLXWlijvHyqLpe sThOP/ikd35Qx2+sj8s77qqtitYtbuvGfh87fQnugpMoFyQaP5nlV6Btaxyn7I9susDvF2 X4ueCQstlMPJ5TganC2bTEgqTQUfqHWadqgtrKcv/LjlSfKkKR4GRk9h8IQbAA== X-Lms-Return-Path: Message-Id: <20240117081704.1467-2-zhujunxian@oss.cipunited.com> Mime-Version: 1.0 X-Original-From: zhujunxian@oss.cipunited.com Received: from localhost.localdomain ([1.192.71.160]) by smtp.feishu.cn with ESMTPS; Wed, 17 Jan 2024 16:18:36 +0800 Cc: "Junxian Zhu" From: "Junxian Zhu" X-Mailer: git-send-email 2.43.0.windows.1 To: Subject: [PATCH] benchtests: Add more benchtests for rounding functions. Date: Wed, 17 Jan 2024 16:17:04 +0800 X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org From: Junxian Zhu This patch adds more benchtests for rounding functions. The double inputs are copied from trunc-inputs, the float inputs are copied from truncf-inputs. and the rintf is copied from rint-inputs. Reviewed-by: Adhemerval Zanella --- benchtests/Makefile | 11 +++++++++++ benchtests/ceil-inputs | 22 ++++++++++++++++++++++ benchtests/ceilf-inputs | 21 +++++++++++++++++++++ benchtests/floor-inputs | 22 ++++++++++++++++++++++ benchtests/floorf-inputs | 21 +++++++++++++++++++++ benchtests/llrint-inputs | 22 ++++++++++++++++++++++ benchtests/llrintf-inputs | 21 +++++++++++++++++++++ benchtests/lrint-inputs | 22 ++++++++++++++++++++++ benchtests/lrintf-inputs | 21 +++++++++++++++++++++ benchtests/nearbyint-inputs | 22 ++++++++++++++++++++++ benchtests/nearbyintf-inputs | 21 +++++++++++++++++++++ benchtests/rintf-inputs | 7 +++++++ 12 files changed, 233 insertions(+) create mode 100644 benchtests/ceil-inputs create mode 100644 benchtests/ceilf-inputs create mode 100644 benchtests/floor-inputs create mode 100644 benchtests/floorf-inputs create mode 100644 benchtests/llrint-inputs create mode 100644 benchtests/llrintf-inputs create mode 100644 benchtests/lrint-inputs create mode 100644 benchtests/lrintf-inputs create mode 100644 benchtests/nearbyint-inputs create mode 100644 benchtests/nearbyintf-inputs create mode 100644 benchtests/rintf-inputs diff --git a/benchtests/Makefile b/benchtests/Makefile index 4fb9bae023..c3e281f076 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -32,6 +32,8 @@ bench-math := \ atan2 \ atanh \ cbrt \ + ceil \ + ceilf \ cos \ cosf \ cosh \ @@ -44,6 +46,8 @@ bench-math := \ exp2f \ expf \ expm1 \ + floor \ + floorf \ fmax \ fmaxf \ fmin \ @@ -68,10 +72,17 @@ bench-math := \ logb \ logbf \ logf \ + llrint \ + llrintf \ + lrint \ + lrintf \ modf \ + nearbyint \ + nearbyintf \ pow \ powf \ rint \ + rintf \ roundeven \ roundevenf \ sin \ diff --git a/benchtests/ceil-inputs b/benchtests/ceil-inputs new file mode 100644 index 0000000000..49ff407a6a --- /dev/null +++ b/benchtests/ceil-inputs @@ -0,0 +1,22 @@ +## args: double +## ret: double +## includes: math.h +0.0 +-0.0 +0.001 +-0.001 +0.5 +-0.5 +0.999 +-0.999 +1.0 +-1.0 +1.001 +-1.001 +123.5 +-123.5 +12345.1 +-1000000.1 +1e15 +-1e30 +1e200 diff --git a/benchtests/ceilf-inputs b/benchtests/ceilf-inputs new file mode 100644 index 0000000000..c37c5dacba --- /dev/null +++ b/benchtests/ceilf-inputs @@ -0,0 +1,21 @@ +## args: float +## ret: float +## includes: math.h +0.0f +-0.0f +0.001f +-0.001f +0.5f +-0.5f +0.999f +-0.999f +1.0f +-1.0f +1.001f +-1.001f +123.5f +-123.5f +12345.1f +-1000000.5f +1e15f +-1e30f diff --git a/benchtests/floor-inputs b/benchtests/floor-inputs new file mode 100644 index 0000000000..49ff407a6a --- /dev/null +++ b/benchtests/floor-inputs @@ -0,0 +1,22 @@ +## args: double +## ret: double +## includes: math.h +0.0 +-0.0 +0.001 +-0.001 +0.5 +-0.5 +0.999 +-0.999 +1.0 +-1.0 +1.001 +-1.001 +123.5 +-123.5 +12345.1 +-1000000.1 +1e15 +-1e30 +1e200 diff --git a/benchtests/floorf-inputs b/benchtests/floorf-inputs new file mode 100644 index 0000000000..c37c5dacba --- /dev/null +++ b/benchtests/floorf-inputs @@ -0,0 +1,21 @@ +## args: float +## ret: float +## includes: math.h +0.0f +-0.0f +0.001f +-0.001f +0.5f +-0.5f +0.999f +-0.999f +1.0f +-1.0f +1.001f +-1.001f +123.5f +-123.5f +12345.1f +-1000000.5f +1e15f +-1e30f diff --git a/benchtests/llrint-inputs b/benchtests/llrint-inputs new file mode 100644 index 0000000000..49ff407a6a --- /dev/null +++ b/benchtests/llrint-inputs @@ -0,0 +1,22 @@ +## args: double +## ret: double +## includes: math.h +0.0 +-0.0 +0.001 +-0.001 +0.5 +-0.5 +0.999 +-0.999 +1.0 +-1.0 +1.001 +-1.001 +123.5 +-123.5 +12345.1 +-1000000.1 +1e15 +-1e30 +1e200 diff --git a/benchtests/llrintf-inputs b/benchtests/llrintf-inputs new file mode 100644 index 0000000000..c37c5dacba --- /dev/null +++ b/benchtests/llrintf-inputs @@ -0,0 +1,21 @@ +## args: float +## ret: float +## includes: math.h +0.0f +-0.0f +0.001f +-0.001f +0.5f +-0.5f +0.999f +-0.999f +1.0f +-1.0f +1.001f +-1.001f +123.5f +-123.5f +12345.1f +-1000000.5f +1e15f +-1e30f diff --git a/benchtests/lrint-inputs b/benchtests/lrint-inputs new file mode 100644 index 0000000000..49ff407a6a --- /dev/null +++ b/benchtests/lrint-inputs @@ -0,0 +1,22 @@ +## args: double +## ret: double +## includes: math.h +0.0 +-0.0 +0.001 +-0.001 +0.5 +-0.5 +0.999 +-0.999 +1.0 +-1.0 +1.001 +-1.001 +123.5 +-123.5 +12345.1 +-1000000.1 +1e15 +-1e30 +1e200 diff --git a/benchtests/lrintf-inputs b/benchtests/lrintf-inputs new file mode 100644 index 0000000000..c37c5dacba --- /dev/null +++ b/benchtests/lrintf-inputs @@ -0,0 +1,21 @@ +## args: float +## ret: float +## includes: math.h +0.0f +-0.0f +0.001f +-0.001f +0.5f +-0.5f +0.999f +-0.999f +1.0f +-1.0f +1.001f +-1.001f +123.5f +-123.5f +12345.1f +-1000000.5f +1e15f +-1e30f diff --git a/benchtests/nearbyint-inputs b/benchtests/nearbyint-inputs new file mode 100644 index 0000000000..49ff407a6a --- /dev/null +++ b/benchtests/nearbyint-inputs @@ -0,0 +1,22 @@ +## args: double +## ret: double +## includes: math.h +0.0 +-0.0 +0.001 +-0.001 +0.5 +-0.5 +0.999 +-0.999 +1.0 +-1.0 +1.001 +-1.001 +123.5 +-123.5 +12345.1 +-1000000.1 +1e15 +-1e30 +1e200 diff --git a/benchtests/nearbyintf-inputs b/benchtests/nearbyintf-inputs new file mode 100644 index 0000000000..c37c5dacba --- /dev/null +++ b/benchtests/nearbyintf-inputs @@ -0,0 +1,21 @@ +## args: float +## ret: float +## includes: math.h +0.0f +-0.0f +0.001f +-0.001f +0.5f +-0.5f +0.999f +-0.999f +1.0f +-1.0f +1.001f +-1.001f +123.5f +-123.5f +12345.1f +-1000000.5f +1e15f +-1e30f diff --git a/benchtests/rintf-inputs b/benchtests/rintf-inputs new file mode 100644 index 0000000000..f7c6f06789 --- /dev/null +++ b/benchtests/rintf-inputs @@ -0,0 +1,7 @@ +## args: float +## ret: float +## includes: math.h +78.5 +-78.5 +4503599627370497.0 +-4503599627370497.0