about summary refs log tree commit diff stats
path: root/miasm2/arch/mep/sem.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-25 11:09:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-03-05 16:52:49 +0100
commit02bbb30efea4980c9d133947cbbf69fb599071ad (patch)
tree3fea6826fcc5354840a27cb1dc99ff31eef81896 /miasm2/arch/mep/sem.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadmiasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'miasm2/arch/mep/sem.py')
-rw-r--r--miasm2/arch/mep/sem.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/miasm2/arch/mep/sem.py b/miasm2/arch/mep/sem.py
index fb67becd..c346c535 100644
--- a/miasm2/arch/mep/sem.py
+++ b/miasm2/arch/mep/sem.py
@@ -929,15 +929,15 @@ def div(rn, rm):
     tmp_rm_inv = rm_inv if rm_inv else i32(1)
 
     # Results if only rn, or rm is negative
-    LO_rn_neg = (~(rn_inv / tmp_rm) + i32(1)) if sign_rn else (~(rn / tmp_rm_inv) + i32(1))
+    LO_rn_neg = (~(rn_inv // tmp_rm) + i32(1)) if sign_rn else (~(rn // tmp_rm_inv) + i32(1))
     HI_rn_neg = (~(rn_inv % tmp_rm) + i32(1)) if sign_rn else (~(rn % tmp_rm_inv) + i32(1))
 
     # Results if both numbers are positive
-    LO_pos = rn / tmp_rm if are_both_pos else LO_rn_neg
+    LO_pos = rn // tmp_rm if are_both_pos else LO_rn_neg
     HI_pos = rn % tmp_rm if are_both_pos else HI_rn_neg
 
     # Results if both numbers are negative
-    LO_neg = rn_inv / tmp_rm_inv if are_both_neg else LO_pos
+    LO_neg = rn_inv // tmp_rm_inv if are_both_neg else LO_pos
     HI_neg = rn_inv % tmp_rm_inv if are_both_neg else HI_pos
 
     # Results if rm is equal to zero
@@ -954,7 +954,7 @@ def divu(rn, rm):
     # LO <- Rn / Rm, HI <- Rn % Rm (Unsigned)
 
     tmp_rm = rm if rm else i32(1)  # used to delay the arithmetic computations
-    LO = rn / tmp_rm if rm else LO
+    LO = rn // tmp_rm if rm else LO
     HI = rn % tmp_rm if rm else HI
 
     exception_flags = i32(0) if rm else i32(EXCEPT_DIV_BY_ZERO)