1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-29 18:27:37 +01:00

Rewrite it.

(Logical change 1.55)
This commit is contained in:
hp.com!davidm 2003-02-26 08:33:57 +00:00
parent 818d0241f2
commit ea8a74ba29

View file

@ -1,109 +1,38 @@
#define TEMPLATE(name, code...) \ .globl func_add1, func_add1_end
.globl name##_start, name##_end; \ .proc func_add1
name##_start:; \ func_add1:
code;; \ {.mib add r8 = 1, r32
name##_end: nop.i 0
br.ret.sptk.many rp
}
func_add1_end:
.endp func_add1
.sdata .globl func_add3, func_add3_end
global_value: data8 0 .proc func_add3
func_add3:
.text {.mmi alloc loc1 = ar.pfs, 2, 2, 2, 0
ld8 r8 = [in1], 8 // load the function pointer
TEMPLATE(get_r4, mov r31 = r4) mov loc0 = rp
TEMPLATE(get_r5, mov r31 = r5) } ;;
TEMPLATE(get_r6, mov r31 = r6) {.mmi
TEMPLATE(get_r7, mov r31 = r7) ld8 r9 = [r8], 8 // load the entry-point
TEMPLATE(get_r30, mov r31 = r30) mov out0 = in0
TEMPLATE(get_bsp, mov r31 = ar.bsp) mov out1 = in1
TEMPLATE(get_bspstore, \ } ;;
mov r30 = ar.rsc;; mov ar.rsc = 0;; \ {.mib ld8 gp = [r8] // load the gp
mov r31 = ar.bspstore;; mov ar.rsc = r30) mov b6 = r9
TEMPLATE(get_pfs, mov r31 = ar.pfs) br.call.sptk rp = b6
TEMPLATE(get_rnat, mov r31 = ar.rnat) }
TEMPLATE(get_unat, mov r31 = ar.unat) {.mii
TEMPLATE(get_fpsr, mov r31 = ar.fpsr) add r8 = 2, r8
TEMPLATE(get_lc, mov r31 = ar.lc) mov ar.pfs = loc1
TEMPLATE(get_pr, mov r31 = pr) mov rp = loc0
TEMPLATE(get_rp, mov r31 = b0) }
TEMPLATE(get_b1, mov r31 = b1) {.mib
TEMPLATE(get_b2, mov r31 = b2) mov loc0 = 1 // trash loc0
TEMPLATE(get_b3, mov r31 = b3) mov loc1 = 3 // trash loc1
TEMPLATE(get_b4, mov r31 = b4) br.ret.sptk.many rp
TEMPLATE(get_b5, mov r31 = b5) }
TEMPLATE(get_f2, mov f127 = f2) func_add3_end:
TEMPLATE(get_f3, mov f127 = f3) .endp func_add3
TEMPLATE(get_f4, mov f127 = f4)
TEMPLATE(get_f5, mov f127 = f5)
TEMPLATE(get_f16, mov f127 = f16)
TEMPLATE(get_f17, mov f127 = f17)
TEMPLATE(get_f18, mov f127 = f18)
TEMPLATE(get_f19, mov f127 = f19)
TEMPLATE(get_f20, mov f127 = f20)
TEMPLATE(get_f21, mov f127 = f21)
TEMPLATE(get_f22, mov f127 = f22)
TEMPLATE(get_f23, mov f127 = f23)
TEMPLATE(get_f24, mov f127 = f24)
TEMPLATE(get_f25, mov f127 = f25)
TEMPLATE(get_f26, mov f127 = f26)
TEMPLATE(get_f27, mov f127 = f27)
TEMPLATE(get_f28, mov f127 = f28)
TEMPLATE(get_f29, mov f127 = f29)
TEMPLATE(get_f30, mov f127 = f30)
TEMPLATE(get_f31, mov f127 = f31)
TEMPLATE(put_r1, mov r1 = r31)
TEMPLATE(put_r4, mov r4 = r31)
TEMPLATE(put_r5, mov r5 = r31)
TEMPLATE(put_r6, mov r6 = r31)
TEMPLATE(put_r7, mov r7 = r31)
TEMPLATE(put_bsp, mov ar.bsp = r31)
TEMPLATE(put_bspstore, \
mov r30 = ar.rsc;; mov ar.rsc = 0;; \
mov ar.bspstore = r31;; mov ar.rsc = r30)
TEMPLATE(put_pfs, mov ar.pfs = r31)
TEMPLATE(put_rnat, mov ar.rnat = r31)
TEMPLATE(put_unat, mov ar.unat = r31)
TEMPLATE(put_fpsr, mov ar.fpsr = r31)
TEMPLATE(put_lc, mov ar.lc = r31)
TEMPLATE(put_pr, mov pr = r31, -1)
TEMPLATE(put_rp, mov b0 = r31)
TEMPLATE(put_b1, mov b1 = r31)
TEMPLATE(put_b2, mov b2 = r31)
TEMPLATE(put_b3, mov b3 = r31)
TEMPLATE(put_b4, mov b4 = r31)
TEMPLATE(put_b5, mov b5 = r31)
TEMPLATE(put_f2, mov f2 = f127)
TEMPLATE(put_f3, mov f3 = f127)
TEMPLATE(put_f4, mov f4 = f127)
TEMPLATE(put_f5, mov f5 = f127)
TEMPLATE(put_f16, mov f16 = f127)
TEMPLATE(put_f17, mov f17 = f127)
TEMPLATE(put_f18, mov f18 = f127)
TEMPLATE(put_f19, mov f19 = f127)
TEMPLATE(put_f20, mov f20 = f127)
TEMPLATE(put_f21, mov f21 = f127)
TEMPLATE(put_f22, mov f22 = f127)
TEMPLATE(put_f23, mov f23 = f127)
TEMPLATE(put_f24, mov f24 = f127)
TEMPLATE(put_f25, mov f25 = f127)
TEMPLATE(put_f26, mov f26 = f127)
TEMPLATE(put_f27, mov f27 = f127)
TEMPLATE(put_f28, mov f28 = f127)
TEMPLATE(put_f29, mov f29 = f127)
TEMPLATE(put_f30, mov f30 = f127)
TEMPLATE(put_f31, mov f31 = f127)
TEMPLATE(load_imm, movl r31 = 0)
TEMPLATE(store_sprel, add r2 = r30, sp;; st8 [r2] = r31)
TEMPLATE(load_sprel, add r2 = r30, sp;; ld8 r31 = [r2])
TEMPLATE(spill_sprel, add r2 = r30, sp;; st8.spill [r2] = r31)
TEMPLATE(fill_sprel, add r2 = r30, sp;; ld8.fill r31 = [r2])
TEMPLATE(add_sp, add r12 = r30, r12)
TEMPLATE(call, mov b6 = r30;; br.call.sptk.many rp = b6)
TEMPLATE(ret, br.ret.sptk.many rp)
TEMPLATE(alloc_8_8_8_0, alloc r31 = ar.pfs, 8, 8, 8, 0)
TEMPLATE(alloc_8_8_8_8, alloc r31 = ar.pfs, 8, 8, 8, 8)
TEMPLATE(rot, br.wtop.sptk.few 1f; 1:)