From patchwork Wed Oct 23 11:46:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 52452 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:aaed:0:b0:48e:c0f8:d0de with SMTP id k13csp362036vqw; Wed, 23 Oct 2024 04:54:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWSDA5sjZjgrrkDLZ94rA7v/TgZVk5r6+bhxEt1utTwRfVW2+oJmhpkp2D8pPakjIYCxDqjSzGfKKOVIxgcdxkR@gmail.com X-Google-Smtp-Source: AGHT+IFUbdAoMvL9PQPkxRu4ytaAqUisI07+juk9dzqf+MJVCwKD855VMs6eu7hWpZTIklMkivPs X-Received: by 2002:a17:907:9715:b0:a9a:147d:fea3 with SMTP id a640c23a62f3a-a9abf8a8472mr95795666b.8.1729684444416; Wed, 23 Oct 2024 04:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729684444; cv=none; d=google.com; s=arc-20240605; b=JooTDDdnZpULZ4FT3oFWo7Q5KXdiiD/l+G7om65hyKlGJwb6TUQ3VyZhN0bPyyGAR9 55QtBWef6XkyFhiSKhhKQi/4/4sgx1Y2s8QJbxAhHsbv9l+f4Hrdo3dVOuAwzgFu5gXy JCdRtzNaNiBJhnb6ZSBzHYaD19cUta66Tl7j7qN4RFOo0m4CtBqglce5dUSInGFEiqwa x2alSdUxxSp2u5B0p4TjH9qMdD35iauis/IrPQFmwg0vO+/oN3KqCuKuY2nDbtOFqpKy Fbazjtp1jRbRxknxHDEAK4e85s7R1KcV40IXwlJRHpyQRiDlm7VBKsOLbRmylIwY7+/6 ofJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=6Fbb3AAT27pYm8yfSBjv2ujQcE1Xr/m+MjkAejRqi9Q=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=NzhsqQTRfOifWHn9EJ+H+JmzfUWoZoJyr93ZlcniXZXBkuQOSFQOdDRkrSuhw9EK3B O8aUNdxFIO8KbG/jMy2YIvMT+MfjMwAGlOjuQDmeARj1ZqCZ5FxbEhCwFPyMZP6iDUpA IlPut5cxABr86R+tEHD9wiRLfbSUGDNqDOHfsneqM4zKynzN7VJGUcHXluarN3hHGdzY uvFQRc4zONx1f7DfYooqk7uIfpt5sYwysZivrJ4oXR/O9s4zjHjPq2GF69hcJzNKZLCc su0m9nxyBF6f+fvOno6L3BWmDleaBXYTgcIsfgGrE0IpeIk3gOtLt/rQ2XCne3rKST5f HXHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=I7w25ESW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a9a91292b6fsi581795466b.44.2024.10.23.04.54.04; Wed, 23 Oct 2024 04:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=I7w25ESW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8203B68DD17; Wed, 23 Oct 2024 14:46:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6970C68D727 for ; Wed, 23 Oct 2024 14:46:11 +0300 (EEST) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-539e63c8678so8111146e87.0 for ; Wed, 23 Oct 2024 04:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1729683970; x=1730288770; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aDG7ZY2tzTLmgWwiT35DabsKEMae3NY3A2s8YbyRj6E=; b=I7w25ESWG52Zmmuu8fkCxcBaG7VCEs0adLgClyv4koDQNza4jBQrYeOvab6LvBdKqC UBnOQopRLc0BGMRVdicM/+qjCogEHQdSw7d62Im/gLp1Lw1wXoqRN+IcJwRrc4wsjqZA 3UoQRBzOIXdwsu30qDYU5uMaty7xnQzBcWkNfkUsZfXovOv2ycIiHILfvKUe/mmiTQo5 Si0e+XF5uQTbvBavKvv1q4/8RpsFqeShKwq8fogrTN0rHfUkrjd90HbbcOwQErtX4c3G KqiYqahpd+KLVGFaRlsI7HOCU4v+gJQzvUtOHrhgzgdC+YXJHyhda+dqMmgL2JX2DPJY rgLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729683970; x=1730288770; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aDG7ZY2tzTLmgWwiT35DabsKEMae3NY3A2s8YbyRj6E=; b=SDWPDkWmKymg9+xjbYpD2mOaBJ0g+7zqnLCJPCIIs5YUazk882B0WvqQ+Rc8HgqOTi fj6zVemeIQyaehH63R3KOodKgZI3BG6118pGLMsUWuLLRJRdOabkoDe7kJUq2UrqmGW4 KmwftnkE1st4Xt3wyjdgVFZAGydoudcMg9/lvVDl1PMjGvM+lvZn/v1YVGkb2moe2edC jEA8+ii4g4bqkZwYiJgpXYVvLFH60Ar6Vpdf5ovHKavc5qQ2hSw0De51SKCc0g3GkPGE 7dcV6Xpq3Dt8ooLRnXPXX+3yONFaZem2qZBJ0m3O+jH+vKDyUYXYO3mMD2FluIL7vfyM rwKw== X-Gm-Message-State: AOJu0Yx34+FtlFH7CCrhByX1QI+NIfkQxStlqui3y6Rby76/g/7pj4Ea nHTGmZyYls2twoiFJ0+Z1FKXndpnhc8oPyZ2PxfCEaIlJx6Flmem6zefJ9a2GAI1p9CwMKGmTKO gTw== X-Received: by 2002:a05:6512:2255:b0:539:8f4d:a7ca with SMTP id 2adb3069b0e04-53b1a37542bmr1112718e87.50.1729683970286; Wed, 23 Oct 2024 04:46:10 -0700 (PDT) Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a223e5597sm1052074e87.40.2024.10.23.04.46.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 23 Oct 2024 04:46:09 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 23 Oct 2024 14:46:09 +0300 Message-Id: <20241023114609.83136-1-martin@martin.st> X-Mailer: git-send-email 2.39.5 (Apple Git-154) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] checkasm: Print benchmarks of C-only functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 5/W0il5CheUh This corresponds to commit 9278a14cf406f8edb5052c42b83750112bf5b515 in dav1d. Omitting the C-only functions doesn't speed up benchmarking anyway (as those has to be benchmarked before we know if we have any corresponding assembly functions), and being able to benchmark those functions without corresponding assembly can be valuable in a number of cases. --- tests/checkasm/checkasm.c | 48 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index c9d2b5faf1..c08188c8d4 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -624,34 +624,32 @@ static inline double avg_cycles_per_call(const CheckasmPerf *const p) static void print_benchs(CheckasmFunc *f) { if (f) { + CheckasmFuncVersion *v = &f->versions; + const CheckasmPerf *p = &v->perf; + const double baseline = avg_cycles_per_call(p); + double decicycles; + print_benchs(f->child[0]); - /* Only print functions with at least one assembly version */ - if (f->versions.cpu || f->versions.next) { - CheckasmFuncVersion *v = &f->versions; - const CheckasmPerf *p = &v->perf; - const double baseline = avg_cycles_per_call(p); - double decicycles; - do { - if (p->iterations) { - p = &v->perf; - decicycles = avg_cycles_per_call(p); - if (state.csv || state.tsv) { - const char sep = state.csv ? ',' : '\t'; - printf("%s%c%s%c%.1f\n", f->name, sep, - cpu_suffix(v->cpu), sep, - decicycles / 10.0); - } else { - const int pad_length = 10 + 50 - - printf("%s_%s:", f->name, cpu_suffix(v->cpu)); - const double ratio = decicycles ? - baseline / decicycles : 0.0; - printf("%*.1f (%5.2fx)\n", FFMAX(pad_length, 0), - decicycles / 10.0, ratio); - } + do { + if (p->iterations) { + p = &v->perf; + decicycles = avg_cycles_per_call(p); + if (state.csv || state.tsv) { + const char sep = state.csv ? ',' : '\t'; + printf("%s%c%s%c%.1f\n", f->name, sep, + cpu_suffix(v->cpu), sep, + decicycles / 10.0); + } else { + const int pad_length = 10 + 50 - + printf("%s_%s:", f->name, cpu_suffix(v->cpu)); + const double ratio = decicycles ? + baseline / decicycles : 0.0; + printf("%*.1f (%5.2fx)\n", FFMAX(pad_length, 0), + decicycles / 10.0, ratio); } - } while ((v = v->next)); - } + } + } while ((v = v->next)); print_benchs(f->child[1]); }