From patchwork Mon Mar 11 18:08:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1910609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=ll8NkfGY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TtlF55Ll9z1yWn for ; Tue, 12 Mar 2024 05:10:33 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjk5b-00051S-P1; Mon, 11 Mar 2024 14:09:31 -0400 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 1rjk4v-0004sg-Cg for qemu-devel@nongnu.org; Mon, 11 Mar 2024 14:08:51 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjk4j-0004Ja-Kz for qemu-devel@nongnu.org; Mon, 11 Mar 2024 14:08:49 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-29a8911d11cso2577487a91.1 for ; Mon, 11 Mar 2024 11:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1710180514; x=1710785314; 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=DgCmMDQSmZuQF2R71f2SMhy+sJRtIk+zLEeTXoFqnr0=; b=ll8NkfGYuh/MnitZbaJ0v34tEy6TN1vKPuHzgZEWciUzfsJXnqntCdsdnpSTGWIgV2 1SldHaotZPoCP1bYLnKAjldKBksrIKywPhyxhDYHyqwOUWCPeP2iB5uX4h96KCKKQmo+ SC1nowISbY8deyUsmOBWCrT3KNKOyCZcbVgrsna4Z+qFIoUvsceLqeuDbjDYjZn16WCf TzTkGNdGHLg0Nu/ihmUn58AssQ4zbBlNxzMwuhrk0AFHfhME6M6c0IBx66I2LTwz+zYU HojhmSAQucnT4CFaEro+p6fxYAvp/iOvvhYoegAtVPmLLBqkTjvo2IW/9h91Fur4GajL jaMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710180514; x=1710785314; 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=DgCmMDQSmZuQF2R71f2SMhy+sJRtIk+zLEeTXoFqnr0=; b=fVuDvJWLGNsZWe2nuDWue5V1kx+Tf/84XartjqaQSzQDuiQMuRQK77R4srnk/ftp4U mBGDN/13ruOGvtBoHbw9ONKzWW8eZrDZjxczYmjMjBXaPN9SC9AQq30ju4zjvUpOZEh5 uxRJR1rq0tTpfAc8RH26qRhmjXX7fmKYkeEG2xDG/5R1YzKhKCUBBqJukrW8SpxLEHji q+Xnmxp0exTDcjclZr3WcTJ3EJ/2wy5FDTmOUDcD8kaewXbfe10PxVVR4XKrYTdgP4jH z5xcEET5le/m9aT63kD/gAd+V4Ny9tbjYymAXyJPU+2EDdPiMw3YjDut0Nifg3SgpBrL vQTw== X-Gm-Message-State: AOJu0YyDMVeQ7QJ5ghy8yO3Zl9wLw+ABpb9th/szJXAbLlX1g5dx+6BM M6w89PJoFkw+lt5o8L0gmR3dITrycpUrPTP9EwZ/A/EXlRvepEFHy8A8r2oZ0b97XH1vD7w9oUT q X-Google-Smtp-Source: AGHT+IGbz3K3mQF1+asKARCRn3d8gMfXC9ApdeQndTZkoWHkpL5+M6/uNQ2DEg0R7nW9e/KgOcAVUg== X-Received: by 2002:a17:90a:2e17:b0:29c:289b:1eb3 with SMTP id q23-20020a17090a2e1700b0029c289b1eb3mr1187857pjd.6.1710180514287; Mon, 11 Mar 2024 11:08:34 -0700 (PDT) Received: from grind.dc1.ventanamicro.com ([177.94.15.159]) by smtp.gmail.com with ESMTPSA id hk13-20020a17090b224d00b0029c2794d3f7sm525810pjb.7.2024.03.11.11.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 11:08:33 -0700 (PDT) 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, philmd@linaro.org, richard.henderson@linaro.org, Daniel Henrique Barboza Subject: [PATCH v12 2/7] trans_rvv.c.inc: set vstart = 0 in int scalar move insns Date: Mon, 11 Mar 2024 15:08:16 -0300 Message-ID: <20240311180821.250469-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240311180821.250469-1-dbarboza@ventanamicro.com> References: <20240311180821.250469-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=dbarboza@ventanamicro.com; helo=mail-pj1-x1032.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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org trans_vmv_x_s, trans_vmv_s_x, trans_vfmv_f_s and trans_vfmv_s_f aren't setting vstart = 0 after execution. This is usually done by a helper in vector_helper.c but these functions don't use helpers. We'll set vstart after any potential 'over' brconds, and that will also mandate a mark_vs_dirty() too. Fixes: dedc53cbc9 ("target/riscv: rvv-1.0: integer scalar move instructions") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index e42728990e..8c16a9f5b3 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -3373,6 +3373,8 @@ static bool trans_vmv_x_s(DisasContext *s, arg_vmv_x_s *a) vec_element_loadi(s, t1, a->rs2, 0, true); tcg_gen_trunc_i64_tl(dest, t1); gen_set_gpr(s, a->rd, dest); + tcg_gen_movi_tl(cpu_vstart, 0); + mark_vs_dirty(s); return true; } return false; @@ -3399,8 +3401,9 @@ static bool trans_vmv_s_x(DisasContext *s, arg_vmv_s_x *a) s1 = get_gpr(s, a->rs1, EXT_NONE); tcg_gen_ext_tl_i64(t1, s1); vec_element_storei(s, a->rd, 0, t1); - mark_vs_dirty(s); gen_set_label(over); + tcg_gen_movi_tl(cpu_vstart, 0); + mark_vs_dirty(s); return true; } return false; @@ -3427,6 +3430,8 @@ static bool trans_vfmv_f_s(DisasContext *s, arg_vfmv_f_s *a) } mark_fs_dirty(s); + tcg_gen_movi_tl(cpu_vstart, 0); + mark_vs_dirty(s); return true; } return false; @@ -3452,8 +3457,9 @@ static bool trans_vfmv_s_f(DisasContext *s, arg_vfmv_s_f *a) do_nanbox(s, t1, cpu_fpr[a->rs1]); vec_element_storei(s, a->rd, 0, t1); - mark_vs_dirty(s); gen_set_label(over); + tcg_gen_movi_tl(cpu_vstart, 0); + mark_vs_dirty(s); return true; } return false;