9 /* Simulate a language specific stack */
12 /* Top, or base of the stack */
20 /* Usually a trampoline is created before the code that uses it, but
21 * for testing purposes it is not required.
22 * In this test case, it would mean "main" would be converted in a
23 * different jit_state_t to native code, before xfibs was know.
27 /* return address is in %r0 */
28 /* argument and return value in %v0 */
32 subi %v1 %v0 1 /* V1 = N-1 */
33 subi %v2 %v0 2 /* V1 = N-2 */
35 /* save return address */
37 stxi $(SIZE * 0) %r1 %r0
39 stxi $(SIZE * 1) %r1 %v0
40 stxi $(SIZE * 2) %r1 %v1
41 stxi $(SIZE * 3) %r1 %v2
42 /* adjust "language" stack */
43 addi %r1 %r1 $(SIZE * 4)
53 movr %v1 %v0 /* V1 = rfibs(N-1) */
56 stxi $(-SIZE * 2) %r1 %v1
59 ldxi %v2 %r1 $(-SIZE * 1)
68 movr %v2 %v0 /* V2 = rfibs(N-2) */
70 /* reload return address */
72 subi %r1 %r1 $(SIZE * 4)
73 ldxi %r0 %r1 $(SIZE * 0)
75 ldxi %v0 %r1 $(SIZE * 1)
76 ldxi %v1 %r1 $(SIZE * 2)
77 /* V2 already loaded */
78 /* update "language" stack */
94 /* Initialize language stack */