blob: bc69852e6a74cc2606007b727ed59d216c30997b [file] [log] [blame]
hp.com!davidmea8a74b2003-02-26 08:33:57 +00001 .globl func_add1, func_add1_end
2 .proc func_add1
3func_add1:
mostang.com!davidm16192f72003-03-27 04:29:07 +00004{.mib; add r8 = 1, r32
hp.com!davidmea8a74b2003-02-26 08:33:57 +00005 nop.i 0
6 br.ret.sptk.many rp
7}
8func_add1_end:
9 .endp func_add1
mostang.com!davidm34340902003-02-22 08:19:43 +000010
hp.com!davidmea8a74b2003-02-26 08:33:57 +000011 .globl func_add3, func_add3_end
12 .proc func_add3
13func_add3:
mostang.com!davidm16192f72003-03-27 04:29:07 +000014{.mmi; alloc loc0 = ar.pfs, 2, 1, 2, 0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000015 mov r2 = sp
16 add sp = -16, sp
17} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000018{.mii; ld8 r8 = [in1], 8 // load the function pointer
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000019 mov r3 = rp
20 mov rp = loc0 // trash rp
hp.com!davidmea8a74b2003-02-26 08:33:57 +000021} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000022{.mmi; ld8 r9 = [r8], 8 // load the entry-point
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000023 st8 [r2] = r3
hp.com!davidmea8a74b2003-02-26 08:33:57 +000024 mov out0 = in0
hp.com!davidmea8a74b2003-02-26 08:33:57 +000025} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000026{.mii; ld8 gp = [r8] // load the gp
hp.com!davidmea8a74b2003-02-26 08:33:57 +000027 mov b6 = r9
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000028 mov out1 = in1
hp.com!davidmea8a74b2003-02-26 08:33:57 +000029}
mostang.com!davidm16192f72003-03-27 04:29:07 +000030{.mib; nop 0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000031 nop 0
32 br.call.sptk rp = b6
33}
mostang.com!davidm16192f72003-03-27 04:29:07 +000034{.mmi; add r2 = 16, sp
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000035 ;;
36 ld8 r3 = [r2] // r3 = saved rp
37 mov ar.pfs = loc0
38} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000039{.mii; nop 0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000040 mov rp = r3
41 adds sp = 16, sp
42} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000043{.mib; st8 [sp] = in0 // trash rp save location
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000044 add r8 = 2, r8
hp.com!davidmea8a74b2003-02-26 08:33:57 +000045 br.ret.sptk.many rp
46}
47func_add3_end:
48 .endp func_add3
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000049
50 .globl func_vframe, func_vframe_end
51 .proc func_vframe
52func_vframe:
mostang.com!davidm16192f72003-03-27 04:29:07 +000053{.mii; alloc r16 = ar.pfs, 1, 2, 0, 0 // 0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000054 mov loc0 = rp
55 mov loc1 = sp
56} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000057{.mmi; sub sp = sp, in0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000058 st8 [loc1] = r16
59 mov r2 = -99 // 0
60} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000061{.mii; nop 0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000062 mov rp = r2
63 mov ar.pfs = r0
64}
mostang.com!davidm16192f72003-03-27 04:29:07 +000065{.mib; mov r16 = r2
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000066 tbit.nz p6, p0 = in0, 4
mostang.com!davidm16192f72003-03-27 04:29:07 +000067(p6) br.cond.sptk.many .exit
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000068} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000069{.mmi; ld8 r16 = [loc1]
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000070 ;;
71 mov r3 = loc0 // 8 move saved rp to r3
72 mov ar.pfs = r16
73} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000074{.mmi; mov sp = loc1 // 10
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000075 st8 [loc1] = r0 // trash saved pfs
76 mov loc0 = r2
77} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000078{.mib; mov r8 = 10
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000079 mov rp = r3
80 br.ret.sptk.many rp
81}
mostang.com!davidm16192f72003-03-27 04:29:07 +000082.exit:
83{.mmi; ld8 r16 = [loc1]
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000084 ;;
85 sub sp = 32, sp
86 mov ar.pfs = r16
87} ;;
mostang.com!davidm16192f72003-03-27 04:29:07 +000088{.mmi; mov sp = loc1
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000089 st8 [loc1] = r0 // trash saved pfs
90 mov rp = loc0
91}
mostang.com!davidm16192f72003-03-27 04:29:07 +000092{.mib; nop 0
mostang.com!davidm0d7396a2003-02-27 09:58:57 +000093 mov r8 = 4
94 br.ret.sptk.many rp
95}
96func_vframe_end:
97 .endp func_vframe