annotate libffi/src/tile/tile.S @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* -----------------------------------------------------------------------
kono
parents:
diff changeset
2 tile.S - Copyright (c) 2011 Tilera Corp.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 Tilera TILEPro and TILE-Gx Foreign Function Interface
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 Permission is hereby granted, free of charge, to any person obtaining
kono
parents:
diff changeset
7 a copy of this software and associated documentation files (the
kono
parents:
diff changeset
8 ``Software''), to deal in the Software without restriction, including
kono
parents:
diff changeset
9 without limitation the rights to use, copy, modify, merge, publish,
kono
parents:
diff changeset
10 distribute, sublicense, and/or sell copies of the Software, and to
kono
parents:
diff changeset
11 permit persons to whom the Software is furnished to do so, subject to
kono
parents:
diff changeset
12 the following conditions:
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 The above copyright notice and this permission notice shall be included
kono
parents:
diff changeset
15 in all copies or substantial portions of the Software.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
kono
parents:
diff changeset
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
kono
parents:
diff changeset
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
kono
parents:
diff changeset
20 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
kono
parents:
diff changeset
21 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
kono
parents:
diff changeset
22 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
kono
parents:
diff changeset
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
kono
parents:
diff changeset
24 DEALINGS IN THE SOFTWARE.
kono
parents:
diff changeset
25 ----------------------------------------------------------------------- */
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 #define LIBFFI_ASM
kono
parents:
diff changeset
28 #include <fficonfig.h>
kono
parents:
diff changeset
29 #include <ffi.h>
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 /* Number of bytes in a register. */
kono
parents:
diff changeset
32 #define REG_SIZE FFI_SIZEOF_ARG
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* Number of bytes in stack linkage area for backtracing.
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 A note about the ABI: on entry to a procedure, sp points to a stack
kono
parents:
diff changeset
37 slot where it must spill the return address if it's not a leaf.
kono
parents:
diff changeset
38 REG_SIZE bytes beyond that is a slot owned by the caller which
kono
parents:
diff changeset
39 contains the sp value that the caller had when it was originally
kono
parents:
diff changeset
40 entered (i.e. the caller's frame pointer). */
kono
parents:
diff changeset
41 #define LINKAGE_SIZE (2 * REG_SIZE)
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 /* The first 10 registers are used to pass arguments and return values. */
kono
parents:
diff changeset
44 #define NUM_ARG_REGS 10
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 #ifdef __tilegx__
kono
parents:
diff changeset
47 #define SW st
kono
parents:
diff changeset
48 #define LW ld
kono
parents:
diff changeset
49 #define BGZT bgtzt
kono
parents:
diff changeset
50 #else
kono
parents:
diff changeset
51 #define SW sw
kono
parents:
diff changeset
52 #define LW lw
kono
parents:
diff changeset
53 #define BGZT bgzt
kono
parents:
diff changeset
54 #endif
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 /* void ffi_call_tile (int_reg_t reg_args[NUM_ARG_REGS],
kono
parents:
diff changeset
58 const int_reg_t *stack_args,
kono
parents:
diff changeset
59 unsigned long stack_args_bytes,
kono
parents:
diff changeset
60 void (*fnaddr)(void));
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 On entry, REG_ARGS contain the outgoing register values,
kono
parents:
diff changeset
63 and STACK_ARGS contains STACK_ARG_BYTES of additional values
kono
parents:
diff changeset
64 to be passed on the stack. If STACK_ARG_BYTES is zero, then
kono
parents:
diff changeset
65 STACK_ARGS is ignored.
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 When the invoked function returns, the values of r0-r9 are
kono
parents:
diff changeset
68 blindly stored back into REG_ARGS for the caller to examine. */
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 .section .text.ffi_call_tile, "ax", @progbits
kono
parents:
diff changeset
71 .align 8
kono
parents:
diff changeset
72 .globl ffi_call_tile
kono
parents:
diff changeset
73 FFI_HIDDEN(ffi_call_tile)
kono
parents:
diff changeset
74 ffi_call_tile:
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 /* Incoming arguments. */
kono
parents:
diff changeset
77 #define REG_ARGS r0
kono
parents:
diff changeset
78 #define INCOMING_STACK_ARGS r1
kono
parents:
diff changeset
79 #define STACK_ARG_BYTES r2
kono
parents:
diff changeset
80 #define ORIG_FNADDR r3
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 /* Temporary values. */
kono
parents:
diff changeset
83 #define FRAME_SIZE r10
kono
parents:
diff changeset
84 #define TMP r11
kono
parents:
diff changeset
85 #define TMP2 r12
kono
parents:
diff changeset
86 #define OUTGOING_STACK_ARGS r13
kono
parents:
diff changeset
87 #define REG_ADDR_PTR r14
kono
parents:
diff changeset
88 #define RETURN_REG_ADDR r15
kono
parents:
diff changeset
89 #define FNADDR r16
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 .cfi_startproc
kono
parents:
diff changeset
92 {
kono
parents:
diff changeset
93 /* Save return address. */
kono
parents:
diff changeset
94 SW sp, lr
kono
parents:
diff changeset
95 .cfi_offset lr, 0
kono
parents:
diff changeset
96 /* Prepare to spill incoming r52. */
kono
parents:
diff changeset
97 addi TMP, sp, -REG_SIZE
kono
parents:
diff changeset
98 /* Increase frame size to have room to spill r52 and REG_ARGS.
kono
parents:
diff changeset
99 The +7 is to round up mod 8. */
kono
parents:
diff changeset
100 addi FRAME_SIZE, STACK_ARG_BYTES, \
kono
parents:
diff changeset
101 REG_SIZE + REG_SIZE + LINKAGE_SIZE + 7
kono
parents:
diff changeset
102 }
kono
parents:
diff changeset
103 {
kono
parents:
diff changeset
104 /* Round stack frame size to a multiple of 8 to satisfy ABI. */
kono
parents:
diff changeset
105 andi FRAME_SIZE, FRAME_SIZE, -8
kono
parents:
diff changeset
106 /* Compute where to spill REG_ARGS value. */
kono
parents:
diff changeset
107 addi TMP2, sp, -(REG_SIZE * 2)
kono
parents:
diff changeset
108 }
kono
parents:
diff changeset
109 {
kono
parents:
diff changeset
110 /* Spill incoming r52. */
kono
parents:
diff changeset
111 SW TMP, r52
kono
parents:
diff changeset
112 .cfi_offset r52, -REG_SIZE
kono
parents:
diff changeset
113 /* Set up our frame pointer. */
kono
parents:
diff changeset
114 move r52, sp
kono
parents:
diff changeset
115 .cfi_def_cfa_register r52
kono
parents:
diff changeset
116 /* Push stack frame. */
kono
parents:
diff changeset
117 sub sp, sp, FRAME_SIZE
kono
parents:
diff changeset
118 }
kono
parents:
diff changeset
119 {
kono
parents:
diff changeset
120 /* Prepare to set up stack linkage. */
kono
parents:
diff changeset
121 addi TMP, sp, REG_SIZE
kono
parents:
diff changeset
122 /* Prepare to memcpy stack args. */
kono
parents:
diff changeset
123 addi OUTGOING_STACK_ARGS, sp, LINKAGE_SIZE
kono
parents:
diff changeset
124 /* Save REG_ARGS which we will need after we call the subroutine. */
kono
parents:
diff changeset
125 SW TMP2, REG_ARGS
kono
parents:
diff changeset
126 }
kono
parents:
diff changeset
127 {
kono
parents:
diff changeset
128 /* Set up linkage info to hold incoming stack pointer. */
kono
parents:
diff changeset
129 SW TMP, r52
kono
parents:
diff changeset
130 }
kono
parents:
diff changeset
131 {
kono
parents:
diff changeset
132 /* Skip stack args memcpy if we don't have any stack args (common). */
kono
parents:
diff changeset
133 blezt STACK_ARG_BYTES, .Ldone_stack_args_memcpy
kono
parents:
diff changeset
134 }
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 .Lmemcpy_stack_args:
kono
parents:
diff changeset
137 {
kono
parents:
diff changeset
138 /* Load incoming argument from stack_args. */
kono
parents:
diff changeset
139 LW TMP, INCOMING_STACK_ARGS
kono
parents:
diff changeset
140 addi INCOMING_STACK_ARGS, INCOMING_STACK_ARGS, REG_SIZE
kono
parents:
diff changeset
141 }
kono
parents:
diff changeset
142 {
kono
parents:
diff changeset
143 /* Store stack argument into outgoing stack argument area. */
kono
parents:
diff changeset
144 SW OUTGOING_STACK_ARGS, TMP
kono
parents:
diff changeset
145 addi OUTGOING_STACK_ARGS, OUTGOING_STACK_ARGS, REG_SIZE
kono
parents:
diff changeset
146 addi STACK_ARG_BYTES, STACK_ARG_BYTES, -REG_SIZE
kono
parents:
diff changeset
147 }
kono
parents:
diff changeset
148 {
kono
parents:
diff changeset
149 BGZT STACK_ARG_BYTES, .Lmemcpy_stack_args
kono
parents:
diff changeset
150 }
kono
parents:
diff changeset
151 .Ldone_stack_args_memcpy:
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 {
kono
parents:
diff changeset
154 /* Copy aside ORIG_FNADDR so we can overwrite its register. */
kono
parents:
diff changeset
155 move FNADDR, ORIG_FNADDR
kono
parents:
diff changeset
156 /* Prepare to load argument registers. */
kono
parents:
diff changeset
157 addi REG_ADDR_PTR, r0, REG_SIZE
kono
parents:
diff changeset
158 /* Load outgoing r0. */
kono
parents:
diff changeset
159 LW r0, r0
kono
parents:
diff changeset
160 }
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 /* Load up argument registers from the REG_ARGS array. */
kono
parents:
diff changeset
163 #define LOAD_REG(REG, PTR) \
kono
parents:
diff changeset
164 { \
kono
parents:
diff changeset
165 LW REG, PTR ; \
kono
parents:
diff changeset
166 addi PTR, PTR, REG_SIZE \
kono
parents:
diff changeset
167 }
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 LOAD_REG(r1, REG_ADDR_PTR)
kono
parents:
diff changeset
170 LOAD_REG(r2, REG_ADDR_PTR)
kono
parents:
diff changeset
171 LOAD_REG(r3, REG_ADDR_PTR)
kono
parents:
diff changeset
172 LOAD_REG(r4, REG_ADDR_PTR)
kono
parents:
diff changeset
173 LOAD_REG(r5, REG_ADDR_PTR)
kono
parents:
diff changeset
174 LOAD_REG(r6, REG_ADDR_PTR)
kono
parents:
diff changeset
175 LOAD_REG(r7, REG_ADDR_PTR)
kono
parents:
diff changeset
176 LOAD_REG(r8, REG_ADDR_PTR)
kono
parents:
diff changeset
177 LOAD_REG(r9, REG_ADDR_PTR)
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 {
kono
parents:
diff changeset
180 /* Call the subroutine. */
kono
parents:
diff changeset
181 jalr FNADDR
kono
parents:
diff changeset
182 }
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 {
kono
parents:
diff changeset
185 /* Restore original lr. */
kono
parents:
diff changeset
186 LW lr, r52
kono
parents:
diff changeset
187 /* Prepare to recover ARGS, which we spilled earlier. */
kono
parents:
diff changeset
188 addi TMP, r52, -(2 * REG_SIZE)
kono
parents:
diff changeset
189 }
kono
parents:
diff changeset
190 {
kono
parents:
diff changeset
191 /* Restore ARGS, so we can fill it in with the return regs r0-r9. */
kono
parents:
diff changeset
192 LW RETURN_REG_ADDR, TMP
kono
parents:
diff changeset
193 /* Prepare to restore original r52. */
kono
parents:
diff changeset
194 addi TMP, r52, -REG_SIZE
kono
parents:
diff changeset
195 }
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 {
kono
parents:
diff changeset
198 /* Pop stack frame. */
kono
parents:
diff changeset
199 move sp, r52
kono
parents:
diff changeset
200 /* Restore original r52. */
kono
parents:
diff changeset
201 LW r52, TMP
kono
parents:
diff changeset
202 }
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204 #define STORE_REG(REG, PTR) \
kono
parents:
diff changeset
205 { \
kono
parents:
diff changeset
206 SW PTR, REG ; \
kono
parents:
diff changeset
207 addi PTR, PTR, REG_SIZE \
kono
parents:
diff changeset
208 }
kono
parents:
diff changeset
209
kono
parents:
diff changeset
210 /* Return all register values by reference. */
kono
parents:
diff changeset
211 STORE_REG(r0, RETURN_REG_ADDR)
kono
parents:
diff changeset
212 STORE_REG(r1, RETURN_REG_ADDR)
kono
parents:
diff changeset
213 STORE_REG(r2, RETURN_REG_ADDR)
kono
parents:
diff changeset
214 STORE_REG(r3, RETURN_REG_ADDR)
kono
parents:
diff changeset
215 STORE_REG(r4, RETURN_REG_ADDR)
kono
parents:
diff changeset
216 STORE_REG(r5, RETURN_REG_ADDR)
kono
parents:
diff changeset
217 STORE_REG(r6, RETURN_REG_ADDR)
kono
parents:
diff changeset
218 STORE_REG(r7, RETURN_REG_ADDR)
kono
parents:
diff changeset
219 STORE_REG(r8, RETURN_REG_ADDR)
kono
parents:
diff changeset
220 STORE_REG(r9, RETURN_REG_ADDR)
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222 {
kono
parents:
diff changeset
223 jrp lr
kono
parents:
diff changeset
224 }
kono
parents:
diff changeset
225
kono
parents:
diff changeset
226 .cfi_endproc
kono
parents:
diff changeset
227 .size ffi_call_tile, .-ffi_call_tile
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 /* ffi_closure_tile(...)
kono
parents:
diff changeset
230
kono
parents:
diff changeset
231 On entry, lr points to the closure plus 8 bytes, and r10
kono
parents:
diff changeset
232 contains the actual return address.
kono
parents:
diff changeset
233
kono
parents:
diff changeset
234 This function simply dumps all register parameters into a stack array
kono
parents:
diff changeset
235 and passes the closure, the registers array, and the stack arguments
kono
parents:
diff changeset
236 to C code that does all of the actual closure processing. */
kono
parents:
diff changeset
237
kono
parents:
diff changeset
238 .section .text.ffi_closure_tile, "ax", @progbits
kono
parents:
diff changeset
239 .align 8
kono
parents:
diff changeset
240 .globl ffi_closure_tile
kono
parents:
diff changeset
241 FFI_HIDDEN(ffi_closure_tile)
kono
parents:
diff changeset
242
kono
parents:
diff changeset
243 .cfi_startproc
kono
parents:
diff changeset
244 /* Room to spill all NUM_ARG_REGS incoming registers, plus frame linkage. */
kono
parents:
diff changeset
245 #define CLOSURE_FRAME_SIZE (((NUM_ARG_REGS * REG_SIZE * 2 + LINKAGE_SIZE) + 7) & -8)
kono
parents:
diff changeset
246 ffi_closure_tile:
kono
parents:
diff changeset
247 {
kono
parents:
diff changeset
248 #ifdef __tilegx__
kono
parents:
diff changeset
249 st sp, lr
kono
parents:
diff changeset
250 .cfi_offset lr, 0
kono
parents:
diff changeset
251 #else
kono
parents:
diff changeset
252 /* Save return address (in r10 due to closure stub wrapper). */
kono
parents:
diff changeset
253 SW sp, r10
kono
parents:
diff changeset
254 .cfi_return_column r10
kono
parents:
diff changeset
255 .cfi_offset r10, 0
kono
parents:
diff changeset
256 #endif
kono
parents:
diff changeset
257 /* Compute address for stack frame linkage. */
kono
parents:
diff changeset
258 addli r10, sp, -(CLOSURE_FRAME_SIZE - REG_SIZE)
kono
parents:
diff changeset
259 }
kono
parents:
diff changeset
260 {
kono
parents:
diff changeset
261 /* Save incoming stack pointer in linkage area. */
kono
parents:
diff changeset
262 SW r10, sp
kono
parents:
diff changeset
263 .cfi_offset sp, -(CLOSURE_FRAME_SIZE - REG_SIZE)
kono
parents:
diff changeset
264 /* Push a new stack frame. */
kono
parents:
diff changeset
265 addli sp, sp, -CLOSURE_FRAME_SIZE
kono
parents:
diff changeset
266 .cfi_adjust_cfa_offset CLOSURE_FRAME_SIZE
kono
parents:
diff changeset
267 }
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 {
kono
parents:
diff changeset
270 /* Create pointer to where to start spilling registers. */
kono
parents:
diff changeset
271 addi r10, sp, LINKAGE_SIZE
kono
parents:
diff changeset
272 }
kono
parents:
diff changeset
273
kono
parents:
diff changeset
274 /* Spill all the incoming registers. */
kono
parents:
diff changeset
275 STORE_REG(r0, r10)
kono
parents:
diff changeset
276 STORE_REG(r1, r10)
kono
parents:
diff changeset
277 STORE_REG(r2, r10)
kono
parents:
diff changeset
278 STORE_REG(r3, r10)
kono
parents:
diff changeset
279 STORE_REG(r4, r10)
kono
parents:
diff changeset
280 STORE_REG(r5, r10)
kono
parents:
diff changeset
281 STORE_REG(r6, r10)
kono
parents:
diff changeset
282 STORE_REG(r7, r10)
kono
parents:
diff changeset
283 STORE_REG(r8, r10)
kono
parents:
diff changeset
284 {
kono
parents:
diff changeset
285 /* Save r9. */
kono
parents:
diff changeset
286 SW r10, r9
kono
parents:
diff changeset
287 #ifdef __tilegx__
kono
parents:
diff changeset
288 /* Pointer to closure is passed in r11. */
kono
parents:
diff changeset
289 move r0, r11
kono
parents:
diff changeset
290 #else
kono
parents:
diff changeset
291 /* Compute pointer to the closure object. Because the closure
kono
parents:
diff changeset
292 starts with a "jal ffi_closure_tile", we can just take the
kono
parents:
diff changeset
293 value of lr (a phony return address pointing into the closure)
kono
parents:
diff changeset
294 and subtract 8. */
kono
parents:
diff changeset
295 addi r0, lr, -8
kono
parents:
diff changeset
296 #endif
kono
parents:
diff changeset
297 /* Compute a pointer to the register arguments we just spilled. */
kono
parents:
diff changeset
298 addi r1, sp, LINKAGE_SIZE
kono
parents:
diff changeset
299 }
kono
parents:
diff changeset
300 {
kono
parents:
diff changeset
301 /* Compute a pointer to the extra stack arguments (if any). */
kono
parents:
diff changeset
302 addli r2, sp, CLOSURE_FRAME_SIZE + LINKAGE_SIZE
kono
parents:
diff changeset
303 /* Call C code to deal with all of the grotty details. */
kono
parents:
diff changeset
304 jal ffi_closure_tile_inner
kono
parents:
diff changeset
305 }
kono
parents:
diff changeset
306 {
kono
parents:
diff changeset
307 addli r10, sp, CLOSURE_FRAME_SIZE
kono
parents:
diff changeset
308 }
kono
parents:
diff changeset
309 {
kono
parents:
diff changeset
310 /* Restore the return address. */
kono
parents:
diff changeset
311 LW lr, r10
kono
parents:
diff changeset
312 /* Compute pointer to registers array. */
kono
parents:
diff changeset
313 addli r10, sp, LINKAGE_SIZE + (NUM_ARG_REGS * REG_SIZE)
kono
parents:
diff changeset
314 }
kono
parents:
diff changeset
315 /* Return all the register values, which C code may have set. */
kono
parents:
diff changeset
316 LOAD_REG(r0, r10)
kono
parents:
diff changeset
317 LOAD_REG(r1, r10)
kono
parents:
diff changeset
318 LOAD_REG(r2, r10)
kono
parents:
diff changeset
319 LOAD_REG(r3, r10)
kono
parents:
diff changeset
320 LOAD_REG(r4, r10)
kono
parents:
diff changeset
321 LOAD_REG(r5, r10)
kono
parents:
diff changeset
322 LOAD_REG(r6, r10)
kono
parents:
diff changeset
323 LOAD_REG(r7, r10)
kono
parents:
diff changeset
324 LOAD_REG(r8, r10)
kono
parents:
diff changeset
325 LOAD_REG(r9, r10)
kono
parents:
diff changeset
326 {
kono
parents:
diff changeset
327 /* Pop the frame. */
kono
parents:
diff changeset
328 addli sp, sp, CLOSURE_FRAME_SIZE
kono
parents:
diff changeset
329 jrp lr
kono
parents:
diff changeset
330 }
kono
parents:
diff changeset
331
kono
parents:
diff changeset
332 .cfi_endproc
kono
parents:
diff changeset
333 .size ffi_closure_tile, . - ffi_closure_tile
kono
parents:
diff changeset
334
kono
parents:
diff changeset
335
kono
parents:
diff changeset
336 /* What follows are code template instructions that get copied to the
kono
parents:
diff changeset
337 closure trampoline by ffi_prep_closure_loc. The zeroed operands
kono
parents:
diff changeset
338 get replaced by their proper values at runtime. */
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340 .section .text.ffi_template_tramp_tile, "ax", @progbits
kono
parents:
diff changeset
341 .align 8
kono
parents:
diff changeset
342 .globl ffi_template_tramp_tile
kono
parents:
diff changeset
343 FFI_HIDDEN(ffi_template_tramp_tile)
kono
parents:
diff changeset
344 ffi_template_tramp_tile:
kono
parents:
diff changeset
345 #ifdef __tilegx__
kono
parents:
diff changeset
346 {
kono
parents:
diff changeset
347 moveli r11, 0 /* backpatched to address of containing closure. */
kono
parents:
diff changeset
348 moveli r10, 0 /* backpatched to ffi_closure_tile. */
kono
parents:
diff changeset
349 }
kono
parents:
diff changeset
350 /* Note: the following bundle gets generated multiple times
kono
parents:
diff changeset
351 depending on the pointer value (esp. useful for -m32 mode). */
kono
parents:
diff changeset
352 { shl16insli r11, r11, 0 ; shl16insli r10, r10, 0 }
kono
parents:
diff changeset
353 { info 2+8 /* for backtracer: -> pc in lr, frame size 0 */ ; jr r10 }
kono
parents:
diff changeset
354 #else
kono
parents:
diff changeset
355 /* 'jal .' yields a PC-relative offset of zero so we can OR in the
kono
parents:
diff changeset
356 right offset at runtime. */
kono
parents:
diff changeset
357 { move r10, lr ; jal . /* ffi_closure_tile */ }
kono
parents:
diff changeset
358 #endif
kono
parents:
diff changeset
359
kono
parents:
diff changeset
360 .size ffi_template_tramp_tile, . - ffi_template_tramp_tile