From patchwork Wed Dec 18 14:23:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Blackmore X-Patchwork-Id: 13913771 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 F23DDE77187 for ; Wed, 18 Dec 2024 14:25:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuyt-0006hI-TI; Wed, 18 Dec 2024 09:24:55 -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 1tNuys-0006gS-DD for qemu-devel@nongnu.org; Wed, 18 Dec 2024 09:24:54 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNuym-00033y-CU for qemu-devel@nongnu.org; Wed, 18 Dec 2024 09:24:54 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361f664af5so70615545e9.1 for ; Wed, 18 Dec 2024 06:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1734531885; x=1735136685; 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=T1pd2UkYgpCHZiAqXIsDQrUV76dtpEgV5uOF1GnLo25t+1HurG2Zd82CvZHxY5AJC3 muPEvgqwBZOE4Z+a9CmhY4RYKxy73FXsEXea1c4Cf3gdvkWkRGimK8gq4SGm+JmL7ZpO XJaP8CUjYnfLcd3yUwZcQulPmZh+a//b1NSDCLofsnL70DV1p3py0FlX8t0K8e84V57j FoDoS6wFMPhqub9pbtxCbLRNG1XOIy5r4RdcEjQW0GkxOQpsLj0RI+mCT72TI775KDY0 ahkkf8B2kIiQtMbCaervTHTX5HIcyAOg6VYGIQlIHUIGXe5vOmeK80cNrl4KtECL1Far L7Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531885; x=1735136685; 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=sA/iS1jGTlxcl/z1OxXkuMAAYp3SFaegdp1mzsGcpx4f1Y7FbMk/3TbSK3gnFAmiWk m1AcKw7Zcmuv0zdi/z+muG0+10OVNlbc4E5dSixZtgx+Xg582GPDuG6pYBMGl+jFb3yx aaka8UXxrKDXvmBSwCe/yiV5crWMqlgYQeJfJc2HHxtjW42zWkFaO+EfdPmiygwDuFZu LuYvOcUGPlYZv+Fsdzj2rMscu5+3MSHpOCDgR/YMsS9CWbCgJ52XxOL+Kyx8B8cbu1RD 7t7/sK+xYo7Ff2QhRE6C6jgwy/Y6H1OOAqX1/L6fbb3NzC2XW9y5DT2/F9IxyH2D8e50 zYkg== X-Gm-Message-State: AOJu0YzPNZLQiicKhGzRKwGYBiXZd+e/hNuN6gu/Rz+T46DHDogNewmU LW/eRYLpAcb7Z/kUdgJFMiNP6QL+3pnd5YNsegcNDkyqW2giOpsFNlOEvKJuh440Ivcb3FOocmv Jd4U= X-Gm-Gg: ASbGncu9cj3fs3xoMMvm5qy4YJyf1EHmDIcg9OG6DGL2UP2C3vyj3In65Tnlec73Y5r f5iLzN5H3hc3Qqg2RsbZFPXDPeLPzfsQUj6eUuWHbGc4GTQhegeAtlsR5e7lg/TUqqa6XEzRxkk aHOJisYtzp8Hh07YWFnbfqpHBmGzVGzxor6THptYvrEZpsGxhCaiWblkrKkKMNscDXG81Ys8+c0 Q8wQVMiGTldmaFuKTJxXKj8T922wrEl7NU8dwZhHQvn9u14/iggUMt1HTbDR48qdGTO8vwim1OF v8O2yCLFbKGnl2ETP2zJ0tC2wudZ2HtsQGrhwmAdOK0dHxmT X-Google-Smtp-Source: AGHT+IHNSMtmESVz1QpoKKenS5EyK03qEwWM1pGW3Ka1JECewhOex0OcdvMj7UDKkOr93KrvEj8h4Q== X-Received: by 2002:a05:6000:401e:b0:385:dedb:a148 with SMTP id ffacd0b85a97d-388e4d91e8cmr2852982f8f.46.1734531885537; Wed, 18 Dec 2024 06:24:45 -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 ffacd0b85a97d-388c806115asm14075200f8f.107.2024.12.18.06.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:24:45 -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 v8 1/2] target/riscv: rvv: fix typo in vext continuous ldst function names Date: Wed, 18 Dec 2024 14:23:52 +0000 Message-ID: <20241218142353.1027938-2-craig.blackmore@embecosm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <14dfb7b7-98bb-4e8c-a223-c568512180b7@embecosm.com> References: <14dfb7b7-98bb-4e8c-a223-c568512180b7@embecosm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=craig.blackmore@embecosm.com; helo=mail-wm1-x32f.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=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 Replace `continus` with `continuous`. Signed-off-by: Craig Blackmore Reviewed-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Reviewed-by: Max Chou --- 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 18 14:23:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Craig Blackmore X-Patchwork-Id: 13913772 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 80FF3E7718A for ; Wed, 18 Dec 2024 14:25:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuz3-0006oL-8H; Wed, 18 Dec 2024 09:25:05 -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 1tNuz1-0006nh-M8 for qemu-devel@nongnu.org; Wed, 18 Dec 2024 09:25:03 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNuyw-00035N-2z for qemu-devel@nongnu.org; Wed, 18 Dec 2024 09:25:03 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385dece873cso3101773f8f.0 for ; Wed, 18 Dec 2024 06:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1734531896; x=1735136696; 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=fibA9P5DcKjb0lcJZvsMnFiP02fLzLXn2ydFUHy670g=; b=hZYLVEzXgc7LI04ccuSWwOUOcSXxjsje2HTExHNZB75FM2ST3YHstq697ihDhRdbyn spy2GH7M+R3sq77RDSrZD5nyQYtQVKypnlockH1j1hJm+PICDMTj3pbgiJHez/iiFfmL 1vO3fPznBUstyTxosbMQ3hagScnFpkl/JArAtYWZmcMtOcbvW+hen8Q1r2WOfvfysS3H qK58UTI1uKPbEUgyMZaW8HCpgqfZYrjoQ1DVe+00/mnSvA1Yew/6NgyVr5q+UKADbvfm sAB1mfU2egDXAU+AHBnIy0kyewJUt++pit5/ZDECRbhxpdvodCpGn49d370ZPeDzq/+R qx1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531896; x=1735136696; 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=fibA9P5DcKjb0lcJZvsMnFiP02fLzLXn2ydFUHy670g=; b=qOmeI99RCeZrfk1kEl6d/l9ILYkIl9pKH4T7+Ri6q0WDSEDv2XYidAJIwOLxgIJ36J b6RMQntYMMUVkLIQQRodn2n9SLnH79dm3mr9UwOw4Sfun/AUcxjREkSnuz8VnnMO6Pow G9b+4PeBZU+l3nFSHbaV1xopUZoXd1YYQt+ZXVTpR+IjHRUFXFaPvrMegISJglq2pXvt eVLXaMqOXLZbTzOfXoyqBD81e7tVXVfg8un7sXpK9FgOYWLLrfYtqynIIL0g/wC7RxcE 5RyWvqM5cGeMJItk+AWvGbft2KTbgfh4/AuLyFk/IjihmV9ov21z8DxvIugQxhe7iXNT N7ng== X-Gm-Message-State: AOJu0YwrW9CUIQv2iXmOEgspLrohux+58AaX0HMywgAd/BsNtXiPDl3F msGJGkAXQyqHxJ8XLtl4lX59EHVCoBfFpv8kYWeoU8S6zUGChgDcaEM43daKXXX+f9uN+36hxyP DLks= X-Gm-Gg: ASbGncsxisklqz0SBt4AkGgkyzRBmLDNYN3raighZTQRbnlpG8WRgWaWGKFLOA5pwlz AIhZVz9P4VRf0rHDYT3BaQjoTPiFYMAZ0vASKYvICq/n6cJ2KEe5bYzr26tMuHINzXkzqLwjDdv +PdfKLc0YrEy5Vkv3kqrIolkuMo0y8qCM7YlsaLb4nQNT++IqvyMt2s8FXtdAjMxdw6hPQMKNBc 64diIChhktxoD79mdn2SvIZhVt+U0DS0H/g28lO1IwDa82UFFVRUwQ9dQbhXow9G0sEeA65ut3L Fu3Y6iJ/vkTt/sjVJ7nPfbkQzadBVraFUtvq0RpVsZ5tI/PF X-Google-Smtp-Source: AGHT+IFGBZsjiha20+zyh73y3gbHe7IR9uF+K4VumG9CI3EmqNSjVAbN+ewTNGXcu9AW2CyesaXWYA== X-Received: by 2002:a05:6000:4703:b0:385:f271:a22c with SMTP id ffacd0b85a97d-388e4da3fcbmr2630820f8f.59.1734531895661; Wed, 18 Dec 2024 06:24:55 -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 ffacd0b85a97d-388c806115asm14075200f8f.107.2024.12.18.06.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:24:55 -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 v8 2/2] target/riscv: rvv: speed up small unit-stride loads and stores Date: Wed, 18 Dec 2024 14:23:53 +0000 Message-ID: <20241218142353.1027938-3-craig.blackmore@embecosm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <14dfb7b7-98bb-4e8c-a223-c568512180b7@embecosm.com> References: <14dfb7b7-98bb-4e8c-a223-c568512180b7@embecosm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=craig.blackmore@embecosm.com; helo=mail-wr1-x435.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=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 Calling `vext_continuous_ldst_tlb` for load/stores up to 6 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 Reviewed-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- 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..ead3ec5194 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 <= 6 bytes we get better performance by simply calling + * vext_continuous_ldst_tlb + */ + if (nf == 1 && (evl << log2_esz) <= 6) { + 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);