2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2012, Richard Lowe.
23 #define SET_SIZE(x, x_size) \
26 .type x_size, @object; \
30 * Extracted versions of the functional tests
32 * Named of the form <compiler>-<prologue style>-<nature of test>
33 * basic -- A regular function
34 * align -- odd number of arguments needing save-area
36 * big-struct-ret -- returns a > 16byte structure by value
37 * big-struct-ret-and-spill -- returns a > 16byte structure by value and
38 * spills args to the stack
39 * small-struct-ret -- returns a < 16byte structure by value
40 * small-struct-ret-and-spill -- returns a < 16byte structure by value and
41 * spills args to the stack
42 * stack-spill -- spills arguments to the stack
47 movq
%rbx
, -0x38(%rbp
)
49 movq
%rcx
, -0x20(%rbp
)
50 movq
%rdx
, -0x18(%rbp
)
51 movq
%rsi
, -0x10(%rbp
)
54 SET_SIZE
(gcc_mov_align
, gcc_mov_align_end
)
65 SET_SIZE
(gcc_mov_basic
, gcc_mov_basic_end
)
76 SET_SIZE
(gcc_mov_noorder
, gcc_mov_noorder_end
)
78 FUNC
(gcc_mov_big_struct_ret
)
87 SET_SIZE
(gcc_mov_big_struct_ret
, gcc_mov_big_struct_ret_end
)
89 FUNC
(gcc_mov_struct_noorder
)
98 SET_SIZE
(gcc_mov_struct_noorder
, gcc_mov_struct_noorder_end
)
100 FUNC
(gcc_mov_big_struct_ret_and_spill
)
103 movq
%rbx
,-0x38(%rbp
)
106 movq
%rcx
,-0x18(%rbp
)
107 movq
%rdx
,-0x10(%rbp
)
110 SET_SIZE
(gcc_mov_big_struct_ret_and_spill
, gcc_mov_big_struct_ret_and_spill_end
)
112 FUNC
(gcc_mov_small_struct_ret
)
115 movq
%rbx
,-0x28(%rbp
)
116 movq
%rcx
,-0x20(%rbp
)
117 movq
%rdx
,-0x18(%rbp
)
118 movq
%rsi
,-0x10(%rbp
)
121 SET_SIZE
(gcc_mov_small_struct_ret
, gcc_mov_small_struct_ret_end
)
123 FUNC
(gcc_mov_small_struct_ret_and_spill
)
126 movq
%rbx
,-0x38(%rbp
)
129 movq
%rcx
,-0x20(%rbp
)
130 movq
%rdx
,-0x18(%rbp
)
131 movq
%rsi
,-0x10(%rbp
)
134 SET_SIZE
(gcc_mov_small_struct_ret_and_spill
, gcc_mov_small_struct_ret_and_spill_end
)
136 FUNC
(gcc_mov_stack_spill
)
139 movq
%rbx
,-0x38(%rbp
)
142 movq
%rcx
,-0x20(%rbp
)
143 movq
%rdx
,-0x18(%rbp
)
144 movq
%rsi
,-0x10(%rbp
)
147 SET_SIZE
(gcc_mov_stack_spill
, gcc_mov_stack_spill_end
)
159 SET_SIZE
(gcc_push_align
, gcc_push_align_end
)
169 SET_SIZE
(gcc_push_basic
, gcc_push_basic_end
)
171 FUNC
(gcc_push_noorder
)
179 SET_SIZE
(gcc_push_noorder
, gcc_push_noorder_end
)
181 FUNC
(gcc_push_big_struct_ret
)
189 SET_SIZE
(gcc_push_big_struct_ret
, gcc_push_big_struct_ret_end
)
191 FUNC
(gcc_push_struct_noorder
)
199 SET_SIZE
(gcc_push_struct_noorder
, gcc_push_struct_noorder_end
)
201 FUNC
(gcc_push_big_struct_ret_and_spill
)
211 SET_SIZE
(gcc_push_big_struct_ret_and_spill
, gcc_push_big_struct_ret_and_spill_end
)
213 FUNC
(gcc_push_small_struct_ret
)
221 SET_SIZE
(gcc_push_small_struct_ret
, gcc_push_small_struct_ret_end
)
223 FUNC
(gcc_push_small_struct_ret_and_spill
)
233 SET_SIZE
(gcc_push_small_struct_ret_and_spill
, gcc_push_small_struct_ret_and_spill_end
)
235 FUNC
(gcc_push_stack_spill
)
245 SET_SIZE
(gcc_push_stack_spill
, gcc_push_stack_spill_end
)
252 movq
%rsi
,-0x10(%rbp
)
253 movq
%rdx
,-0x18(%rbp
)
254 movq
%rcx
,-0x20(%rbp
)
256 SET_SIZE
(ss_mov_align
, ss_mov_align_end
)
263 movq
%rsi
,-0x10(%rbp
)
264 movq
%rdx
,-0x18(%rbp
)
265 movq
%rcx
,-0x20(%rbp
)
266 SET_SIZE
(ss_mov_basic
, ss_mov_basic_end
)
268 FUNC
(ss_mov_big_struct_ret
)
273 movq
%rsi
,-0x10(%rbp
)
274 movq
%rdx
,-0x18(%rbp
)
275 movq
%rcx
,-0x20(%rbp
)
277 SET_SIZE
(ss_mov_big_struct_ret
, ss_mov_big_struct_ret_end
)
279 FUNC
(ss_mov_big_struct_ret_and_spill
)
284 movq
%rsi
,-0x10(%rbp
)
285 movq
%rdx
,-0x18(%rbp
)
286 movq
%rcx
,-0x20(%rbp
)
289 SET_SIZE
(ss_mov_big_struct_ret_and_spill
, ss_mov_big_struct_ret_and_spill_end
)
291 FUNC
(ss_mov_small_struct_ret
)
296 movq
%rsi
,-0x10(%rbp
)
297 movq
%rdx
,-0x18(%rbp
)
298 movq
%rcx
,-0x20(%rbp
)
299 SET_SIZE
(ss_mov_small_struct_ret
, ss_mov_small_struct_ret_end
)
301 FUNC
(ss_mov_small_struct_ret_and_spill
)
306 movq
%rsi
,-0x10(%rbp
)
307 movq
%rdx
,-0x18(%rbp
)
308 movq
%rcx
,-0x20(%rbp
)
311 SET_SIZE
(ss_mov_small_struct_ret_and_spill
, ss_mov_small_struct_ret_and_spill_end
)
313 FUNC
(ss_mov_stack_spill
)
318 movq
%rsi
,-0x10(%rbp
)
319 movq
%rdx
,-0x18(%rbp
)
320 movq
%rcx
,-0x20(%rbp
)
323 SET_SIZE
(ss_mov_stack_spill
, ss_mov_stack_spill_end
)
325 /* DTrace instrumentation */
326 FUNC
(dtrace_instrumented
)
329 movq
%rbx
,-0x28(%rbp
)
330 movq
%rcx
,-0x20(%rbp
)
331 movq
%rdx
,-0x18(%rbp
)
332 movq
%rsi
,-0x10(%rbp
)
335 SET_SIZE
(dtrace_instrumented
, dtrace_instrumented_end
)
338 * System functions with special characteristics, be they non-initial FP save,
339 * gaps between FP save and argument saving, or gaps between saved arguments.
348 movq
%r12,-0x28(%rbp
)
349 movq
%rbx
,-0x30(%rbp
)
351 movq
%r13,-0x20(%rbp
)
352 movq
%r14,-0x18(%rbp
)
353 movq
%rsi
,-0x10(%rbp
)
356 SET_SIZE
(kmem_alloc
, kmem_alloc_end
)
362 movq
%rbx
,-0x28(%rbp
)
363 leaq
-0x50(%rbp
),%rbx
364 movq
%r12,-0x20(%rbp
)
365 movq
%r13,-0x18(%rbp
)
366 movq
%rsi
,-0x10(%rbp
)
369 SET_SIZE
(uts_kill
, uts_kill_end
)
371 FUNC
(av1394_ic_bitreverse
)
373 movq $
0x5555555555555555,%rax
374 movq $
0x3333333333333333,%rcx
384 SET_SIZE
(av1394_ic_bitreverse
, av1394_ic_bitreverse_end
)
386 /* Problematic functions which should not match */
388 FUNC
(no_fp
) /* No frame pointer */
391 movq
%rbx
,-0x28(%rbp
)
392 movq
%rcx
,-0x20(%rbp
)
393 movq
%rdx
,-0x18(%rbp
)
394 movq
%rsi
,-0x10(%rbp
)
397 SET_SIZE
(no_fp
, no_fp_end
)
399 /* Small structure return, but with an SSE type (thus forcing it to the stack) */
400 FUNC
(small_struct_ret_w_float
)
405 SET_SIZE
(small_struct_ret_w_float
, small_struct_ret_w_float_end
)
407 /* Big structure return, but with an SSE type */
408 FUNC
(big_struct_ret_w_float
)
413 movq
%rsi
,-0x48(%rbp
)
414 movq
-0x48(%rbp
),%rax
422 SET_SIZE
(big_struct_ret_w_float
, big_struct_ret_w_float_end
)
424 FUNC
(big_struct_arg_by_value
)
429 SET_SIZE
(big_struct_arg_by_value
, big_struct_arg_by_value_end
)
431 FUNC
(small_struct_arg_by_value
)
434 movq
%rdx
,-0x18(%rbp
)
435 movq
%rsi
,-0x10(%rbp
)
438 SET_SIZE
(small_struct_arg_by_value
, small_struct_arg_by_value_end
)
440 FUNC
(interleaved_argument_saves
)
448 movq
%rbx
,-0x28(%rbp
)
450 movq
%rcx
,-0x20(%rbp
)
451 movq
%rdx
,-0x18(%rbp
)
452 movq
%rsi
,-0x10(%rbp
)
453 movq
0x0(,%rax
,8),%rax
454 SET_SIZE
(interleaved_argument_saves
, interleaved_argument_saves_end
)
468 SET_SIZE
(jmp_table
, jmp_table_end
)