[pypy-commit] pypy ppc-jit-backend: merge heads
bivab
noreply at buildbot.pypy.org
Thu Jul 19 09:10:48 CEST 2012
Author: David Schneider <david.schneider at picle.org>
Branch: ppc-jit-backend
Changeset: r56217:85c91b5faeb3
Date: 2012-07-19 00:09 -0700
http://bitbucket.org/pypy/pypy/changeset/85c91b5faeb3/
Log: merge heads
diff --git a/pypy/jit/backend/arm/opassembler.py b/pypy/jit/backend/arm/opassembler.py
--- a/pypy/jit/backend/arm/opassembler.py
+++ b/pypy/jit/backend/arm/opassembler.py
@@ -1336,6 +1336,7 @@
emit_op_convert_longlong_bytes_to_float = gen_emit_unary_float_op('longlong_bytes_to_float', 'VMOV_cc')
def emit_op_read_timestamp(self, op, arglocs, regalloc, fcond):
+ assert 0, 'not supported'
tmp = arglocs[0]
res = arglocs[1]
self.mc.MRC(15, 0, tmp.value, 15, 12, 1)
diff --git a/pypy/jit/backend/arm/test/test_basic.py b/pypy/jit/backend/arm/test/test_basic.py
new file mode 100644
--- /dev/null
+++ b/pypy/jit/backend/arm/test/test_basic.py
@@ -0,0 +1,35 @@
+import py
+from pypy.jit.metainterp.test import test_ajit
+from pypy.rlib.jit import JitDriver
+from pypy.jit.backend.arm.test.support import JitARMMixin
+
+class TestBasic(JitARMMixin, test_ajit.BaseLLtypeTests):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_ajit.py
+ def test_bug(self):
+ jitdriver = JitDriver(greens = [], reds = ['n'])
+ class X(object):
+ pass
+ def f(n):
+ while n > -100:
+ jitdriver.can_enter_jit(n=n)
+ jitdriver.jit_merge_point(n=n)
+ x = X()
+ x.arg = 5
+ if n <= 0: break
+ n -= x.arg
+ x.arg = 6 # prevents 'x.arg' from being annotated as constant
+ return n
+ res = self.meta_interp(f, [31], enable_opts='')
+ assert res == -4
+
+ def test_r_dict(self):
+ # a Struct that belongs to the hash table is not seen as being
+ # included in the larger Array
+ py.test.skip("issue with ll2ctypes")
+
+ def test_free_object(self):
+ py.test.skip("issue of freeing, probably with ll2ctypes")
+
+ def test_read_timestamp(self):
+ py.test.skip("The JIT on ARM does not support read_timestamp")
diff --git a/pypy/jit/backend/test/test_frame_size.py b/pypy/jit/backend/test/test_frame_size.py
deleted file mode 100644
--- a/pypy/jit/backend/test/test_frame_size.py
+++ /dev/null
@@ -1,100 +0,0 @@
-import py, sys, random, os, struct, operator
-from pypy.jit.metainterp.history import (AbstractFailDescr,
- AbstractDescr,
- BasicFailDescr,
- BoxInt, Box, BoxPtr,
- LoopToken,
- ConstInt, ConstPtr,
- BoxObj, Const,
- ConstObj, BoxFloat, ConstFloat)
-from pypy.jit.metainterp.resoperation import ResOperation, rop
-from pypy.jit.metainterp.typesystem import deref
-from pypy.jit.tool.oparser import parse
-from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rffi, rclass
-from pypy.rpython.ootypesystem import ootype
-from pypy.rpython.annlowlevel import llhelper
-from pypy.rpython.llinterp import LLException
-from pypy.jit.codewriter import heaptracker, longlong
-from pypy.jit.codewriter.effectinfo import EffectInfo
-from pypy.rlib.rarithmetic import intmask
-from pypy.jit.backend.detect_cpu import getcpuclass
-
-CPU = getcpuclass()
-
-class TestFrameSize(object):
- cpu = CPU(None, None)
- cpu.setup_once()
-
- looptoken = None
-
- def f1(x):
- return x+1
-
- F1PTR = lltype.Ptr(lltype.FuncType([lltype.Signed], lltype.Signed))
- f1ptr = llhelper(F1PTR, f1)
- f1_calldescr = cpu.calldescrof(F1PTR.TO, F1PTR.TO.ARGS,
- F1PTR.TO.RESULT, EffectInfo.MOST_GENERAL)
- namespace = locals().copy()
- type_system = 'lltype'
-
- def parse(self, s, boxkinds=None):
- return parse(s, self.cpu, self.namespace,
- type_system=self.type_system,
- boxkinds=boxkinds)
-
- def interpret(self, ops, args, run=True):
- loop = self.parse(ops)
- self.cpu.compile_loop(loop.inputargs, loop.operations, loop.token)
- for i, arg in enumerate(args):
- if isinstance(arg, int):
- self.cpu.set_future_value_int(i, arg)
- elif isinstance(arg, float):
- self.cpu.set_future_value_float(i, arg)
- else:
- assert isinstance(lltype.typeOf(arg), lltype.Ptr)
- llgcref = lltype.cast_opaque_ptr(llmemory.GCREF, arg)
- self.cpu.set_future_value_ref(i, llgcref)
- if run:
- self.cpu.execute_token(loop.token)
- return loop
-
- def getint(self, index):
- return self.cpu.get_latest_value_int(index)
-
- def getfloat(self, index):
- return self.cpu.get_latest_value_float(index)
-
- def getints(self, end):
- return [self.cpu.get_latest_value_int(index) for
- index in range(0, end)]
-
- def getfloats(self, end):
- return [self.cpu.get_latest_value_float(index) for
- index in range(0, end)]
-
- def getptr(self, index, T):
- gcref = self.cpu.get_latest_value_ref(index)
- return lltype.cast_opaque_ptr(T, gcref)
-
-
-
- def test_call_loop_from_loop(self):
-
- large_frame_loop = """
- [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14]
- i15 = call(ConstClass(f1ptr), i0, descr=f1_calldescr)
- finish(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15)
- """
- large = self.interpret(large_frame_loop, range(15), run=False)
- self.namespace['looptoken'] = large.token
- assert self.namespace['looptoken']._arm_func_addr != 0
- small_frame_loop = """
- [i0]
- i1 = int_add(i0, 1)
- jump(i1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, descr=looptoken)
- """
-
- self.interpret(small_frame_loop, [110])
- expected = [111, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 112]
- assert self.getints(16) == expected
-
More information about the pypy-commit
mailing list