From nobody Thu Nov 14 06:54:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1705438991; cv=none; d=zohomail.com; s=zohoarc; b=VrT1AwEyPlUY9Y7fl4wgAHtpCtZeVYBIqX6n7Gp1hsonUNqqy7snnYLSnoG5RVCjG/KOOtIIwsgVlEPehb7EB2mNM1tfHxoiU1A1vd+jOUOLMHpEgTo2SWRYPjg4QF2da0bB/lQ55iwv2VxWHHtBX/cKgIhemFV6McgCsnLoILQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705438991; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jbwYjyXSBpPyinrAeXmIDHhORc0A5UKNrKSEWcx5rqU=; b=d/IBB2+aAtJBsCxolc7QXhvnyuQq3/1rWwgXFOvnDoEeh5e6YJYvO89Ii719BjrjzzqrZQ336IXVheAmYnIsalLKrYWG7Wu+leOjfo+xOaUzI5MvRy+0Wm391zHaZ3ix9Flq2Ip4VLfdIOEagjpfEN0NPe7zR5wWbsyfVyonRc4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170543899177391.63202239538464; Tue, 16 Jan 2024 13:03:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPqWO-0004f3-At; Tue, 16 Jan 2024 15:58:56 -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 1rPqWI-0004dx-JT for qemu-devel@nongnu.org; Tue, 16 Jan 2024 15:58:50 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rPqWG-0007ce-No for qemu-devel@nongnu.org; Tue, 16 Jan 2024 15:58:50 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-28e84e3767cso619573a91.0 for ; Tue, 16 Jan 2024 12:58:48 -0800 (PST) Received: from grind.dc1.ventanamicro.com ([152.234.123.64]) by smtp.gmail.com with ESMTPSA id sh2-20020a17090b524200b0028df5c748e4sm11326949pjb.44.2024.01.16.12.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 12:58:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705438727; x=1706043527; 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=jbwYjyXSBpPyinrAeXmIDHhORc0A5UKNrKSEWcx5rqU=; b=DuSo5AQdvraj+I66kcgivGXpUK9Km1uEeOuMwNTiNciFEItXGjg9Et9Y7kEgwLhdg7 6hRg5/W6msIGB4DsKcXu9Pm3AaeoIc1R8bidEhBBD0XTsuDRmPsXn3C9FWpE2tQey5Zr WZkMomD8bLd3+Namfxcw+wK6SsGiMso3h4oqUKdnr4hQLS/PYvXUAGDs4ez1IP08NeVw o34tWZrt4oapJ0IJcWYnz6PqfVjByDhKq2jLgxMS7TdW/PzyW56TenP38Q0rhX5Zcmez 4Rh0/NTyEJh+SF+xZnnpAyyj2DJgIsPPf8Jubfl08iCDROjDkchHm7Uye6iohZFmJduO 3dPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705438727; x=1706043527; 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=jbwYjyXSBpPyinrAeXmIDHhORc0A5UKNrKSEWcx5rqU=; b=Ken3AXzKMwzvqB0RC7++mOFD2WP2g1ARO28PitipLzXASewhW1XPAr2UJ1DJdaLeIq zj+2+CZUIMz1qyOEvBlCF7iIMbLcJWMYS1/Nt3for0b9UQ3sNn3G7444h31rA3neBLET Sq3nuEVyNDJPWQM6Seslrcq96BchvfKEcIggOd3joYKdxi9h09E+2OewqqPogDCe6Wuy EXnO3+KNL41cFl5IPkDTD2qnSwWIRy2wMWxgNTojXnLS38MBJZpGIRNmUaIA1GrGxonR a8lvMPAD0UCgmO5F2Bz8EU2RMFDQeaUXXTEljFrSnTtopeupK0tSNQwBHl1AtuSdFJLj 7v1Q== X-Gm-Message-State: AOJu0Yw5D/AG6P7dPHSmTuXCagPzOP1Ve3SggkAfQJeOJbKW51g+00fW l+SiMueyza7jAZAcfkC9SCEjtBKwz1GTxK+ZVFYccg0Na0mHpg== X-Google-Smtp-Source: AGHT+IF0xfuf6hgHKwUY9chEwSLyZ/jVupNpMOQtOeLJJn1DL65vAsT+X97sP74P0QAUVaGaTqQIug== X-Received: by 2002:a17:90b:8ce:b0:28e:79cd:26e5 with SMTP id ds14-20020a17090b08ce00b0028e79cd26e5mr1841689pjb.40.1705438726771; Tue, 16 Jan 2024 12:58:46 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, richard.henderson@linaro.org, max.chou@sifive.com, Daniel Henrique Barboza Subject: [PATCH v3 07/13] target/riscv/vector_helper.c: use 'vlenb' Date: Tue, 16 Jan 2024 17:58:11 -0300 Message-ID: <20240116205817.344178-8-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116205817.344178-1-dbarboza@ventanamicro.com> References: <20240116205817.344178-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=dbarboza@ventanamicro.com; helo=mail-pj1-x102d.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1705438993820100003 Content-Type: text/plain; charset="utf-8" Use 'cpu->cfg.vlenb' instead of 'cpu->cfg.vlen >> 3'. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/vector_helper.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index c1c3a4d1ea..cb944229b0 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -558,7 +558,7 @@ vext_ldst_whole(void *vd, target_ulong base, CPURISCVSt= ate *env, uint32_t desc, { uint32_t i, k, off, pos; uint32_t nf =3D vext_nf(desc); - uint32_t vlenb =3D riscv_cpu_cfg(env)->vlen >> 3; + uint32_t vlenb =3D riscv_cpu_cfg(env)->vlenb; uint32_t max_elems =3D vlenb >> log2_esz; =20 k =3D env->vstart / max_elems; @@ -929,7 +929,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void *= vs2, \ { \ uint32_t vl =3D env->vl; \ uint32_t vm =3D vext_vm(desc); \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; \ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t i; \ \ @@ -967,7 +967,7 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, = \ { \ uint32_t vl =3D env->vl; \ uint32_t vm =3D vext_vm(desc); \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; \ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t i; \ \ @@ -1171,7 +1171,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void= *vs2, \ { \ uint32_t vm =3D vext_vm(desc); \ uint32_t vl =3D env->vl; \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; \ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t vma =3D vext_vma(desc); \ uint32_t i; \ @@ -1236,7 +1236,7 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1= , void *vs2, \ { \ uint32_t vm =3D vext_vm(desc); \ uint32_t vl =3D env->vl; \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; \ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t vma =3D vext_vma(desc); \ uint32_t i; \ @@ -3971,7 +3971,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void= *vs2, \ { \ uint32_t vm =3D vext_vm(desc); \ uint32_t vl =3D env->vl; \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; \ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t vma =3D vext_vma(desc); \ uint32_t i; \ @@ -4011,7 +4011,7 @@ void HELPER(NAME)(void *vd, void *v0, uint64_t s1, vo= id *vs2, \ { \ uint32_t vm =3D vext_vm(desc); \ uint32_t vl =3D env->vl; \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; \ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t vma =3D vext_vma(desc); \ uint32_t i; \ @@ -4528,7 +4528,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, = \ uint32_t desc) \ { \ uint32_t vl =3D env->vl; \ - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; \ + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3;\ uint32_t vta_all_1s =3D vext_vta_all_1s(desc); \ uint32_t i; \ int a, b; \ @@ -4615,7 +4615,7 @@ static void vmsetm(void *vd, void *v0, void *vs2, CPU= RISCVState *env, { uint32_t vm =3D vext_vm(desc); uint32_t vl =3D env->vl; - uint32_t total_elems =3D riscv_cpu_cfg(env)->vlen; + uint32_t total_elems =3D riscv_cpu_cfg(env)->vlenb << 3; uint32_t vta_all_1s =3D vext_vta_all_1s(desc); uint32_t vma =3D vext_vma(desc); int i; --=20 2.43.0