From nobody Sat May 4 14:12:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532015058567769.0788514511075; Thu, 19 Jul 2018 08:44:18 -0700 (PDT) Received: from localhost ([::1]:43837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgB67-0005db-Kg for importer@patchew.org; Thu, 19 Jul 2018 11:44:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgB52-0005BB-Fv for qemu-devel@nongnu.org; Thu, 19 Jul 2018 11:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgB4y-0005gX-JT for qemu-devel@nongnu.org; Thu, 19 Jul 2018 11:43:00 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:42467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgB4y-0005g3-Br for qemu-devel@nongnu.org; Thu, 19 Jul 2018 11:42:56 -0400 Received: by mail-wr1-x442.google.com with SMTP id e7-v6so8533365wrs.9 for ; Thu, 19 Jul 2018 08:42:56 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b10-v6sm7968130wrp.49.2018.07.19.08.42.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jul 2018 08:42:54 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 1543E3E02A5; Thu, 19 Jul 2018 16:42:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ulSas2MmDCY++lop4wUQ8YOW33fy6I0cp6v+3Ao+2h0=; b=ckBamHsPw7hzlx2+5UfM5nFqNCHKjFgp7YWC+rdPLKTctBabyjPMeXQH8xV42T+a9+ IJUzo3gXDAhQl2kJvsz1Bz7QLuzMHJP3BjVmd2eoq30BqVNPQNSPcoqO9+JI3GmDPcSv uLNqoyG9fX/VALXq12va7i+0AcIRco7WtbrQ8= 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:mime-version :content-transfer-encoding; bh=ulSas2MmDCY++lop4wUQ8YOW33fy6I0cp6v+3Ao+2h0=; b=TjggJYantVDzP07k1jqHxZE2xBNG50KBC5rPkqv+zQVx3l8NKBnTBD10SLBUc2UoEQ 1tHQ65dqjZJaFXO/dSUZKnFBQZLb26252rFTp24hZWgJVYd60/AdqzOZE0XXcuaPRngD brAfGM5+6i0Ea9771V3/gZa1U9XyrmvvZZfsZIrQET5XBae9EM/OvNTsa8/i8jx+iGAS sxXYMFk7fSqNiqSQwqFTUcIDo9+FCw+Z1r0LqX5otyyVqw0MdXDIE3sZJaZEhSbsbeip fW6/zWszuikRJKeuKPgzXNbxOJ+jHCCPlTKl0bPAjIArIV0fTolCUi8Q5OyJSttQM+rS 574A== X-Gm-Message-State: AOUpUlFum0/XVOwbWe/BU3wVfBXSSBY3fEY3xiEQBID3cSLsTNRgOwp+ YwG92he0itAbPGqUyJ3EoeBnfA== X-Google-Smtp-Source: AAOMgpdhKDw/VqBT2xdgGiWrhYIvGGK3t/q9xmUdO9yhU1HelGOS6Ytij1KUBNQg26rsdpJ1JoQCGA== X-Received: by 2002:adf:cc0a:: with SMTP id x10-v6mr7391728wrh.242.1532014975246; Thu, 19 Jul 2018 08:42:55 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: richard.henderson@linaro.org Date: Thu, 19 Jul 2018 16:42:48 +0100 Message-Id: <20180719154248.29669-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH] tcg/aarch64: limit mul_vec size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Claudio Fontana , qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 In AdvSIMD we can only do 32x32 integer multiples although SVE is capable of larger 64 bit multiples. As a result we can end up generating invalid opcodes. Fix this by only reprting we can emit mul vector ops if the size is small enough. Fixes a crash on: sve-all-short-v8.3+sve@vq3/insn_mul_z_zi___INC.risu.bin When running on AArch64 hardware. Signed-off-by: Alex Benn=C3=A9e --- tcg/aarch64/tcg-target.inc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 4562d36d1b..3d08bdd2e3 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -718,6 +718,7 @@ static void tcg_out_insn_3614(TCGContext *s, AArch64Ins= n insn, bool q, static void tcg_out_insn_3616(TCGContext *s, AArch64Insn insn, bool q, unsigned size, TCGReg rd, TCGReg rn, TCGReg = rm) { + tcg_debug_assert(!(insn =3D=3D I3616_MUL && size =3D=3D 3)); tcg_out32(s, insn | q << 30 | (size << 22) | (rm & 0x1f) << 16 | (rn & 0x1f) << 5 | (rd & 0x1f)); } @@ -2219,7 +2220,6 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, = unsigned vece) switch (opc) { case INDEX_op_add_vec: case INDEX_op_sub_vec: - case INDEX_op_mul_vec: case INDEX_op_and_vec: case INDEX_op_or_vec: case INDEX_op_xor_vec: @@ -2232,6 +2232,8 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, = unsigned vece) case INDEX_op_shri_vec: case INDEX_op_sari_vec: return 1; + case INDEX_op_mul_vec: + return vece < MO_64 ? 1 : 0; =20 default: return 0; --=20 2.17.1