hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 1 | .globl func_add1, func_add1_end |
| 2 | .proc func_add1 |
| 3 | func_add1: |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 4 | {.mib; add r8 = 1, r32 |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 5 | nop.i 0 |
| 6 | br.ret.sptk.many rp |
| 7 | } |
| 8 | func_add1_end: |
| 9 | .endp func_add1 |
mostang.com!davidm | 3434090 | 2003-02-22 08:19:43 +0000 | [diff] [blame] | 10 | |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 11 | .globl func_add3, func_add3_end |
| 12 | .proc func_add3 |
| 13 | func_add3: |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 14 | {.mmi; alloc loc0 = ar.pfs, 2, 1, 2, 0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 15 | mov r2 = sp |
| 16 | add sp = -16, sp |
| 17 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 18 | {.mii; ld8 r8 = [in1], 8 // load the function pointer |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 19 | mov r3 = rp |
| 20 | mov rp = loc0 // trash rp |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 21 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 22 | {.mmi; ld8 r9 = [r8], 8 // load the entry-point |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 23 | st8 [r2] = r3 |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 24 | mov out0 = in0 |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 25 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 26 | {.mii; ld8 gp = [r8] // load the gp |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 27 | mov b6 = r9 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 28 | mov out1 = in1 |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 29 | } |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 30 | {.mib; nop 0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 31 | nop 0 |
| 32 | br.call.sptk rp = b6 |
| 33 | } |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 34 | {.mmi; add r2 = 16, sp |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 35 | ;; |
| 36 | ld8 r3 = [r2] // r3 = saved rp |
| 37 | mov ar.pfs = loc0 |
| 38 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 39 | {.mii; nop 0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 40 | mov rp = r3 |
| 41 | adds sp = 16, sp |
| 42 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 43 | {.mib; st8 [sp] = in0 // trash rp save location |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 44 | add r8 = 2, r8 |
hp.com!davidm | ea8a74b | 2003-02-26 08:33:57 +0000 | [diff] [blame] | 45 | br.ret.sptk.many rp |
| 46 | } |
| 47 | func_add3_end: |
| 48 | .endp func_add3 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 49 | |
| 50 | .globl func_vframe, func_vframe_end |
| 51 | .proc func_vframe |
| 52 | func_vframe: |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 53 | {.mii; alloc r16 = ar.pfs, 1, 2, 0, 0 // 0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 54 | mov loc0 = rp |
| 55 | mov loc1 = sp |
| 56 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 57 | {.mmi; sub sp = sp, in0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 58 | st8 [loc1] = r16 |
| 59 | mov r2 = -99 // 0 |
| 60 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 61 | {.mii; nop 0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 62 | mov rp = r2 |
| 63 | mov ar.pfs = r0 |
| 64 | } |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 65 | {.mib; mov r16 = r2 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 66 | tbit.nz p6, p0 = in0, 4 |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 67 | (p6) br.cond.sptk.many .exit |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 68 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 69 | {.mmi; ld8 r16 = [loc1] |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 70 | ;; |
| 71 | mov r3 = loc0 // 8 move saved rp to r3 |
| 72 | mov ar.pfs = r16 |
| 73 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 74 | {.mmi; mov sp = loc1 // 10 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 75 | st8 [loc1] = r0 // trash saved pfs |
| 76 | mov loc0 = r2 |
| 77 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 78 | {.mib; mov r8 = 10 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 79 | mov rp = r3 |
| 80 | br.ret.sptk.many rp |
| 81 | } |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 82 | .exit: |
| 83 | {.mmi; ld8 r16 = [loc1] |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 84 | ;; |
| 85 | sub sp = 32, sp |
| 86 | mov ar.pfs = r16 |
| 87 | } ;; |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 88 | {.mmi; mov sp = loc1 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 89 | st8 [loc1] = r0 // trash saved pfs |
| 90 | mov rp = loc0 |
| 91 | } |
mostang.com!davidm | 16192f7 | 2003-03-27 04:29:07 +0000 | [diff] [blame] | 92 | {.mib; nop 0 |
mostang.com!davidm | 0d7396a | 2003-02-27 09:58:57 +0000 | [diff] [blame] | 93 | mov r8 = 4 |
| 94 | br.ret.sptk.many rp |
| 95 | } |
| 96 | func_vframe_end: |
| 97 | .endp func_vframe |