From 41df2f8b26e39d851c6f53eed956f963ce28925b Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 2 Mar 2020 11:56:45 +0000 Subject: [PATCH] arch-arm: python3 "/" will always produce a float "/" was ambiguous in python2 and was producing a floor (integer) division if the operands were int or long. In python3 "/" will always produce a float which makes it unsuitable in cases where an integer is expected PEP238: https://www.python.org/dev/peps/pep-0238/ Change-Id: I481cf1e9c0f95a6f47ecf6539eee0c9bcaf31e17 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26247 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/arm/isa/insts/macromem.isa | 2 +- src/arch/arm/isa/insts/neon64.isa | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/arm/isa/insts/macromem.isa b/src/arch/arm/isa/insts/macromem.isa index 6f507b9b1..1b9cdf7e8 100644 --- a/src/arch/arm/isa/insts/macromem.isa +++ b/src/arch/arm/isa/insts/macromem.isa @@ -580,7 +580,7 @@ let {{ exec_output = '' for typeSize in (8, 16, 32): for sRegs in 1, 2: - for dRegs in range(sRegs, min(sRegs * 64 / typeSize + 1, 5)): + for dRegs in range(sRegs, min(sRegs * 64 // typeSize + 1, 5)): for format in ("MicroUnpackNeon%(sRegs)dto%(dRegs)dUop", "MicroUnpackAllNeon%(sRegs)dto%(dRegs)dUop", "MicroPackNeon%(dRegs)dto%(sRegs)dUop"): diff --git a/src/arch/arm/isa/insts/neon64.isa b/src/arch/arm/isa/insts/neon64.isa index 8173cc0f5..e1b0f441e 100644 --- a/src/arch/arm/isa/insts/neon64.isa +++ b/src/arch/arm/isa/insts/neon64.isa @@ -552,7 +552,7 @@ let {{ %(op)s destReg.elements[0] = htole(destElem); ''' % { "op" : op } - destCnt = rCount / 2 + destCnt = rCount // 2 for reg in range(destCnt): eWalkCode += ''' AA64FpDestP%(reg)d_uw = letoh(destReg.regs[%(reg)d]); -- 2.30.2