From patchwork Wed Dec 18 14:13:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Blackmore X-Patchwork-Id: 13913757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 872E6E7718A for ; Wed, 18 Dec 2024 14:14:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuof-0002le-S5; Wed, 18 Dec 2024 09:14:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuoF-0002i1-Em for qemu-devel@nongnu.org; Wed, 18 Dec 2024 09:13:55 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNuo7-0007UZ-MP for qemu-devel@nongnu.org; Wed, 18 Dec 2024 09:13:54 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso46170565e9.3 for ; Wed, 18 Dec 2024 06:13:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1734531222; x=1735136022; darn=nongnu.org; h=autocrypt:subject:from:cc:to:content-language:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=PW1wHV354/Pv7XvGOyGFzY5d1m920o2ZFJYpbtOX4ew=; b=Cj30S7JOJpcHyl255SgxFJDedENBpeykqFET9T4SJcyUIF4XkzUtfp4XBQlp7EYJ5m IPE7bZqjth/GZPvNhL+kb+ZY9ls5Bm0tPpnpb/nzhKH2MngLjp5giTqPziPDwIOSAwd/ 3l55xnF+eO+e+fxjWD/Daj1/H5dP2wiRvadFaFpHVOjc95szWPq1epVH6/DUN0ktYv74 V0PYz7sZm9007LbMgdSsioDlC9sAkcDNAL4T8n/soDJS5iwE6q0zbKOR0luk4edLt9Zg 9rlQPe5+tYZ3p14SODfUpWdSc5d37Hq/EXNL5zTPuMZ8jWk+VceyZGxtESUCyadWkln5 KGNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531222; x=1735136022; h=autocrypt:subject:from:cc:to:content-language:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=PW1wHV354/Pv7XvGOyGFzY5d1m920o2ZFJYpbtOX4ew=; b=gn9MJrqHLCaw9ygv3hmXz85YeOuBeqYfRwAWAy5dVl45AaI9XOOME6XInawUeZVkOu xt+tdnudplCYk5W8F2vWyNwBPv5rrq5lE509S6BI2LLwkFE7xCKcFV1AS1eub4f15Sj0 KJXxoIoPj4SGPhKDwpHst49bbOpLlbTKa0UqIt/1VQevGUsAqg+vjyVgfZka22SwF6nb O22IYcEs/SrL5GQxl+3R3grRyTlAdgcnqLJmlxtKhxJSLS5fMwERZIJE0bFL7umGBJRr O5rWdI0CCOvhUBCKeZ6XzS9I7wpWyZlyshEqCcKBnYenmDFE9Dx8NcDdWQADfaAIJ+hG Jayw== X-Gm-Message-State: AOJu0YxY7ewk2HC4SzExLimwKDs4zB2sLzq0XwmAh45JIg7rc8rZ9V6X wXkuUhFHJlHvZdhJIQWU4etE05gGqcW43G12PWkZNa72OhWcyUE4KATONjJ3/FhZ6vyBxsDrK+K cC6w= X-Gm-Gg: ASbGncvmUPlOL9T3ax9rM0Vl4z4iW/SPW+1i4w2gT246gCFS+0bGK0sK1/sdZqm1cpA ziSi3ZY+WKxUKv1+uizF8BCRL66bI6/XWWFPNu1JMByyGOhY5vk0GP4ebORsFDSKDkRRI+tV33Z xnzYbpAawE9+Xa0zpawVvvOuQCajPypkcXOrC1Y0vmtFfnf9Za9yCt8HXtRrclzUZxqJDUW/NEM SXwpMvWA4dOQi60eBIbAdOEr/mZPaPC4cbKtpZrxqqErtmmoCmaTgg/RAtfrtqdqR5+13jLHQeg xkxlM2m/GWR3CO0OmBM1uGwsOC+CbXGQwNpEalzbQpDe6b6xCdevgsA0 X-Google-Smtp-Source: AGHT+IHjlGLQh/0Ht1NuzfwFHC7r3NUmSz+8SSoHLydD08jL2KtomiC9JrjhzhUitw7DI7wXOCl3NQ== X-Received: by 2002:a05:600c:4f11:b0:436:51bb:7a43 with SMTP id 5b1f17b1804b1-4365534876bmr26179015e9.5.1734531221001; Wed, 18 Dec 2024 06:13:41 -0800 (PST) Received: from [192.168.0.55] (sals-04-b2-v4wan-167965-cust660.vm36.cable.virginm.net. [80.3.10.149]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b190absm21443525e9.29.2024.12.18.06.13.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Dec 2024 06:13:39 -0800 (PST) Message-ID: <14dfb7b7-98bb-4e8c-a223-c568512180b7@embecosm.com> Date: Wed, 18 Dec 2024 14:13:37 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Cc: Craig Blackmore , Richard Henderson , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Helene Chelin , Nathan Egge , Max Chou , Paolo Savini From: Craig Blackmore Subject: [PATCH v8 0/2] target/riscv: rvv: reduce the overhead for simple RISC-V vector unit-stride loads and stores Autocrypt: addr=craig.blackmore@embecosm.com; keydata= xsBNBFdIF8oBCACwrsvc6YVfzJRT+ZoBfL9jEb8ITwNahDxCG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QcfrqAU6T89Aa0VFw92J+w5d2spF8MUNPsvR NLm9ooCF3YME9STYHXrNH1U9fJUWpIC+b49UoWSWRD9nwl2h2i8AEQEAAcLAXwQYAQIACQUC V0gXygIbDAAKCRBhHkUCy5eVreLbB/sHPs1xu78uNV8O4UPTX7D5zBBS3nsrbDr+8stmXRap xbvo6kqKzIMAXuO3bYB/NyJ/tFzuFr9Tjd/2g56D2186bp01/kgxJ9CEl/m2T3lG3DlxIoLg pCExzTLTb8zH/7/6mdeJ17cdnrK+2QAKYctReVPAC67cq5KmUyU3bv5e1JzhV4ezz/i/O+Jv el112ZEsa54ya9KZOUHbgAR6hLnRWIa+8yQTtXqYRc3LxLRfS80Wn0Err1YvqFYzJsQMC8ND xAeEuqQ1gfk1b0jmv7tYljNqsHqzGVbuWz6hyzyLv5GjcdSDKpbw/797gRKQSY8Gty5ynfUH O4kKyuZPrE8P Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=craig.blackmore@embecosm.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Changes since v7: - Fixed typo `bits` -> `bytes` - Tuned threshold for applying the optimization - Provided results for larger sizes requested by Max Chou This patch provides up to 60% speedup on the `memcpy` benchmark from: https://github.com/embecosm/rise-rvv-tcg-qemu-tooling/tree/main/strmem-benchmarks There is some variation in the measurements so results are attached for six runs on a single thread on an Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz. The three graphs are: memcpy-594c0cb1ab-128-speedup.pdf: VLEN 128 memcpy-594c0cb1ab-1024-speedup.pdf: VLEN 1024 memcpy-594c0cb1ab-stdlib-speedup.pdf: Scalar (to further illustrate measurement variation as this version will not touch the function modified by this patch) Previous versions: - v1:https://lore.kernel.org/all/20240717153040.11073-1-paolo.savini@embecosm.com/ - v2:https://lore.kernel.org/all/20241002135708.99146-1-paolo.savini@embecosm.com/ - v3:https://lore.kernel.org/all/20241014220153.196183-1-paolo.savini@embecosm.com/ - v4:https://lore.kernel.org/all/20241029194348.59574-1-paolo.savini@embecosm.com/ - v5:https://lore.kernel.org/all/20241111130324.32487-1-paolo.savini@embecosm.com/ - v6:https://lore.kernel.org/all/20241204122952.53375-1-craig.blackmore@embecosm.com/ - v7:https://lore.kernel.org/all/20241211125113.583902-1-craig.blackmore@embecosm.com/ Cc: Richard Henderson Cc: Palmer Dabbelt Cc: Alistair Francis Cc: Bin Meng Cc: Weiwei Li Cc: Daniel Henrique Barboza Cc: Liu Zhiwei Cc: Helene Chelin Cc: Nathan Egge Cc: Max Chou Cc: Paolo Savini Craig Blackmore (2): target/riscv: rvv: fix typo in vext continuous ldst function names target/riscv: rvv: speed up small unit-stride loads and stores target/riscv/vector_helper.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)