From nobody Sun May 5 15:56:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=us.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1566401396; cv=none; d=zoho.com; s=zohoarc; b=XYEg1HILw6nksrD8dq23OB4qFK5j0YSCA233VpdDXKpoK0Gy9b+DtilQk2dn2VPpNZqwLLhu7/37pCX3BPZaXuetQalemboZzW/Iu3t96UrpKW64Tq27A1HPlbdlgWCXA/nn8k/XrGQjGOJPDbl2B4G/89nMZHl9iH8lTuv+iQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566401396; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=JWEdL4AP2JdF7G2O8vWStZzcbCOr/TId/G7Ij46ZBn0=; b=JlGxuhvSyiYrJSjLB/o2PH+zxXxsfJqxP9S8gwm1Opb/In3QTt+b8VVSmnGJXv+XJpF5V0W8xjClVcJitCwJe1SWXEfqJ+cItXG27HcYeYkoAwkEK96aNcStJYfnAfyromwHw4hD4ZQSUqdPMo2xOoVm9/LC8hHM7d8mAG2LNbE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566401396402699.8839916186521; Wed, 21 Aug 2019 08:29:56 -0700 (PDT) Received: from localhost ([::1]:49512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0SYd-0000Ly-AH for importer@patchew.org; Wed, 21 Aug 2019 11:29:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48827) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0SXh-0007c9-2V for qemu-devel@nongnu.org; Wed, 21 Aug 2019 11:28:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0SXf-0004eL-TL for qemu-devel@nongnu.org; Wed, 21 Aug 2019 11:28:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i0SXb-0004bO-Ig; Wed, 21 Aug 2019 11:28:51 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7LFPRDV088421; Wed, 21 Aug 2019 11:28:44 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uh6hx69y8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 11:28:44 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x7LFKaWW004661; Wed, 21 Aug 2019 15:28:43 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma03wdc.us.ibm.com with ESMTP id 2ug0ckaua9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 15:28:42 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7LFSgDo59507036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Aug 2019 15:28:42 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12FC96A04F; Wed, 21 Aug 2019 15:28:42 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0FB16A047; Wed, 21 Aug 2019 15:28:41 +0000 (GMT) Received: from localhost (unknown [9.85.217.41]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 21 Aug 2019 15:28:41 +0000 (GMT) From: "Paul A. Clarke" To: david@gibson.dropbear.id.au Date: Wed, 21 Aug 2019 10:28:41 -0500 Message-Id: <1566401321-22419-1-git-send-email-pc@us.ibm.com> X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-21_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=737 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908210162 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH] ppc: Fix xsmaddmdp and friends 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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Paul A. Clarke" A class of instructions of the form: op Target,A,B which operate like: Target =3D Target * A + B have a bit set which distinguishes them from instructions that operate as: Target =3D Target * B + A This bit is not being checked properly (using PPC_BIT macro), so all instructions in this class are operating incorrectly as the second form above. The bit was being checked as if it were part of a 64-bit instruction opcode, rather than a proper 32-bit opcode. Fix by using the macro (PPC_BIT32) which treats the opcode as a 32-bit quantity. Signed-off-by: Paul A. Clarke Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier --- target/ppc/translate/vsx-impl.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx= -impl.inc.c index 3922686..8287e27 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1308,7 +1308,7 @@ static void gen_##name(DisasContext *ctx) = \ } = \ xt =3D gen_vsr_ptr(xT(ctx->opcode)); = \ xa =3D gen_vsr_ptr(xA(ctx->opcode)); = \ - if (ctx->opcode & PPC_BIT(25)) { = \ + if (ctx->opcode & PPC_BIT32(25)) { = \ /* = \ * AxT + B = \ */ = \ --=20 1.8.3.1