pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_float_instance_field_read
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000001074e0c8>
def test_float_instance_field_read(self):
def main():
class A(object):
def __init__(self, x, y):
self.x = float(x)
self.y = float(y)
l = [A(i, i * 5) for i in range(2000)]
res = 0
for x in l:
res += x.x + x.y # ID: get
return res
log = self.run(main, [])
listcomp, loop, = log.loops_by_filename(self.filepath)
if sys.maxint == 2**63 - 1:
> loop.match_by_id('get', """
p67 = getfield_gc_r(p63, descr=...) # map
guard_value(p67, ConstPtr(ptr68), descr=...) # promote map
guard_not_invalidated(descr=...)
p69 = getfield_gc_r(p63, descr=...) # value0
i71 = getarrayitem_gc_i(p69, 0, descr=...) # x
f71 = convert_longlong_bytes_to_float(i71)
i73 = getarrayitem_gc_i(p69, 1, descr=...) # y
f73 = convert_longlong_bytes_to_float(i73)
f74 = float_add(f71, f73) # add them
f75 = float_add(f57, f74)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x000000000fed19f0>
cond = False, message = 'operation mismatch'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: operation mismatch
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
---------- Captured stdout call ----------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'get'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
p60 = getfield_gc_r(p56, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst_map 48>)
guard_value(p60, ConstPtr(ptr61), descr=<Guard0x7f5e56fb8e58>)
===== HERE =====
p62 = getfield_gc_r(p56, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value0 8>)
i64 = getarrayitem_gc_i(p62, 0, descr=<ArrayS 8>)
f65 = convert_longlong_bytes_to_float(i64)
i67 = getarrayitem_gc_i(p62, 1, descr=<ArrayS 8>)
f68 = convert_longlong_bytes_to_float(i67)
f69 = float_add(f65, f68)
f70 = float_add(f50, f69)
i72 = getfield_raw_i(140043224418976, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i74 = int_lt(i72, 0)
guard_false(i74, descr=<Guard0x7f5e56fb8ec8>)
Expected:
p67 = getfield_gc_r(p63, descr=...) # map
guard_value(p67, ConstPtr(ptr68), descr=...) # promote map
guard_not_invalidated(descr=...)
p69 = getfield_gc_r(p63, descr=...) # value0
i71 = getarrayitem_gc_i(p69, 0, descr=...) # x
f71 = convert_longlong_bytes_to_float(i71)
i73 = getarrayitem_gc_i(p69, 1, descr=...) # y
f73 = convert_longlong_bytes_to_float(i73)
f74 = float_add(f71, f73) # add them
f75 = float_add(f57, f74)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
builder: pypy-c-jit-linux-x86-64 build #11971+
test: pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_float_instance_field_read