From nobody Mon Feb 9 16:18:20 2026 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1623683718; cv=none; d=zohomail.com; s=zohoarc; b=NiYC2iCISJ4JrGR5kHumYF/IK/uc9/QAWGnmUg1q+drSnRADeS6c6ZkMSj9a3K2dAWZGGj92VzCShU7cmr630Y8DqV2o15IeS0v2eHRxLPoZINIC+yIbMU6y4Na8N5GMt6FoheeY8+Cr2PUEsjCOJUYBHgNMUWiNI/U5ENddgb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623683718; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wLKWOfdh8MVGMCYkZ8MMRjxOVKgXTKW3dsNyETHielg=; b=kMKCuWzaBM7lar+n/A0X1UeZnbFq6t288SXo8E7pnSWlwtWAYQGe180PKncFuw3GPbd4TTs8rgCDEhz16U13T6kAqccnXBt3GVN9+KOfFunie86kHrskW7Qo0OJ7y9UIx3yFRAJyrF/P2Mdm5YhuEJdH4cNHzex8zAi3lEIDhlo= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623683717997331.54978748684846; Mon, 14 Jun 2021 08:15:17 -0700 (PDT) Received: from localhost ([::1]:49022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsoJ2-0001lD-RE for importer@patchew.org; Mon, 14 Jun 2021 11:15:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsoEP-0000Qg-3B for qemu-devel@nongnu.org; Mon, 14 Jun 2021 11:10:29 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsoED-00008x-WD for qemu-devel@nongnu.org; Mon, 14 Jun 2021 11:10:27 -0400 Received: by mail-wr1-x435.google.com with SMTP id q5so14962102wrm.1 for ; Mon, 14 Jun 2021 08:10:17 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id b8sm20865639wmd.35.2021.06.14.08.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 08:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wLKWOfdh8MVGMCYkZ8MMRjxOVKgXTKW3dsNyETHielg=; b=E1gYWnEdmHtw5uefagJ5cnQlfvVhm5zOHnqabNOUZixaspyitsE7UB0Kl4PKQPpnHM Kx6Z3JbcIRHKnkZDvpAblV8qu3kyJLaquzdg04B/Tuy5tuQEnSXQOY1XwodSWs8UjQHY R+iM/OB1t96JFKgscAGRtH/5soL0e7DoyOtF6Rlu7hjkz+okB05QKEjf1lUtIhoezTYu w9EYHBR/YMEjuGRX/Jg6L7jHcu6QN7NtKmH01n9hw4Rkv1jtV32OT+h/O5q77KpTUp7o dizOtzRVDGP9pu07LbfRJeeHsnag/j/+It1V2alrw+vWQyOscyomxU2Q/lrPKcxgRh7b fPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wLKWOfdh8MVGMCYkZ8MMRjxOVKgXTKW3dsNyETHielg=; b=qntF814EPFm6ogJZLTWLRN0PC6d/K49tLlCoMQFFmlgdTh+MNg/kZq7GmHrbAGLvQj GvC3LuAVJ9O2trV0JJS07m25mhf8UEcPRdjmaIn7yyXQOevzqmGnYVzOdThflZaP2CHk KhUQnrXUbxVMx7g6RZmTV1cJZGrGroVreCiw6YwIZ81S9YtFzPq75t2pj+9L8aJB7+c8 1QhOm+ixsDxKqVATY5apAQ1Llqj/lTL+SIfq+RqMKaNfLdgd9/X3GN4f8RhWJbIwnhj2 dHECFgJneHlm1fXicEiu06+KkKnip2+l6FXBicMqH6L0B7TVZVwaRX8fwFWijgokP5ez 9Nng== X-Gm-Message-State: AOAM533wrgYyXeznsx8STq5M4u/0YlS1OgydCgcScXqEAwi6jqTiz7rE MLEtt0YqmKJBpkKO8v7TMsTbXGySsqP/2w== X-Google-Smtp-Source: ABdhPJy9EtHeFeVzvDq80kUPsp1HXSzQi0U8LUMHh2uD4oEAi8N7OBB/ds3hBiZaEgD+wR+nHUcbpQ== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr18840595wrn.127.1623683416555; Mon, 14 Jun 2021 08:10:16 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 07/57] target/arm: Implement MVE WLSTP insn Date: Mon, 14 Jun 2021 16:09:17 +0100 Message-Id: <20210614151007.4545-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210614151007.4545-1-peter.maydell@linaro.org> References: <20210614151007.4545-1-peter.maydell@linaro.org> 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=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; 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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Implement the MVE WLSTP insn; this is like the existing WLS insn, except that it specifies a size value which is used to set FPSCR.LTPSIZE. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- v1->v2: swapped LE/WLS lines in t32.decode; added missing return --- target/arm/t32.decode | 8 ++++++-- target/arm/translate.c | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/target/arm/t32.decode b/target/arm/t32.decode index 087e514e0ac..6906829265f 100644 --- a/target/arm/t32.decode +++ b/target/arm/t32.decode @@ -672,8 +672,12 @@ BL 1111 0. .......... 11.1 ............ = @branch24 %lob_imm 1:10 11:1 !function=3Dtimes_2 =20 DLS 1111 0 0000 100 rn:4 1110 0000 0000 0001 - WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=3D%lob_i= mm - LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=3D%lob_i= mm + WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=3D%lob_i= mm size=3D4 + { + LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=3D%lob_i= mm + # This is WLSTP + WLS 1111 0 0000 0 size:2 rn:4 1100 . .......... 1 imm=3D%lob_= imm + } =20 LCTP 1111 0 0000 000 1111 1110 0000 0000 0001 ] diff --git a/target/arm/translate.c b/target/arm/translate.c index c49561590c9..78878e9b194 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8134,7 +8134,11 @@ static bool trans_WLS(DisasContext *s, arg_WLS *a) return false; } if (a->rn =3D=3D 13 || a->rn =3D=3D 15) { - /* CONSTRAINED UNPREDICTABLE: we choose to UNDEF */ + /* + * For WLSTP rn =3D=3D 15 is a related encoding (LE); the + * other cases caught by this condition are all + * CONSTRAINED UNPREDICTABLE: we choose to UNDEF + */ return false; } if (s->condexec_mask) { @@ -8147,10 +8151,41 @@ static bool trans_WLS(DisasContext *s, arg_WLS *a) */ return false; } + if (a->size !=3D 4) { + /* WLSTP */ + if (!dc_isar_feature(aa32_mve, s)) { + return false; + } + /* + * We need to check that the FPU is enabled here, but mustn't + * call vfp_access_check() to do that because we don't want to + * do the lazy state preservation in the "loop count is zero" case. + * Do the check-and-raise-exception by hand. + */ + if (s->fp_excp_el) { + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), s->fp_excp_el); + return true; + } + } + nextlabel =3D gen_new_label(); tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_R[a->rn], 0, nextlabel); tmp =3D load_reg(s, a->rn); store_reg(s, 14, tmp); + if (a->size !=3D 4) { + /* + * WLSTP: set FPSCR.LTPSIZE. This requires that we do the + * lazy state preservation, new FP context creation, etc, + * that vfp_access_check() does. We know that the actual + * access check will succeed (ie it won't generate code that + * throws an exception) because we did that check by hand earlier. + */ + bool ok =3D vfp_access_check(s); + assert(ok); + tmp =3D tcg_const_i32(a->size); + store_cpu_field(tmp, v7m.ltpsize); + } gen_jmp_tb(s, s->base.pc_next, 1); =20 gen_set_label(nextlabel); --=20 2.20.1