Author: Brian Kearns <[email protected]>
Branch:
Changeset: r73857:1a0e91f3f025
Date: 2014-10-09 01:01 -0400
http://bitbucket.org/pypy/pypy/changeset/1a0e91f3f025/
Log: don't track index on one of the call1 iterators, test
diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py
--- a/pypy/module/micronumpy/loop.py
+++ b/pypy/module/micronumpy/loop.py
@@ -72,6 +72,7 @@
out = W_NDimArray.from_shape(space, shape, res_dtype, w_instance=w_obj)
obj_iter, obj_state = w_obj.create_iter(shape)
out_iter, out_state = out.create_iter(shape)
+ obj_iter.track_index = False
shapelen = len(shape)
while not out_iter.done(out_state):
call1_driver.jit_merge_point(shapelen=shapelen, func=func,
diff --git a/pypy/module/micronumpy/test/test_zjit.py
b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -329,20 +329,23 @@
def define_ufunc():
return """
a = |30|
- b = a + a
- c = unegative(b)
- c -> 3
+ b = unegative(a)
+ b -> 3
"""
def test_ufunc(self):
result = self.run("ufunc")
- assert result == -6
- py.test.skip("don't run for now")
- self.check_simple_loop({"raw_load": 2, "float_add": 1,
- "float_neg": 1,
- "raw_store": 1, "int_add": 1,
- "int_ge": 1, "guard_false": 1, "jump": 1,
- 'arraylen_gc': 1})
+ assert result == -3
+ self.check_simple_loop({
+ 'float_neg': 1,
+ 'guard_not_invalidated': 1,
+ 'int_add': 3,
+ 'int_ge': 1,
+ 'guard_false': 1,
+ 'jump': 1,
+ 'raw_load': 1,
+ 'raw_store': 1,
+ })
def define_specialization():
return """
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit