Author: Richard Plangger <[email protected]>
Branch: vecopt-merge
Changeset: r79124:38a19b56ef23
Date: 2015-08-21 19:25 +0200
http://bitbucket.org/pypy/pypy/changeset/38a19b56ef23/
Log: fixed issues with test cases for llgraph
diff --git a/rpython/jit/backend/llgraph/runner.py
b/rpython/jit/backend/llgraph/runner.py
--- a/rpython/jit/backend/llgraph/runner.py
+++ b/rpython/jit/backend/llgraph/runner.py
@@ -17,6 +17,11 @@
from rpython.rlib.clibffi import FFI_DEFAULT_ABI
from rpython.rlib.rarithmetic import ovfcheck, r_uint, r_ulonglong
+class LLAsmInfo(object):
+ def __init__(self, lltrace):
+ self.ops_offset = None
+ self.lltrace = lltrace
+
class LLTrace(object):
has_been_freed = False
invalid = False
@@ -266,7 +271,7 @@
self.vinfo_for_tests = kwds.get('vinfo_for_tests', None)
def stitch_bridge(self, faildescr, target):
- faildescr._llgraph_bridge = target
+ faildescr._llgraph_bridge = target.lltrace
def compile_loop(self, inputargs, operations, looptoken, jd_id=0,
unique_id=0, log=True, name='', logger=None):
@@ -285,7 +290,7 @@
faildescr._llgraph_bridge = lltrace
clt._llgraph_alltraces.append(lltrace)
self._record_labels(lltrace)
- return lltrace
+ return LLAsmInfo(lltrace)
def _record_labels(self, lltrace):
for i, op in enumerate(lltrace.operations):
@@ -753,6 +758,13 @@
values.append(val)
return values
+ def bh_vec_getarrayitem_gc(self, struct, offset, count, descr):
+ values = []
+ for i in range(count):
+ val = self.bh_getarrayitem_gc(struct, offset + i, descr)
+ values.append(val)
+ return values
+
def bh_vec_raw_load(self, struct, offset, count, descr):
values = []
stride = descr.get_item_size_in_bytes()
@@ -770,6 +782,9 @@
for i,n in enumerate(newvalues):
self.bh_setarrayitem_raw(struct, offset + i, n, descr)
+ def bh_vec_setarrayitem_gc(self, struct, offset, newvalues, descr):
+ for i,n in enumerate(newvalues):
+ self.bh_setarrayitem_gc(struct, offset + i, n, descr)
def store_fail_descr(self, deadframe, descr):
pass # I *think*
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_guard.py
b/rpython/jit/metainterp/optimizeopt/test/test_guard.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_guard.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_guard.py
@@ -319,12 +319,13 @@
opt = self.optguards(loop1, True)
self.assert_guard_count(loop1, 2)
self.assert_contains_sequence(loop1, """
- i40 = int_ge(42, i2)
- guard_true(i40) []
...
i10 = int_gt(i1, 42)
guard_true(i10) []
...
+ i40 = int_gt(i11, i2)
+ guard_true(i40) []
+ ...
""")
class Test(GuardBaseTest, LLtypeMixin):
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -1006,7 +1006,7 @@
asmlen - assembler block length
rawstart - address a guard can jump to
"""
- def __init__(self, ops_offset, asmaddr, asmlen, rawstart):
+ def __init__(self, ops_offset, asmaddr, asmlen, rawstart=0):
self.ops_offset = ops_offset
self.asmaddr = asmaddr
self.asmlen = asmlen
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit