[pypy-commit] pypy default: Add a test for cast_float_to_singlefloat. Fails so far because
arigo
noreply at buildbot.pypy.org
Wed Apr 30 15:04:06 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r71085:9761ff01220d
Date: 2014-04-30 14:38 +0200
http://bitbucket.org/pypy/pypy/changeset/9761ff01220d/
Log: Add a test for cast_float_to_singlefloat. Fails so far because the
x86 backend doesn't correctly zero out the upper 4 bytes.
diff --git a/rpython/jit/backend/test/runner_test.py b/rpython/jit/backend/test/runner_test.py
--- a/rpython/jit/backend/test/runner_test.py
+++ b/rpython/jit/backend/test/runner_test.py
@@ -4347,3 +4347,10 @@
'void')
assert foo[0] == 1789201
lltype.free(foo, flavor='raw')
+
+ def test_cast_float_to_singlefloat(self):
+ if not self.cpu.supports_singlefloats:
+ py.test.skip("requires singlefloats")
+ res = self.execute_operation(rop.CAST_FLOAT_TO_SINGLEFLOAT,
+ [BoxFloat(12.5)], 'int')
+ assert res.getint() == struct.unpack("I", struct.pack("f", 12.5))[0]
More information about the pypy-commit
mailing list