Debian Codegraph @

rpython/jit/backend/riscv/test/test_runner.py

raw symbols SCIP
1 #!/usr/bin/env python
2
3 from rpython.jit.backend.detect_cpu import getcpuclass
4 from rpython.jit.backend.test.runner_test import LLtypeBackendTest
5
6 CPU = getcpuclass()
7
8
9 class FakeStats(object):
10 pass
11
12
13 class TestRISCV(LLtypeBackendTest):
14 # for the individual tests see
15 # ====> ../../test/runner_test.py
16
17 def get_cpu(self):
18 cpu = CPU(rtyper=None, stats=FakeStats())
19 cpu.setup_once()
20 return cpu
21
22 # `test_compile_asmlen` expected outputs
23 add_loop_instructions = (
24 'ld; ' # same_as
25 + 'add; ' # int_add
26 + 'bnez; j; ' # guard_true
27 + 'j; ' # jump
28 + 'ebreak;')
29 bridge_loop_instructions = (
30 # Load the current frame depth
31 'ld; '
32 # Load the expected frame depth
33 + 'li; (nop; )*'
34 # Compare current to expected frame depth
35 + 'bge; '
36 # Store gcmap to jf_gcmap
37 + '(((auipc; )*ld; )|((lui; )*addiw*; ))'
38 + 'sd; '
39 # Branch to frame_realloc_slowpath
40 + '(((auipc; )*ld; )|((lui; )*addiw*; ))'
41 + 'jalr; '
42 # Jump to a target token
43 + '(((auipc; )*ld; )|((lui; )*addiw*; ))'
44 + 'jr; '
45 + 'ebreak;')