From nobody Thu Apr 25 19:07:45 2024 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1585570486; cv=none; d=zohomail.com; s=zohoarc; b=TszRujNMOsJbWYbj4bisQKkP1v0CQ2URLC6vCszhHbRzzRNVRvD0bxHdn+HpI53fHcVGjP6EgCn9eqKxOYvX1NWDdd6gUHAhNhNclx3qIjS2mfM1MDsD718QCZ7XSDtzhsDgXpksKz3lOsJCstdhqLRbSMZQQlT2tCR0t3t4c4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585570486; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=i+My85ICmy0qF0DEe3a9VMg2W1L8PvAxyzPBdac6GnA=; b=ILqxI9ANnHxjeXrFira9LnDqnt3oD+asUCWu5GUau3JOlKDzNQQMbVJ6jh9o+TSrlUUddCBWa8miS6WxLievIms1WtUfYZ/B9n3v9KCltjqVpwsZDnIDRDq5019SUGTxwbp03W9m+qV/FJ70wqfbV574XsFuGRzv0rbtjbFHOsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585570486802648.1935398106343; Mon, 30 Mar 2020 05:14:46 -0700 (PDT) Received: from localhost ([::1]:48808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jItJV-0000hs-LU for importer@patchew.org; Mon, 30 Mar 2020 08:14:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37211) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jItIc-0008I0-8C for qemu-devel@nongnu.org; Mon, 30 Mar 2020 08:13:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jItIb-0001VE-25 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 08:13:50 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:40935) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jItIa-0001SJ-Q1 for qemu-devel@nongnu.org; Mon, 30 Mar 2020 08:13:49 -0400 Received: by mail-wr1-x431.google.com with SMTP id u10so21307695wro.7 for ; Mon, 30 Mar 2020 05:13:48 -0700 (PDT) Received: from x1w.redhat.com (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id k3sm22748384wrw.61.2020.03.30.05.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 05:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i+My85ICmy0qF0DEe3a9VMg2W1L8PvAxyzPBdac6GnA=; b=A0rw3WYKOrdFyuEoCSDmXH/9kTkR4geTJc5CSCX0hRJ403uvPk41pzVC7lFLhpK+dj eylInfM7snt2gafEUNIoVB/sGqWPFV6cQVcH3VXt1R4NR29de2katk6qZMte9rAZGFj3 8UvVVy7sfycGD48yHS5P0FEgy9sMgXkYRLneH8Pp/AZ8yOdeN5hcfU0G5ww8+cf4KO+J fQkqi4ZzPKKEEqUFj7j8vifdmAAUkvZPY2dTQyzE+4f4KDzXWaC4GSkN0lLbbDBkMQpE wwRd33fP3gHPE0GeRm2TfvbbEsZuPNqxDhbMmdDe7OwrI39aEP/CcjSbaEFFthi2zHtV lYYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=i+My85ICmy0qF0DEe3a9VMg2W1L8PvAxyzPBdac6GnA=; b=iHwk0Jazwr1rmwBP5fpHMwn6OM47ypc+Lilhb0hcnlSrAh0jhcW56+dtgxyxKW1ieG lXsu8v4r1e2l8oCijXSsfFo4E0z4wBglj1QYOUUZICKIXGbgtimm/u1zjPKvLNcfkoJH fYmBV677WsoxWDN9ITm8Q0F5BE9UQ7OuWQwpqacI1XgF0cvpdNfJr6bOlz9xzgLFHRBG t/FdwjjVOXB7EypF+NIbciI6+VOIsmPmblFGepQo2Sp5YwOJK7nlsVt7UTsTCyJtN3eE QREbv8n0jVs1vGekwcPdQp59u7Xq0jN6yaYzbZzjeLj8g47qSkc+TTPHom6O4fEaBlxi UmIg== X-Gm-Message-State: ANhLgQ3iHxfOR6tpeTrxHAC9WeisaoSyeTHRURtL3Xa5wC0Pw5cYZ7Lv VNyQAZbxcFaZ+MUBpm0FaJMEHVOrST4= X-Google-Smtp-Source: ADFU+vsgd08iSXkkGxjrRHGV9E83sYcBQgvij2oPHVIsjdiUIgOgE3kvIDlwnp80AC8thC1AQfg8gQ== X-Received: by 2002:adf:9b9d:: with SMTP id d29mr14567087wrc.294.1585570427055; Mon, 30 Mar 2020 05:13:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.0?] decodetree: Use Python3 floor division operator Date: Mon, 30 Mar 2020 14:13:45 +0200 Message-Id: <20200330121345.14665-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::431 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: Eduardo Habkost , Yoshinori Sato , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This script started using Python2, where the 'classic' division operator returns the floor result. In commit 3d004a371 we started to use Python3, where the division operator returns the float result ('true division'). To keep the same behavior, use the 'floor division' operator "//" which returns the floor result. Fixes: 3d004a371 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- We didn't notice it because only the RX port (which uses the --varinsnwidth option, and got merged very recently) triggers these problems. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- scripts/decodetree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 2a8f2b6e06..46ab917807 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1025,7 +1025,7 @@ def output_code(self, i, extracted, outerbits, outerm= ask): if extracted < self.width: output(ind, 'insn =3D ', decode_function, '_load_bytes(ctx, insn, {0}, {1});\n' - .format(extracted / 8, self.width / 8)); + .format(extracted // 8, self.width // 8)); extracted =3D self.width =20 # Attempt to aid the compiler in producing compact switch statemen= ts. @@ -1079,7 +1079,7 @@ def output_code(self, i, extracted, outerbits, outerm= ask): if extracted < self.width: output(ind, 'insn =3D ', decode_function, '_load_bytes(ctx, insn, {0}, {1});\n' - .format(extracted / 8, self.width / 8)); + .format(extracted // 8, self.width // 8)); extracted =3D self.width output(ind, 'return insn;\n') # end SizeLeaf --=20 2.21.1