[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL for-5.0 10/10] decodetree: Use Python3 floor division operator
From: |
Richard Henderson |
Subject: |
[PULL for-5.0 10/10] decodetree: Use Python3 floor division operator |
Date: |
Mon, 30 Mar 2020 20:54:56 -0700 |
From: Philippe Mathieu-Daudé <address@hidden>
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é <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
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 @@ 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
--
2.20.1
- [PULL for-5.0 02/10] tcg: Remove softmmu code_gen_buffer fixed address, (continued)
- [PULL for-5.0 02/10] tcg: Remove softmmu code_gen_buffer fixed address, Richard Henderson, 2020/03/30
- [PULL for-5.0 04/10] configure: Always detect -no-pie toolchain support, Richard Henderson, 2020/03/30
- [PULL for-5.0 05/10] configure: Unnest detection of -z, relro and -z, now, Richard Henderson, 2020/03/30
- [PULL for-5.0 06/10] configure: Override the os default with --disable-pie, Richard Henderson, 2020/03/30
- [PULL for-5.0 07/10] configure: Support -static-pie if requested, Richard Henderson, 2020/03/30
- [PULL for-5.0 08/10] target/mips: Fix loongson multimedia condition instructions, Richard Henderson, 2020/03/30
- [PULL for-5.0 09/10] tcg/i386: Fix INDEX_op_dup2_vec, Richard Henderson, 2020/03/30
- [PULL for-5.0 10/10] decodetree: Use Python3 floor division operator,
Richard Henderson <=
- Re: [PULL for-5.0 00/10] tcg patch queue, Peter Maydell, 2020/03/31