From patchwork Tue Mar 31 03:54:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185084 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp3247606ilr; Mon, 30 Mar 2020 21:03:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtLkQelyDnSUsxU7tizxcrPGpXzWenSsDNkBVVHISQkUdsJ783kJYUMLs2jCcBZorQ0SVzJ X-Received: by 2002:a05:6214:1863:: with SMTP id eh3mr15101990qvb.71.1585627413580; Mon, 30 Mar 2020 21:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585627413; cv=none; d=google.com; s=arc-20160816; b=kkzpexqka35qx7NbCprRPR2kqhmDgvJjv770t++rdIe4Jk8X5hGk34zEacf+IbcHrm wjg851ghe6qWV9etreHp4o4oQKkzcqO9+FBd31fKIB5J16VwCr6726rmvB0KWjxlUxMG XmC2FfhUdbd/jEgeAP61dX+w2b3rFJLZ6Xa/c5+K3NzjeYtJB8HXNUzz59oIj+zQCq13 i0WNafjvs0Yz9Fcy4xA00xWB0QSy8f5OL3GfMmn8LjnJleSOyCYWDHqHaGn92FQditzc xAgqooLXhisbpX2ziOb02sMcBPTmTSxxPZyubwwJ32ujkFYMnuOKYRJgNHY8ARFQLiYX NaCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=c+Tp2V6+LD0F/OwBiPn+CFeXg9gywOboZsBIVwTf7gQ=; b=ujb9ZkKrqYtO2ZkCKa8CCraO0qlcTSlAhSlOqGi1Kf+Q0Pd/AnLIZn9rXqNSjU5+fj wMxDEFig9bTOMOahXOBAJUE2eL/KlkEQA59YB1UFMxBMQAgNpGbWrVtm6G//6mA/d1zQ OPAUJXUvihT6Ixc0eal55xyYdBaHVI14cxfkIHRPUEn6pVkzFSQbJOX7asi92fYuhBk5 uA8pwB/WWeHBk6xGmD+3D7p+kUsfceI7g2DLNWYgOT88mTGejJoJgj+Oo0OeR3OZiTxk aK55YkL6zpah75S48loIK1HadwiOmW6qzBNl2MAtzS8ScV1hGQAEK8Bn/l0uGIHd8oRG PmXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MSd+x3bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z67si9284510qkb.64.2020.03.30.21.03.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 21:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MSd+x3bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ87h-0008Vp-4K for patch@linaro.org; Tue, 31 Mar 2020 00:03:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ7zf-0004rp-9Q for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ7ze-0008Ls-8b for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:15 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:43782) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ7ze-0008Kt-1y for qemu-devel@nongnu.org; Mon, 30 Mar 2020 23:55:14 -0400 Received: by mail-pg1-x532.google.com with SMTP id g20so263334pgk.10 for ; Mon, 30 Mar 2020 20:55:14 -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=c+Tp2V6+LD0F/OwBiPn+CFeXg9gywOboZsBIVwTf7gQ=; b=MSd+x3bnkEVoSxvLeKdHDVtbFsQRFrPR1E6d+c0MH3aPXnlh3U0b20GXJvwkw7sftb nC3ds+5Oq4XVfRUD2E36GM+T7W2K+E2+TuTm0fbe5PzjCcmx4bZDOB4LlO9yIpKaZuXe cPJpko1rPeaBbJgWZv7yj/RjUOhp7ubzr3s2lW6AKHtvA2yUZx4Nz3973e/Iufytc9SK rdijkqbpD7ul2MJuBNGLeJlEIr6S1ws4XmoeqSXN81ihpC98u7RB5vxXDVox8b9s0II2 DM+EdIEYKyhgky/y9bf0l/cICUIbVUDV3xSfuHLm+J4xn7cu9EJRWLBOnLFLurobHGI5 U74g== 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=c+Tp2V6+LD0F/OwBiPn+CFeXg9gywOboZsBIVwTf7gQ=; b=n8STos92U2OWC4ewDRnkkYyWq+yOeon59Cth81s1mYRrsaBJq5dBMb2/62T4hyZXry j8rrO5uv5CkhuwObQdPSWGaq5ljkC6b4N6rp4mQCIAWKc5gSqV+al2eddXoXS+IIgYp/ 0yfCng+EG+LKiUSb/t4W/btj0izwzL+sytabvMqUtyFzicywJ9g0pD4Stgiy6K/LFN2Y +rctbE3VxD99ftFIdrym2JOQ6wvMHqz+e5CO1TgPrlU9RhUfk4x3P+Kk2PhByMhQ8aep PYFDQ8eHN8aaBT9TrR9RX/PzSor3l2ukVke64XgM/QxV2knXf+t+EZJRjeI+A300Q3Cj 0gvw== X-Gm-Message-State: ANhLgQ1MVADVwq01D3KwgwnsyhA898H5IlTDAJgmg9/8Vz3Q5UnZX1Z2 HuL5ivCw/QhMoXNtswDgzOGHg5McToQ= X-Received: by 2002:a63:c712:: with SMTP id n18mr15360690pgg.343.1585626912712; Mon, 30 Mar 2020 20:55:12 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id h11sm11386174pfq.56.2020.03.30.20.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 20:55:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-5.0 10/10] decodetree: Use Python3 floor division operator Date: Mon, 30 Mar 2020 20:54:56 -0700 Message-Id: <20200331035456.6494-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331035456.6494-1-richard.henderson@linaro.org> References: <20200331035456.6494-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::532 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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 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é Message-Id: <20200330121345.14665-1-f4bug@amsat.org> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- scripts/decodetree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 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 @@ class SizeTree: if extracted < self.width: output(ind, 'insn = ', decode_function, '_load_bytes(ctx, insn, {0}, {1});\n' - .format(extracted / 8, self.width / 8)); + .format(extracted // 8, self.width // 8)); extracted = self.width # Attempt to aid the compiler in producing compact switch statements. @@ -1079,7 +1079,7 @@ class SizeLeaf: if extracted < self.width: output(ind, 'insn = ', decode_function, '_load_bytes(ctx, insn, {0}, {1});\n' - .format(extracted / 8, self.width / 8)); + .format(extracted // 8, self.width // 8)); extracted = self.width output(ind, 'return insn;\n') # end SizeLeaf