From nobody Fri Dec 19 17:35:17 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1663610073; cv=none; d=zohomail.com; s=zohoarc; b=K4/N9x1HMPmKROPPfTCSaeoKsWDHxykiEznfUDye7zV6bpBb2a9DAOebI5v+vfHZErRtMJzCds30tfkHbKld+v2nBoq3pFne49+USQeSaMc+bbWFITBp9WzUGObJP/SQi1rTvXb2mP0NuLHS6Bn8GtPEE1nY+pkFhqCHhvNHgCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663610073; h=Content-Type:Content-Transfer-Encoding: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=60ZCEpPNxCwMjWmNStrObBA/6q5Os6NikAkMLpEdLr4=; b=E3Zxs3srbM5kc2qE/hGu/K/noQde6m206hOEzF/tEJy4oOkuQPNJdA5xe877S5fnt8QrUni1IZcKIUK2eSUi1ylFtUSiJdzrPpPk6dxM94BmKBVgY/ItPWyr0dPwwcAuYIXeEx5PodYy+3joytaJuI1sHOoA8S13ew5GInwu/LI= 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 1663610073727405.39436305066386; Mon, 19 Sep 2022 10:54:33 -0700 (PDT) Received: from localhost ([::1]:37652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaKyV-0006t1-QK for importer@patchew.org; Mon, 19 Sep 2022 13:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKg6-0003IW-85 for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:33190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaKfs-00035u-8c for qemu-devel@nongnu.org; Mon, 19 Sep 2022 13:35:29 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-147-rL_fqVsMMqOtI9KQa1Gk_Q-1; Mon, 19 Sep 2022 13:35:14 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5-20020a05600c028500b003b4d2247d3eso1416506wmk.0 for ; Mon, 19 Sep 2022 10:35:14 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id u5-20020a5d4345000000b002287d99b455sm13988169wrr.15.2022.09.19.10.35.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663608915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=60ZCEpPNxCwMjWmNStrObBA/6q5Os6NikAkMLpEdLr4=; b=EdQ/vjo3gYjPNCNSrYg8oJqt/ewHb18JaWLG0/SNI3nQdbXJhVDTLtqJsoVEURwi05rqav E/EEXTPlPIbQCFHJlSWD9CDAQoFI5e9KJHJe6WwkFHTc/dx5+y/gDJ4UXu5S/RZYLmmupj tv3nhOjfYFvtstB33kR3LS5ml1WQOos= X-MC-Unique: rL_fqVsMMqOtI9KQa1Gk_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=60ZCEpPNxCwMjWmNStrObBA/6q5Os6NikAkMLpEdLr4=; b=fXhYrCNKGMmLDm8FzGSDtJyZHWvff/txWKMyiwMPnbR6RRfAXOXNCTns8shzl2ZYW3 32clXxmD1R9F5k9ylEk/AKj4tESGoK1gLRd24CASZ1FuH04UC3dWCuBfN+CTrvwrGU/1 Bo3Z5GupsId/ZZxjwg0of02gBgFDR3dIw1e+ZPxwyWwkHcrna2U8dV8WM2Z2UPGCp9xh IGzLrhdf0M/g5n401INyRY1eS9wUO0yu8dcCwV0mi++N5NLjqCPGRYhSNyQ753d26eYb IK/W17IvFqp+nSWPvycDjtcHmx7TkULW5SmPNi1NE/1Q/ZO6PIayWYujckzlsuuDgrEJ kWvg== X-Gm-Message-State: ACgBeo05VJZkr5n8ME6VoEk/llQjEefRk3k1r3oJdPGODgeKzQlf3LhH 9r5laF03wG7DcBPbJqUlTC8ZtIjITNyAuS6klJsf7L2WjZYzRRAh4Rv77nNvuTJMCfh1gjy9M6z Y+UgX2jq/4gMehHeGJIGleC+vLGnaz4/aSFUpjAoZ1VznEgbMNPXUCAJZEn4/8EJjnz4= X-Received: by 2002:a05:600c:2747:b0:3b4:708a:f66a with SMTP id 7-20020a05600c274700b003b4708af66amr19095651wmw.146.1663608912876; Mon, 19 Sep 2022 10:35:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR5fPA2CNizkR9uiE8UVQseJuQs0nbtBxt1CT8aCxENN2h2XIxpeueiwtg4OLnHhGNaHbZ0foA== X-Received: by 2002:a05:600c:2747:b0:3b4:708a:f66a with SMTP id 7-20020a05600c274700b003b4708af66amr19095633wmw.146.1663608912492; Mon, 19 Sep 2022 10:35:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/21] tests/tcg: refine MMX support in SSE tests Date: Mon, 19 Sep 2022 19:34:41 +0200 Message-Id: <20220919173449.5864-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220919173449.5864-1-pbonzini@redhat.com> References: <20220919173449.5864-1-pbonzini@redhat.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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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.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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663610074726100001 Content-Type: text/plain; charset="utf-8" Extend the support to memory operands, and skip MMX instructions that were introduced in SSE times, because they are now covered in test-mmx. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-avx.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/tests/tcg/i386/test-avx.py b/tests/tcg/i386/test-avx.py index 2516c66445..e16a3d8bee 100755 --- a/tests/tcg/i386/test-avx.py +++ b/tests/tcg/i386/test-avx.py @@ -103,7 +103,11 @@ def regstr(self, n): =20 class MMArg(): isxmm =3D True - ismem =3D False # TODO + def __init__(self, mw): + if mw not in [0, 32, 64]: + raise Exception("Bad mem width: %s" % mw) + self.mw =3D mw + self.ismem =3D mw !=3D 0 def regstr(self, n): return "mm%d" % (n & 7) =20 @@ -169,6 +173,9 @@ def __init__(self, w): def regstr(self, n): return mem_w(self.w) =20 +class SkipInstruction(Exception): + pass + def ArgGenerator(arg, op): if arg[:3] =3D=3D 'xmm' or arg[:3] =3D=3D "ymm": if "/" in arg: @@ -179,7 +186,13 @@ def ArgGenerator(arg, op): else: return XMMArg(arg[0], 0); elif arg[:2] =3D=3D 'mm': - return MMArg(); + if "/" in arg: + r, m =3D arg.split('/') + if (m[0] !=3D 'm'): + raise Exception("Expected /m: %s", arg) + return MMArg(int(m[1:])); + else: + return MMArg(0); elif arg[:4] =3D=3D 'imm8': return ArgImm8u(op); elif arg =3D=3D '': @@ -217,8 +230,12 @@ def __init__(self, op, args): =20 try: self.args =3D list(ArgGenerator(a, op) for a in args) + if not any((x.isxmm for x in self.args)): + raise SkipInstruction if len(self.args) > 0 and self.args[-1] is None: self.args =3D self.args[:-1] + except SkipInstruction: + raise except Exception as e: raise Exception("Bad arg %s: %s" % (op, e)) =20 @@ -339,10 +356,13 @@ def main(): continue cpuid =3D row[6] if cpuid in archs: - g =3D InsnGenerator(insn[0], insn[1:]) - for insn in g.gen(): - outf.write('TEST(%d, "%s", %s)\n' % (n, insn, g.optype= )) - n +=3D 1 + try: + g =3D InsnGenerator(insn[0], insn[1:]) + for insn in g.gen(): + outf.write('TEST(%d, "%s", %s)\n' % (n, insn, g.op= type)) + n +=3D 1 + except SkipInstruction: + pass outf.write("#undef TEST\n") csvfile.close() =20 --=20 2.37.2