Author: Justin Peel <[email protected]>
Branch: unsigned-dtypes
Changeset: r47658:98e094f789a7
Date: 2011-09-28 14:43 +0000
http://bitbucket.org/pypy/pypy/changeset/98e094f789a7/
Log: branchless unsigned numpy.sign
diff --git a/pypy/jit/metainterp/test/support.py
b/pypy/jit/metainterp/test/support.py
--- a/pypy/jit/metainterp/test/support.py
+++ b/pypy/jit/metainterp/test/support.py
@@ -90,7 +90,6 @@
blackholeinterp.setarg_r(count_r, value)
count_r += 1
elif T == lltype.Float:
- print 'ohyes!!'
value = longlong.getfloatstorage(value)
blackholeinterp.setarg_f(count_f, value)
count_f += 1
diff --git a/pypy/module/micronumpy/interp_dtype.py
b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -306,11 +306,7 @@
@unaryop
def sign(self, v):
- if v != 0:
- return 1
- else:
- assert v == 0
- return 0
+ return int(v != 0)
W_BoolDtype = create_low_level_dtype(
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit