Mercurial > pub > dyncall > dyncall
comparison dyncall/dyncall_call_mips_o32.S @ 321:72b450cc3be8
- cosmetics/cleanup
author | Tassilo Philipp |
---|---|
date | Sat, 16 Nov 2019 00:14:47 +0100 |
parents | d55f9d508074 |
children |
comparison
equal
deleted
inserted
replaced
320:85c80b0c021c | 321:72b450cc3be8 |
---|---|
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
23 | 23 |
24 */ | 24 */ |
25 /* $4 target function */ | 25 /* $4 target function */ |
26 /* $5 register data */ | 26 /* $5 register data */ |
27 /* $6 stack size (min 16-byte aligned to 8-bytes already) */ | 27 /* $6 stack size (guaranteed to be >= 16b and multiple of 8b) */ |
28 /* $7 stack data */ | 28 /* $7 stack data */ |
29 | 29 |
30 | 30 |
31 | 31 |
32 .section .mdebug.abi32 | 32 .section .mdebug.abi32 |
41 .frame $fp,40,$31 /* vars=8, regs=2/0, args=16, gp=8 */ | 41 .frame $fp,40,$31 /* vars=8, regs=2/0, args=16, gp=8 */ |
42 .mask 0xc0000000,-4 | 42 .mask 0xc0000000,-4 |
43 .fmask 0x00000000,0 | 43 .fmask 0x00000000,0 |
44 .set noreorder | 44 .set noreorder |
45 | 45 |
46 addiu $sp,$sp,-8 | 46 addiu $sp, $sp, -8 |
47 sw $31,4($sp) /* save link register */ | 47 sw $31, 4($sp) /* save link register */ |
48 sw $fp,0($sp) /* save frame pointer */ | 48 sw $fp, 0($sp) /* save frame pointer */ |
49 nop | 49 nop |
50 move $fp,$sp /* frame pointer = sp */ | 50 move $fp, $sp /* frame pointer = sp */ |
51 sub $sp, $sp, $6 /* increment stack */ | 51 sub $sp, $sp, $6 /* increment stack */ |
52 | 52 |
53 /* copy stack data */ | 53 /* copy stack data */ |
54 | 54 |
55 /* $12 source pointer (parameter stack data) */ | 55 /* $12 source pointer (parameter stack data) */ |
56 /* $14 destination (stack pointer) */ | 56 /* $14 destination (stack pointer) */ |
57 /* $6 byte count */ | 57 /* $6 byte count */ |
58 | 58 |
59 move $12, $7 | 59 move $12, $7 |
60 move $14, $sp | 60 move $14, $sp |
61 | 61 |
62 .next: | 62 .next: |
63 beq $6, $0, .skip | 63 beq $6, $0, .skip |
64 nop | 64 nop |
65 lw $2, 0($12) | 65 lw $2, 0($12) |
66 nop | 66 nop |
67 sw $2, 0($14) | 67 sw $2, 0($14) |
68 addiu $12,$12, 4 | 68 addiu $12, $12, 4 |
69 addiu $14,$14, 4 | 69 addiu $14, $14, 4 |
70 addiu $6, $6, -4 | 70 addiu $6, $6, -4 |
71 j .next | 71 j .next |
72 nop | 72 nop |
73 .skip: | 73 .skip: |
74 | 74 |
75 #if defined(DC__ABI_HARDFLOAT) | 75 #if defined(DC__ABI_HARDFLOAT) |
79 l.d $f14, 8($5) | 79 l.d $f14, 8($5) |
80 #endif | 80 #endif |
81 | 81 |
82 /* prepare call */ | 82 /* prepare call */ |
83 | 83 |
84 move $12, $7 /* $12 stack data */ | 84 move $12, $7 /* $12 stack data */ |
85 move $25, $4 /* $25 target function */ | 85 move $25, $4 /* $25 target function */ |
86 | 86 |
87 /* load first four integer arguments ($4-$7) */ | 87 /* load first four integer arguments ($4-$7) */ |
88 | 88 |
89 lw $4, 0($12) | 89 lw $4, 0($12) |
90 lw $5, 4($12) | 90 lw $5, 4($12) |
91 lw $6, 8($12) | 91 lw $6, 8($12) |
92 lw $7,12($12) | 92 lw $7, 12($12) |
93 | 93 |
94 /* call target function */ | 94 /* call target function */ |
95 | 95 |
96 jalr $25 | 96 jalr $25 |
97 nop | 97 nop |
98 move $sp,$fp /* restore stack pointer */ | 98 move $sp, $fp /* restore stack pointer */ |
99 nop | 99 nop |
100 lw $31,4($sp) /* restore return address */ | 100 lw $31, 4($sp) /* restore return address */ |
101 lw $fp,0($sp) /* restore frame pointer */ | 101 lw $fp, 0($sp) /* restore frame pointer */ |
102 addiu $sp,$sp,8 /* end stack frame */ | 102 addiu $sp, $sp, 8 /* end stack frame */ |
103 j $31 /* return */ | 103 j $31 /* return */ |
104 nop | 104 nop |
105 | 105 |
106 .set reorder | 106 .set reorder |
107 .end dcCall_mips_o32 | 107 .end dcCall_mips_o32 |
108 .ident "handwritten" | 108 .ident "handwritten" |