Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r93433:4d0d6cd1346b
Date: 2017-12-16 02:18 +0000
http://bitbucket.org/pypy/pypy/changeset/4d0d6cd1346b/

Log:    hg merge default

diff --git a/pypy/doc/how-to-release.rst b/pypy/doc/how-to-release.rst
--- a/pypy/doc/how-to-release.rst
+++ b/pypy/doc/how-to-release.rst
@@ -62,7 +62,7 @@
   * go to pypy/tool/release and run
     ``force-builds.py <release branch>``
     The following JIT binaries should be built, however, we need more buildbots
-    windows, linux-32, linux-64, osx64, armhf-raring, armhf-raspberrian, armel,
+    windows, linux-32, linux-64, osx64, armhf-raspberrian, armel,
     freebsd64 
 
   * wait for builds to complete, make sure there are no failures
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -36,6 +36,6 @@
 
 .. branch: win32-vcvars
 
-.. branch rdict-fast-hash
+.. branch: rdict-fast-hash
 
 Make it possible to declare that the hash function of an r_dict is fast in 
RPython.
diff --git a/pypy/module/test_lib_pypy/test_greenlet.py 
b/pypy/module/_continuation/test/test_greenlet.py
rename from pypy/module/test_lib_pypy/test_greenlet.py
rename to pypy/module/_continuation/test/test_greenlet.py
diff --git a/pypy/tool/release/force-builds.py 
b/pypy/tool/release/force-builds.py
--- a/pypy/tool/release/force-builds.py
+++ b/pypy/tool/release/force-builds.py
@@ -29,7 +29,6 @@
     'pypy-c-jit-macosx-x86-64',
     'pypy-c-jit-win-x86-32',
     'pypy-c-jit-linux-s390x',
-    'build-pypy-c-jit-linux-armhf-raring',
     'build-pypy-c-jit-linux-armhf-raspbian',
     'build-pypy-c-jit-linux-armel',
 ]
diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh
--- a/pypy/tool/release/repackage.sh
+++ b/pypy/tool/release/repackage.sh
@@ -23,7 +23,7 @@
 
 # Download latest builds from the buildmaster, rename the top
 # level directory, and repackage ready to be uploaded to bitbucket
-for plat in linux linux64 linux-armhf-raspbian linux-armhf-raring linux-armel 
osx64 s390x
+for plat in linux linux64 linux-armhf-raspbian linux-armel osx64 s390x
   do
     echo downloading package for $plat
     if wget -q --show-progress 
http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2
diff --git a/rpython/jit/metainterp/optimizeopt/optimizer.py 
b/rpython/jit/metainterp/optimizeopt/optimizer.py
--- a/rpython/jit/metainterp/optimizeopt/optimizer.py
+++ b/rpython/jit/metainterp/optimizeopt/optimizer.py
@@ -273,7 +273,6 @@
         self.jitdriver_sd = jitdriver_sd
         self.cpu = metainterp_sd.cpu
         self.interned_refs = self.cpu.ts.new_ref_dict()
-        self.interned_ints = {}
         self.resumedata_memo = resume.ResumeDataLoopMemo(metainterp_sd)
         self.pendingfields = None # set temporarily to a list, normally by
                                   # heap.py, as we're about to generate a guard
diff --git a/rpython/rlib/rmmap.py b/rpython/rlib/rmmap.py
--- a/rpython/rlib/rmmap.py
+++ b/rpython/rlib/rmmap.py
@@ -492,6 +492,7 @@
 
         self.setslice(start, data)
         self.pos = start + data_len
+        return data_len
 
     def write_byte(self, byte):
         if len(byte) != 1:
diff --git a/rpython/rlib/rstruct/standardfmttable.py 
b/rpython/rlib/rstruct/standardfmttable.py
--- a/rpython/rlib/rstruct/standardfmttable.py
+++ b/rpython/rlib/rstruct/standardfmttable.py
@@ -105,6 +105,18 @@
     _pack_string(fmtiter, string, count-1)
 
 
+def pack_halffloat(fmtiter):
+    size = 2
+    fl = fmtiter.accept_float_arg()
+    try:
+        result = ieee.pack_float(fmtiter.wbuf, fmtiter.pos,
+                                 fl, size, fmtiter.bigendian)
+    except OverflowError:
+        raise StructOverflowError("float too large for format 'e'")
+    else:
+        fmtiter.advance(size)
+        return result
+
 def make_float_packer(TYPE):
     size = rffi.sizeof(TYPE)
     def packer(fmtiter):
@@ -247,6 +259,11 @@
         end = count
     fmtiter.appendobj(data[1:end])
 
+@specialize.argtype(0)
+def unpack_halffloat(fmtiter):
+    data = fmtiter.read(2)
+    fmtiter.appendobj(ieee.unpack_float(data, fmtiter.bigendian))
+
 def make_ieee_unpacker(TYPE):
     @specialize.argtype(0)
     def unpack_ieee(fmtiter):
@@ -374,6 +391,8 @@
           'needcount' : True },
     'p':{ 'size' : 1, 'pack' : pack_pascal, 'unpack' : unpack_pascal,
           'needcount' : True },
+    'e':{ 'size' : 2, 'pack' : pack_halffloat,
+                    'unpack' : unpack_halffloat},
     'f':{ 'size' : 4, 'pack' : make_float_packer(rffi.FLOAT),
                     'unpack' : unpack_float},
     'd':{ 'size' : 8, 'pack' : make_float_packer(rffi.DOUBLE),
diff --git a/rpython/rlib/rstruct/test/test_pack.py 
b/rpython/rlib/rstruct/test/test_pack.py
--- a/rpython/rlib/rstruct/test/test_pack.py
+++ b/rpython/rlib/rstruct/test/test_pack.py
@@ -138,6 +138,19 @@
         self.check('f', 123.456)
         self.check('d', 123.456789)
 
+    def test_pack_halffloat(self):
+        if self.fmttable is nativefmttable.native_fmttable:
+            # Host Python cannot handle half floats.
+            return
+        size = 2
+        wbuf = MutableStringBuffer(size)
+        self.mypack_into('e', wbuf, 6.5e+04)
+        got = wbuf.finish()
+        if self.bigendian:
+            assert got == b'\x7b\xef'
+        else:
+            assert got == b'\xef\x7b'
+
     def test_float_overflow(self):
         if self.fmt_prefix == '@':
             # native packing, no overflow
diff --git a/rpython/rlib/rstruct/test/test_runpack.py 
b/rpython/rlib/rstruct/test/test_runpack.py
--- a/rpython/rlib/rstruct/test/test_runpack.py
+++ b/rpython/rlib/rstruct/test/test_runpack.py
@@ -78,6 +78,10 @@
         assert f != 12.34     # precision lost
         assert abs(f - 12.34) < 1E-6
 
+    def test_unpack_halffloat(self):
+        assert runpack(">e", b"\x7b\xef") == 64992.0
+        assert runpack("<e", b"\xef\x7b") == 64992.0
+
     def test_unpack_standard_little(self):
         def unpack(fmt, data):
             def fn():
diff --git a/rpython/rlib/test/test_rmmap.py b/rpython/rlib/test/test_rmmap.py
--- a/rpython/rlib/test/test_rmmap.py
+++ b/rpython/rlib/test/test_rmmap.py
@@ -258,7 +258,7 @@
         f.flush()
         def func(no):
             m = mmap.mmap(no, 6, access=mmap.ACCESS_WRITE)
-            m.write("ciao\n")
+            assert m.write("ciao\n") == 5
             m.seek(0)
             assert m.read(6) == "ciao\nr"
             m.close()
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to