Skip to content
Snippets Groups Projects
Commit b4123787 authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Richard Henderson
Browse files

decodetree: Use Python3 floor division operator


This script started using Python2, where the 'classic' division
operator returns the floor result. In commit 3d004a37 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: 3d004a37
Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200330121345.14665-1-f4bug@amsat.org>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent e20cb81d
No related branches found
No related tags found
No related merge requests found
......@@ -1025,7 +1025,7 @@ def output_code(self, i, extracted, outerbits, outermask):
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 @@ def output_code(self, i, extracted, outerbits, outermask):
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment