From patchwork Wed Dec 11 12:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Blackmore X-Patchwork-Id: 13903443 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 AE654E77182 for ; Wed, 11 Dec 2024 12:52:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLMCF-0003JT-II; Wed, 11 Dec 2024 07:52:07 -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 1tLMBm-00035m-2H for qemu-devel@nongnu.org; Wed, 11 Dec 2024 07:51:38 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLMBj-0001sR-RX for qemu-devel@nongnu.org; Wed, 11 Dec 2024 07:51:37 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436202dd730so2714945e9.2 for ; Wed, 11 Dec 2024 04:51:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1733921493; x=1734526293; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6Y7B5PzMIQAYWoZxCx+iKjiN9AyJgktzWgwoHucsn1I=; b=Kt/s/BvTqj10g8H5ynLwe5k12VxJ8hBP5otmZ8Bt0dCC+74Mf5Id+HdywWBKTgtr7/ QZlJyFCXCSA7beiHp71K9zZqCy7Zfstn0353fGwcT4MFxocsfGCtGvXAofAHMNAJtYR6 kCOwtlWhNMGmceE0oV+pKdC5eu2hap+UHhoYvGYabBXwSMrFkYX5LCcICMNa0EwceYpB MIQTf52ZXMkw4WsdR/lhtwdffWK5tb4we3Bgo4PtXb56v0aMmccYgSQM/Mro+dcFhPYH sZi1nkd5zlZ+sgMcGg/39uBQdlIYpO17m26v0NvCuxWtI3TFfu1YVl2qUyr4O3rsVHJn nXvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733921493; x=1734526293; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Y7B5PzMIQAYWoZxCx+iKjiN9AyJgktzWgwoHucsn1I=; b=BaQeg/KaOgHybBp0eloJDYlcLaYOlu957pBCKTypPPquEQZENMjt3zExOvO3vIHmU7 4vBlDV9s1xbXvQN9ASMMjp2BMsQ+7gh8CZOBE4Ccc10sbUsmgeEAsaxbqh+6PghsMXAY RFL0qTuLDwcl9PJ/D88gwyTF5q28Yw8mf+cSbNeMhqHf0GW6/jXjDI9gpv35XhGhr5bY W2/HCEzw9O8YrWL/fFhsFuoeBtGj2w3oMZsdrFEdfATu5oA29J9vqcSTPp9vFuP/ZNzR g5+rtYPB51cYqvuulpoheBgnqgfzfiDub2ytn+1jYvjFeGE5MrRJQUVx+gKX4ksZpXKL ClGQ== X-Gm-Message-State: AOJu0Yzs3bB/6VDwhpBGWkL8NF9UrzQw2Q8k3M0o9N8Fo1qKTzLGl3be fTK1eTjWYj27f9UUP31yD2mA5SxPNsuU3PDILk/a0RtQKHhoUdEzVHelAP6ruaOIJRfa6lh3C1h 4YNs= X-Gm-Gg: ASbGnctZB4vytFdie9syk2TGu7YYlT0IPhoaMwsLxEoSbgKICjzBu0IKAqmLjl49ltm kod2qltZY3mZRvMcaU6RFFd++nkuLIppFBtUrsYsGt87Y8LNArKOrjJ/p/rAQDhsKLyg4FK9Pz9 z2Ltju0PgljOkb54OT/BVUH+ALbsEJjtJrecEPeYeVBKkMbziG4nsCB1OxC7tTyssRj5JMXX2kQ tpTAnUYoMyJoSlRoywBJ/9FqWltVLMrUmu9NGVnr4Uq7Jv2o4xhwaUSkxslWImAlrP1EBWEXyHK s+YBvTlY7aw7VN3GrbebydQ7kk2UR1eNFFjc02XerfpMZA== X-Google-Smtp-Source: AGHT+IGSV22Sp0UpqWCivzYJ62N2BPIj4wQob2CB2Jl0h9W1M3qrvolGrTFj0/F+M1q9eLaLKjmA2w== X-Received: by 2002:a05:600c:1c1c:b0:436:1c0c:bfb6 with SMTP id 5b1f17b1804b1-4361c43ca9bmr18253475e9.27.1733921492774; Wed, 11 Dec 2024 04:51:32 -0800 (PST) Received: from dorian.. (sals-04-b2-v4wan-167965-cust660.vm36.cable.virginm.net. [80.3.10.149]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f44eaac7sm120542125e9.42.2024.12.11.04.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 04:51:32 -0800 (PST) From: Craig Blackmore 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 Subject: [PATCH v7 1/2] target/riscv: rvv: fix typo in vext continuous ldst function names Date: Wed, 11 Dec 2024 12:51:12 +0000 Message-ID: <20241211125113.583902-2-craig.blackmore@embecosm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241211125113.583902-1-craig.blackmore@embecosm.com> References: <20241211125113.583902-1-craig.blackmore@embecosm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=craig.blackmore@embecosm.com; helo=mail-wm1-x32c.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 Replace `continus` with `continuous`. Signed-off-by: Craig Blackmore --- target/riscv/vector_helper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index a85dd1d200..0f57e48cc5 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -195,7 +195,7 @@ GEN_VEXT_ST_ELEM(ste_w, uint32_t, H4, stl) GEN_VEXT_ST_ELEM(ste_d, uint64_t, H8, stq) static inline QEMU_ALWAYS_INLINE void -vext_continus_ldst_tlb(CPURISCVState *env, vext_ldst_elem_fn_tlb *ldst_tlb, +vext_continuous_ldst_tlb(CPURISCVState *env, vext_ldst_elem_fn_tlb *ldst_tlb, void *vd, uint32_t evl, target_ulong addr, uint32_t reg_start, uintptr_t ra, uint32_t esz, bool is_load) @@ -207,7 +207,7 @@ vext_continus_ldst_tlb(CPURISCVState *env, vext_ldst_elem_fn_tlb *ldst_tlb, } static inline QEMU_ALWAYS_INLINE void -vext_continus_ldst_host(CPURISCVState *env, vext_ldst_elem_fn_host *ldst_host, +vext_continuous_ldst_host(CPURISCVState *env, vext_ldst_elem_fn_host *ldst_host, void *vd, uint32_t evl, uint32_t reg_start, void *host, uint32_t esz, bool is_load) { @@ -342,8 +342,8 @@ vext_page_ldst_us(CPURISCVState *env, void *vd, target_ulong addr, if (flags == 0) { if (nf == 1) { - vext_continus_ldst_host(env, ldst_host, vd, evl, env->vstart, host, - esz, is_load); + vext_continuous_ldst_host(env, ldst_host, vd, evl, env->vstart, + host, esz, is_load); } else { for (i = env->vstart; i < evl; ++i) { k = 0; @@ -357,7 +357,7 @@ vext_page_ldst_us(CPURISCVState *env, void *vd, target_ulong addr, env->vstart += elems; } else { if (nf == 1) { - vext_continus_ldst_tlb(env, ldst_tlb, vd, evl, addr, env->vstart, + vext_continuous_ldst_tlb(env, ldst_tlb, vd, evl, addr, env->vstart, ra, esz, is_load); } else { /* load bytes from guest memory */ From patchwork Wed Dec 11 12:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Blackmore X-Patchwork-Id: 13903444 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 13548E7717D for ; Wed, 11 Dec 2024 12:53:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLMCL-0003LM-61; Wed, 11 Dec 2024 07:52:13 -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 1tLMBq-0003BL-ND for qemu-devel@nongnu.org; Wed, 11 Dec 2024 07:51:51 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLMBp-0001ve-5a for qemu-devel@nongnu.org; Wed, 11 Dec 2024 07:51:42 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-434f80457a4so3786565e9.0 for ; Wed, 11 Dec 2024 04:51:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1733921499; x=1734526299; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IXOHZmlwq/2lTmsq1K3b/qfzU9CsxVuPDqF9Ym8Ynug=; b=A9r8tN/gGu0VlRKp1Aejd+U3xuqdL2Qj9FktB4Wb+cEEb8JoYZ+SAYewmun1YhT2TE NSS5U5/+fv4eywqZRyIoSP1HGOEdZH6zB1AvK/zr7GEjRMxLPjOYLbFaHJgNlymlxAg7 jhyV9sE3pS+gJlpjVZr4+3RRFXCg2Az9bray3/iRzlb53kSnRshdmSnapkU9g8hfM2BS 6TKaTFpKoGl7myeFeS9XughsmLDQuynDBYUaaMbnGF7+4vTmj/tdwdj3DpQ2qRiCN2CN TaBed9EYJUn+6uxNh/8QGTyIrOkvuTS28IYUGqMsNMbHJS6ED0KP1hrKjITtEzmFTo5K UJwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733921499; x=1734526299; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IXOHZmlwq/2lTmsq1K3b/qfzU9CsxVuPDqF9Ym8Ynug=; b=agu0G1iSZmoZ1qGS1ImuviTybF1cc+kl4gn9VZF+L8ikZMgDmn+h4VtowiGM0Q6XXA jicfgK/C3/yizaJWxHHF6JWh8kgPcWW/DK3/F/ZCIcVKi5JC88InuNJHwdiXhXzlsl8R G/savKvbII+UN/hg+ZbryPSvLDbxmhHcBwf74TMYmtac3MEsIBxa6oddPS5BFK6CsYVW 9WLpM4d49PvFheKg/GIUknOntSqclRyg9El05oiTPA6IZAiFsEPC0v/gq5XMHEw1kQlZ 1t8WrhmsUwc4ebO+EqYyfqAsDRK5x53wrFF+G83rHcL85H3RL99azBkYwZb1/buR8/ov vYRQ== X-Gm-Message-State: AOJu0Yw3uDu9cc5bSzx3zj2ATgRYw00H8NM95kZDMqgIYs3IM0QY4Sss PXvd0T/0QS/rP9CQMaVE19MxK/2sE63qfNZhXfmTS03s8ViJLqUpViEeIRGXBqEEY9O2wDRf+nt zuoo= X-Gm-Gg: ASbGncvTW4Fqg5hr9eeEPERtW3r3ePDKK3m1Zdcd/T8QC5D4O1+1Vv0LrOLSbYvJdP9 YwkvCUamajhVAM8n9JOESyPquRTZQYCgZoCP/SQiG37qdlar0tlQ8BL1LqrS0BC/7Y/wWS+FryN 1ekOqKXf3UT3F0UHSH3Bj+2uSzyXHy6JhhLpShh7sHqzqUNp45y3wwtSurncgmPKTUbbBmFLMti dC87GGtdngbNyt6m3fiB8VxPQJBiJ6U0wEb23u9Ia5yRwpgfERyh7upadUfuRVED+8vsBUIQFJR 7pdlcQ0G9VigsqmeSSL9vIlAe4F+BYIzlwGsaTT9FZyA/g== X-Google-Smtp-Source: AGHT+IEy5Y7EqcSFlZXlzw/NJliyF1afwJMjcXf8oadlGc4rvWdzLf7BMWEQ6W8FShwKsgFqaswSiQ== X-Received: by 2002:a7b:c8c9:0:b0:434:e963:6ad9 with SMTP id 5b1f17b1804b1-4361c5a309emr18173195e9.5.1733921499164; Wed, 11 Dec 2024 04:51:39 -0800 (PST) Received: from dorian.. (sals-04-b2-v4wan-167965-cust660.vm36.cable.virginm.net. [80.3.10.149]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f44eaac7sm120542125e9.42.2024.12.11.04.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 04:51:38 -0800 (PST) From: Craig Blackmore 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 Subject: [PATCH v7 2/2] target/riscv: rvv: speed up small unit-stride loads and stores Date: Wed, 11 Dec 2024 12:51:13 +0000 Message-ID: <20241211125113.583902-3-craig.blackmore@embecosm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241211125113.583902-1-craig.blackmore@embecosm.com> References: <20241211125113.583902-1-craig.blackmore@embecosm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=craig.blackmore@embecosm.com; helo=mail-wm1-x32a.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 Calling `vext_continuous_ldst_tlb` for load/stores smaller than 12 bytes significantly improves performance. Co-authored-by: Helene CHELIN Co-authored-by: Paolo Savini Co-authored-by: Craig Blackmore Signed-off-by: Helene CHELIN Signed-off-by: Paolo Savini Signed-off-by: Craig Blackmore --- target/riscv/vector_helper.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 0f57e48cc5..529b4b261e 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -393,6 +393,22 @@ vext_ldst_us(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc, return; } +#if defined(CONFIG_USER_ONLY) + /* + * For data sizes < 12 bits we get better performance by simply calling + * vext_continuous_ldst_tlb + */ + if (nf == 1 && (evl << log2_esz) < 12) { + addr = base + (env->vstart << log2_esz); + vext_continuous_ldst_tlb(env, ldst_tlb, vd, evl, addr, env->vstart, ra, + esz, is_load); + + env->vstart = 0; + vext_set_tail_elems_1s(evl, vd, desc, nf, esz, max_elems); + return; + } +#endif + /* Calculate the page range of first page */ addr = base + ((env->vstart * nf) << log2_esz); page_split = -(addr | TARGET_PAGE_MASK);