[pypy-svn] r71695 - in pypy/trunk/pypy/jit: backend/x86 metainterp/test
fijal at codespeak.net
fijal at codespeak.net
Wed Mar 3 04:19:44 CET 2010
Author: fijal
Date: Wed Mar 3 04:19:42 2010
New Revision: 71695
Modified:
pypy/trunk/pypy/jit/backend/x86/assembler.py
pypy/trunk/pypy/jit/backend/x86/regalloc.py
pypy/trunk/pypy/jit/metainterp/test/test_executor.py
Log:
Clearly I should read intel manuals better. Improve tests, fix uint_floordiv
Modified: pypy/trunk/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/assembler.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/assembler.py Wed Mar 3 04:19:42 2010
@@ -719,9 +719,8 @@
genop_int_floordiv = genop_int_mod
def genop_uint_floordiv(self, op, arglocs, resloc):
- self.mc.MOV(edx, eax)
- self.mc.SAR(edx, imm(31))
- self.mc.IDIV(ecx)
+ self.mc.XOR(edx, edx)
+ self.mc.DIV(ecx)
def genop_new_with_vtable(self, op, arglocs, result_loc):
assert result_loc is eax
Modified: pypy/trunk/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/regalloc.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/regalloc.py Wed Mar 3 04:19:42 2010
@@ -510,7 +510,8 @@
def consider_int_floordiv(self, op):
self._consider_int_div_or_mod(op, eax, edx)
self.Perform(op, [eax, ecx], eax)
- consider_uint_floordiv = consider_int_mod
+
+ consider_uint_floordiv = consider_int_floordiv
def _consider_compop(self, op, guard_op):
vx = op.args[0]
Modified: pypy/trunk/pypy/jit/metainterp/test/test_executor.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_executor.py (original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_executor.py Wed Mar 3 04:19:42 2010
@@ -132,7 +132,14 @@
( 1, 4, intmask(r_uint(1) >> r_uint(4))),
( 3, 3, 0)]),
(rop.UINT_FLOORDIV, [(4, 3, intmask(r_uint(4) / r_uint(3))),
- (1, -1, intmask(r_uint(1) / r_uint(-1)))])
+ (1, -1, intmask(r_uint(1) / r_uint(-1))),
+ (110, 3, 36),
+ (-110, 3, intmask(r_uint(-110) / r_uint(3))),
+ (110, -3, intmask(r_uint(110) / r_uint(-3))),
+ (-110, -3, intmask(r_uint(-110) / r_uint(-3))),
+ (-110, -1, intmask(r_uint(-110) / r_uint(-1))),
+ (minint, 1, intmask(r_uint(minint) / r_uint(1))),
+ (-87, -87, intmask(r_uint(-87) / r_uint(-87)))])
]:
for x, y, z in testcases:
yield opnum, [x, y], z
More information about the Pypy-commit
mailing list