Author: Matti Picus <[email protected]>
Branch: numpypy.float16
Changeset: r58522:4eac89c2ad82
Date: 2012-10-27 23:14 +0200
http://bitbucket.org/pypy/pypy/changeset/4eac89c2ad82/

Log:    basic tests and framework in place, start to implement

diff --git a/pypy/module/micronumpy/__init__.py 
b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -55,6 +55,7 @@
         'inexact': 'interp_boxes.W_InexactBox',
         'floating': 'interp_boxes.W_FloatingBox',
         'float_': 'interp_boxes.W_Float64Box',
+        'float16': 'interp_boxes.W_Float16Box',
         'float32': 'interp_boxes.W_Float32Box',
         'float64': 'interp_boxes.W_Float64Box',
         'intp': 'types.IntP.BoxType',
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
@@ -507,14 +507,14 @@
             self.w_int16dtype, self.w_uint16dtype, self.w_int32dtype,
             self.w_uint32dtype, self.w_longdtype, self.w_ulongdtype,
             self.w_int64dtype, self.w_uint64dtype,
-            self.w_float12type, self.w_float32dtype, self.w_float64dtype, 
self.w_complex64dtype,
+            self.w_float16dtype, self.w_float32dtype, self.w_float64dtype, 
self.w_complex64dtype,
             self.w_complex128dtype,
             self.w_stringdtype, self.w_unicodedtype,
             self.w_voiddtype, self.w_intpdtype, self.w_uintpdtype,
         ]
         self.float_dtypes_by_num_bytes = sorted(
             (dtype.itemtype.get_element_size(), dtype)
-            for dtype in [self.w_float16type, self.w_float32dtype, 
self.w_float64dtype]
+            for dtype in [self.w_float16dtype, self.w_float32dtype, 
self.w_float64dtype]
         )
         self.dtypes_by_name = {}
         # we reverse, so the stuff with lower numbers override stuff with
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
@@ -933,6 +933,15 @@
     BoxType = interp_boxes.W_Float16Box
     format_code = "e"
 
+class Float16(BaseType, Float):
+    _attrs_ = ()
+
+    def get_element_size(self):
+        return 16
+
+    BoxType = interp_boxes.W_Float16Box
+    format_code = "e"
+
 class Float32(BaseType, Float):
     _attrs_ = ()
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to