[pypy-commit] pypy default: cleanups
bdkearns
noreply at buildbot.pypy.org
Thu Dec 4 23:57:11 CET 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r74819:a0e9ee8c4971
Date: 2014-12-04 17:57 -0500
http://bitbucket.org/pypy/pypy/changeset/a0e9ee8c4971/
Log: cleanups
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -287,8 +287,9 @@
def logical_xor(self, v1, v2):
return bool(v1) ^ bool(v2)
+ @raw_unary_op
def bool(self, v):
- return bool(self.for_computation(self.unbox(v)))
+ return bool(v)
@simple_binary_op
def max(self, v1, v2):
diff --git a/pypy/module/micronumpy/ufuncs.py b/pypy/module/micronumpy/ufuncs.py
--- a/pypy/module/micronumpy/ufuncs.py
+++ b/pypy/module/micronumpy/ufuncs.py
@@ -18,6 +18,7 @@
def done_if_false(dtype, val):
return not dtype.itemtype.bool(val)
+
def _get_dtype(space, w_npyobj):
if isinstance(w_npyobj, boxes.W_GenericBox):
return w_npyobj.get_dtype(space)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
--- a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
@@ -16,14 +16,14 @@
i33 = raw_load(i9, i29, descr=<ArrayU 1>)
guard_false(i33, descr=...)
guard_not_invalidated(descr=...)
- i34 = getarrayitem_raw(#, 1, descr=<ArrayU 1>)
- guard_value(i34, 0, descr=...)
- i35 = getarrayitem_raw(#, 0, descr=<ArrayU 1>)
+ i34 = getarrayitem_raw(#, 1, descr=<ArrayU 1>) # XXX what are these?
+ guard_value(i34, 0, descr=...) # XXX
+ i35 = getarrayitem_raw(#, 0, descr=<ArrayU 1>) # XXX
i36 = int_add(i24, 1)
i37 = int_add(i29, i28)
i38 = int_ge(i36, i30)
guard_false(i38, descr=...)
- guard_value(i35, 1, descr=...)
+ guard_value(i35, 1, descr=...) # XXX
jump(p0, p25, i36, i37, i9, i28, i30, descr=...)
""")
@@ -130,7 +130,7 @@
setfield_gc(p97, i93, descr=<FieldS pypy.module.micronumpy.iterators.IterState.inst_offset .+>)
i96 = int_lt(i95, 0)
guard_false(i96, descr=...)
- jump(p0, p1, p3, p6, p12, p14, p16, i94, f90, p26, i45, i91, i59, p97, p96, i67, i93, i76, descr=...)
+ jump(p0, p1, p3, p6, p12, p14, p16, i94, f90, p26, i45, i91, i59, p96, p97, i67, i93, i76, descr=...)
""")
def test_array_flatiter_getitem_single(self):
More information about the pypy-commit
mailing list