Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_array.py::TestArray::()::test_array_of_floats

self = <pypy.module.pypyjit.test_pypy_c.test_array.TestArray object at 0xfffe90bbce10>

    def test_array_of_floats(self):
        try:
            from __pypy__ import jit_backend_features
            if 'singlefloats' not in jit_backend_features:
                py.test.skip("test requres singlefloats support from the JIT backend")
        except ImportError:
            pass
        def main():
            from array import array
            img = array('f', [21.5]*1000)
            i = 0
            while i < 1000:
                img[i] += 20.5
                assert img[i] == 42.0
                i += 1
            return 321
        #
        log = self.run(main, [])
        assert log.result == 321
        loop, = log.loops_by_filename(self.filepath)
        assert loop.match("""
                i10 = int_lt(i6, 1000)
                guard_true(i10, descr=...)
                i11 = int_lt(i6, i7)
                guard_true(i11, descr=...)
                i13 = getarrayitem_raw_i(i8, i6, descr=<Array. 4>)
                f14 = cast_singlefloat_to_float(i13)
                f16 = float_add(f14, 20.500000)
                i17 = cast_float_to_singlefloat(f16)
                setarrayitem_raw(i8, i6,i17, descr=<Array. 4>)
                i18 = getarrayitem_raw_i(i8, i6, descr=<Array. 4>)
                f19 = cast_singlefloat_to_float(i18)
                i21 = float_eq(f19, 42.000000)
                guard_true(i21, descr=...)
                i23 = int_add(i6, 1)
                --TICK--
                jump(..., descr=...)
>           """, ignore_ops=['guard_not_invalidated'])

pypy/module/pypyjit/test_pypy_c/test_array.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pypy/module/pypyjit/test_pypy_c/model.py:177: in match
    return matcher.match(expected_src, **kwds)
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 0xfffe90d54310>
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 = None
('operation mismatch',)
<could not determine information>

Ignore ops: ['guard_not_invalidated']
Got:
    i62 = int_lt(i56, 1000)
    guard_true(i62, descr=<Guard0xffffa6206bf0>)
    i63 = int_lt(i56, i44)
    guard_true(i63, descr=<Guard0xffffa62265f0>)

	===== HERE =====
    p66 = call_r(281473521352688, p10, i56, 0, descr=<Callr 8 rii EF=5>)
    guard_no_exception(descr=<Guard0xffffa6206c38>)
    guard_class(p66, ConstClass(W_FloatObject), descr=<Guard0xffffa6226620>)
    f68 = getfield_gc_f(p66, descr=<FieldF pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8 pure>)
    f70 = float_add(f68, 20.500000)
    p71 = force_token()
    p72 = new_with_vtable(descr=<SizeDescr 16>)
    p73 = new_with_vtable(descr=<SizeDescr 16>)
    setfield_gc(p73, f70, descr=<FieldF pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8 pure>)
    setfield_gc(p0, p71, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
    setfield_gc(p72, i56, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
    call_may_force_n(281473521462592, p10, p72, p73, descr=<Callv 0 rrr EF=7>)
    guard_not_forced(descr=<Guard0xffffa62102a0>)
    guard_no_exception(descr=<Guard0xffffa6226650>)
    i76 = getfield_gc_i(p10, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 32>)
    i78 = int_lt(i76, 0)
    guard_false(i78, descr=<Guard0xffffa62266b0>)
    i79 = int_lt(i56, i76)
    guard_true(i79, descr=<Guard0xffffa6226710>)
    p82 = call_r(281473521352688, p10, i56, 0, descr=<Callr 8 rii EF=5>)
    guard_no_exception(descr=<Guard0xffffa6206c80>)
    guard_class(p82, ConstClass(W_FloatObject), descr=<Guard0xffffa6226740>)
    f84 = getfield_gc_f(p82, descr=<FieldF pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8 pure>)
    i86 = float_eq(f84, 42.000000)
    guard_true(i86, descr=<Guard0xffffa62267a0>)
    i88 = int_add(i56, 1)
    guard_not_invalidated(descr=<Guard0xffffa62267d0>)
    i90 = getfield_raw_i(281473555166760, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i92 = int_lt(i90, 0)
    guard_false(i92, descr=<Guard0xffffa6226830>)
    jump(p0, p1, p8, p10, i88, i76, descr=TargetToken(281473468875360))

Expected:
    
    i10 = int_lt(i6, 1000)
    guard_true(i10, descr=...)
    i11 = int_lt(i6, i7)
    guard_true(i11, descr=...)
    i13 = getarrayitem_raw_i(i8, i6, descr=<Array. 4>)
    f14 = cast_singlefloat_to_float(i13)
    f16 = float_add(f14, 20.500000)
    i17 = cast_float_to_singlefloat(f16)
    setarrayitem_raw(i8, i6,i17, descr=<Array. 4>)
    i18 = getarrayitem_raw_i(i8, i6, descr=<Array. 4>)
    f19 = cast_singlefloat_to_float(i18)
    i21 = float_eq(f19, 42.000000)
    guard_true(i21, descr=...)
    i23 = int_add(i6, 1)
    
    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=...)
    
    jump(..., descr=...)
builder: pypy-c-jit-linux-aarch64 build #2943+
test: pypy/module/pypyjit/test_pypy_c/test_array.py::TestArray::()::test_array_of_floats