Mercurial > pub > dyncall > dyncall
comparison dyncall/dyncall_call_sparc.S @ 154:3729a99ef03c
- cleanup/cosmetics/typos
author | cslag |
---|---|
date | Thu, 10 Nov 2016 20:37:21 +0100 |
parents | 3e629dc19168 |
children | b11b0735b09f |
comparison
equal
deleted
inserted
replaced
153:3e67a1212cb0 | 154:3729a99ef03c |
---|---|
146 /*o0-2:target,size,data*/ | 146 /*o0-2:target,size,data*/ |
147 | 147 |
148 /*leaf functions: may use the first six output registers.*/ | 148 /*leaf functions: may use the first six output registers.*/ |
149 /*o3-5:free to use */ | 149 /*o3-5:free to use */ |
150 | 150 |
151 /* Compute a matiching stack size (approximate): o3 = align(92+o1,16) */ | 151 /* Compute a matching stack size (approximate): o3 = align(92+o1,16) */ |
152 | 152 |
153 add %o1, (16+1+6)*REGSIZE+ALIGN-1, %o3 | 153 add %o1, (16+1+6)*REGSIZE+ALIGN-1, %o3 |
154 and %o3, -ALIGN, %o3 | 154 and %o3, -ALIGN, %o3 |
155 neg %o3 | 155 neg %o3 |
156 | 156 |
165 ld [%i2+REGSIZE*3 ],%o3 | 165 ld [%i2+REGSIZE*3 ],%o3 |
166 ld [%i2+REGSIZE*4 ],%o4 | 166 ld [%i2+REGSIZE*4 ],%o4 |
167 ld [%i2+REGSIZE*5 ],%o5 | 167 ld [%i2+REGSIZE*5 ],%o5 |
168 | 168 |
169 /* Copy on stack? */ | 169 /* Copy on stack? */ |
170 sub %i1, REGSIZE*6, %i1 /* i1 = decrement copy size by 6 regs (=6 regs x 4 bytes = 24 bytes total). */ | 170 sub %i1, REGSIZE*6, %i1 /* i1 = decrement copy size by 6 regs (=6 regs x 4 bytes = 24 bytes total). */ |
171 cmp %i1, 0 | 171 cmp %i1, 0 |
172 ble .do_call | 172 ble .do_call |
173 nop | 173 nop |
174 | 174 |
175 /* Copy loop: */ | 175 /* Copy loop: */ |
176 add %i2, REGSIZE*6, %i2 /* i2 = address of 7th word of args buffer. */ | 176 add %i2, REGSIZE*6, %i2 /* i2 = address of 7th word of args buffer. */ |
177 or %g0, %g0, %l0 /* l0 = offset initialized to 0. */ | 177 or %g0, %g0, %l0 /* l0 = offset initialized to 0. */ |
178 add %sp, (16+1+6)*REGSIZE, %l2 /* l2 = argument area on stack space (7th word). (64+4+6*4 = byte offset 92). */ | 178 add %sp, (16+1+6)*REGSIZE, %l2 /* l2 = argument area on stack space (7th word). (64+4+6*4 = byte offset 92). */ |
179 .next: | 179 .next: |
180 ld [%i2+%l0],%l1 /* Read from arg buffer(%i2) to %l1. */ | 180 ld [%i2+%l0],%l1 /* Read from arg buffer(%i2) to %l1. */ |
181 st %l1, [%l2+%l0] /* Write %l1 to stack space(%l2). */ | 181 st %l1, [%l2+%l0] /* Write %l1 to stack space(%l2). */ |
182 add %l0, REGSIZE, %l0 /* Increment offset. */ | 182 add %l0, REGSIZE, %l0 /* Increment offset. */ |
183 sub %i1, REGSIZE, %i1 /* Decrement copy size. */ | 183 sub %i1, REGSIZE, %i1 /* Decrement copy size. */ |
185 bgt .next | 185 bgt .next |
186 nop | 186 nop |
187 .do_call: | 187 .do_call: |
188 call %i0 /* Call target. */ | 188 call %i0 /* Call target. */ |
189 nop | 189 nop |
190 or %o0, %g0, %i0 | 190 or %o0, %g0, %i0 |
191 or %o1, %g0, %i1 | 191 or %o1, %g0, %i1 |
192 jmpl %i7 + 8, %g0 | 192 jmpl %i7 + 8, %g0 |
193 restore | 193 restore |