[pypy-commit] pypy s390x-backend: jump location was off, shift by parameter of sradi is weird (but it works now)

plan_rich pypy.commits at gmail.com
Tue Mar 8 03:26:08 EST 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r82874:78f8d539bef6
Date: 2016-03-08 09:25 +0100
http://bitbucket.org/pypy/pypy/changeset/78f8d539bef6/

Log:	jump location was off, shift by parameter of sradi is weird (but it
	works now)

diff --git a/rpython/jit/backend/ppc/opassembler.py b/rpython/jit/backend/ppc/opassembler.py
--- a/rpython/jit/backend/ppc/opassembler.py
+++ b/rpython/jit/backend/ppc/opassembler.py
@@ -905,7 +905,7 @@
         jlt_location = self.mc.currpos()
         self.mc.trap()
 
-        self.mc.sradi(r.SCRATCH.value, length_loc.value, shift_by, 31)
+        self.mc.sradi(r.SCRATCH.value, length_loc.value, 0, shift_by)
         self.mc.mtctr(r.SCRATCH.value) # store the length in count register
 
         self.mc.li(r.SCRATCH.value, 0)
@@ -949,9 +949,9 @@
 
         self.mc.subi(ofs_loc.value, ofs_loc.value, 1)
 
-        loop_position = self.mc.currpos()
+        loop_location = self.mc.currpos()
         self.eza_stXu(r.SCRATCH.value, ofs_loc.value, 1, 1)
-        self.mc.bdnz(self.mc.currpos() - loop_location)
+        self.mc.bdnz(loop_location - self.mc.currpos())
 
         pmc = OverwritingBuilder(self.mc, jle_location, 1)
         pmc.ble(self.mc.currpos() - jle_location)    # !GT


More information about the pypy-commit mailing list