12d4be7aaSRichard Lowe/*
22d4be7aaSRichard Lowe * This file and its contents are supplied under the terms of the
32d4be7aaSRichard Lowe * Common Development and Distribution License ("CDDL"), version 1.0.
42d4be7aaSRichard Lowe * You may only use this file in accordance with the terms of version
52d4be7aaSRichard Lowe * 1.0 of the CDDL.
62d4be7aaSRichard Lowe *
72d4be7aaSRichard Lowe * A full copy of the text of the CDDL should have accompanied this
82d4be7aaSRichard Lowe * source.  A copy of the CDDL is also available via the Internet at
92d4be7aaSRichard Lowe * http://www.illumos.org/license/CDDL.
102d4be7aaSRichard Lowe */
112d4be7aaSRichard Lowe
122d4be7aaSRichard Lowe/*
132d4be7aaSRichard Lowe * Copyright 2012, Richard Lowe.
142d4be7aaSRichard Lowe */
152d4be7aaSRichard Lowe
162d4be7aaSRichard Lowe#define	FUNC(x) \
172d4be7aaSRichard Lowe	.text; \
182d4be7aaSRichard Lowe	.align	16; \
192d4be7aaSRichard Lowe	.globl	x; \
202d4be7aaSRichard Lowe	.type	x, @function; \
212d4be7aaSRichard Lowex:
222d4be7aaSRichard Lowe
232d4be7aaSRichard Lowe#define	SET_SIZE(x, x_size) \
242d4be7aaSRichard Lowe	.size	x, [.-x]; \
252d4be7aaSRichard Lowe        .globl x_size; \
262d4be7aaSRichard Lowe        .type  x_size, @object; \
272d4be7aaSRichard Lowex_size:
282d4be7aaSRichard Lowe
292d4be7aaSRichard Lowe/*
302d4be7aaSRichard Lowe * Extracted versions of the functional tests
312d4be7aaSRichard Lowe *
322d4be7aaSRichard Lowe * Named of the form <compiler>-<prologue style>-<nature of test>
332d4be7aaSRichard Lowe * basic			-- A regular function
342d4be7aaSRichard Lowe * align			-- odd number of arguments needing save-area
352d4be7aaSRichard Lowe * 				   alignment
362d4be7aaSRichard Lowe * big-struct-ret		-- returns a > 16byte structure by value
372d4be7aaSRichard Lowe * big-struct-ret-and-spill	-- returns a > 16byte structure by value and
382d4be7aaSRichard Lowe * 				   spills args to the stack
392d4be7aaSRichard Lowe * small-struct-ret		-- returns a < 16byte structure by value
402d4be7aaSRichard Lowe * small-struct-ret-and-spill	-- returns a < 16byte structure by value and
412d4be7aaSRichard Lowe * 				   spills args to the stack
422d4be7aaSRichard Lowe * stack-spill			-- spills arguments to the stack
432d4be7aaSRichard Lowe */
442d4be7aaSRichard LoweFUNC(gcc_mov_align)
452d4be7aaSRichard Lowepushq	%rbp
462d4be7aaSRichard Lowemovq	%rsp, %rbp
472d4be7aaSRichard Lowemovq	%rbx, -0x38(%rbp)
482d4be7aaSRichard Lowemovq	%r8, -0x28(%rbp)
492d4be7aaSRichard Lowemovq	%rcx, -0x20(%rbp)
502d4be7aaSRichard Lowemovq	%rdx, -0x18(%rbp)
512d4be7aaSRichard Lowemovq	%rsi, -0x10(%rbp)
522d4be7aaSRichard Lowemovq	%rdi, -0x8(%rbp)
532d4be7aaSRichard Lowesubq	$0x70, %rsp
542d4be7aaSRichard LoweSET_SIZE(gcc_mov_align, gcc_mov_align_end)
552d4be7aaSRichard Lowe
562d4be7aaSRichard LoweFUNC(gcc_mov_basic)
572d4be7aaSRichard Lowepushq	%rbp
582d4be7aaSRichard Lowemovq	%rsp, %rbp
592d4be7aaSRichard Lowemovq	%rbx,-0x28(%rbp)
602d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
612d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
622d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
632d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
642d4be7aaSRichard Lowesubq    $0x50,%rsp
652d4be7aaSRichard LoweSET_SIZE(gcc_mov_basic, gcc_mov_basic_end)
662d4be7aaSRichard Lowe
67*702941cdSRichard LoweFUNC(gcc_mov_noorder)
68*702941cdSRichard Lowepushq	%rbp
69*702941cdSRichard Lowemovq	%rsp, %rbp
70*702941cdSRichard Lowemovq    %rcx,-0x20(%rbp)
71*702941cdSRichard Lowemovq	%rbx,-0x28(%rbp)
72*702941cdSRichard Lowemovq    %rdi,-0x8(%rbp)
73*702941cdSRichard Lowemovq    %rdx,-0x18(%rbp)
74*702941cdSRichard Lowemovq    %rsi,-0x10(%rbp)
75*702941cdSRichard Lowesubq    $0x50,%rsp
76*702941cdSRichard LoweSET_SIZE(gcc_mov_noorder, gcc_mov_noorder_end)
77*702941cdSRichard Lowe
782d4be7aaSRichard LoweFUNC(gcc_mov_big_struct_ret)
792d4be7aaSRichard Lowepushq   %rbp
802d4be7aaSRichard Lowemovq    %rsp,%rbp
812d4be7aaSRichard Lowemovq    %rbx,-0x28(%rbp)
822d4be7aaSRichard Lowemovq    %r8,-0x20(%rbp)
832d4be7aaSRichard Lowemovq    %rcx,-0x18(%rbp)
842d4be7aaSRichard Lowemovq    %rdx,-0x10(%rbp)
852d4be7aaSRichard Lowemovq    %rsi,-0x8(%rbp)
862d4be7aaSRichard Lowesubq    $0x50,%rsp
872d4be7aaSRichard LoweSET_SIZE(gcc_mov_big_struct_ret, gcc_mov_big_struct_ret_end)
882d4be7aaSRichard Lowe
89*702941cdSRichard LoweFUNC(gcc_mov_struct_noorder)
90*702941cdSRichard Lowepushq   %rbp
91*702941cdSRichard Lowemovq    %rsp,%rbp
92*702941cdSRichard Lowemovq    %rcx,-0x18(%rbp)
93*702941cdSRichard Lowemovq    %r8,-0x20(%rbp)
94*702941cdSRichard Lowemovq    %rsi,-0x8(%rbp)
95*702941cdSRichard Lowemovq    %rdx,-0x10(%rbp)
96*702941cdSRichard Lowemovq    %rbx,-0x28(%rbp)
97*702941cdSRichard Lowesubq    $0x50,%rsp
98*702941cdSRichard LoweSET_SIZE(gcc_mov_struct_noorder, gcc_mov_struct_noorder_end)
99*702941cdSRichard Lowe
1002d4be7aaSRichard LoweFUNC(gcc_mov_big_struct_ret_and_spill)
1012d4be7aaSRichard Lowepushq   %rbp
1022d4be7aaSRichard Lowemovq    %rsp,%rbp
1032d4be7aaSRichard Lowemovq    %rbx,-0x38(%rbp)
1042d4be7aaSRichard Lowemovq    %r9,-0x28(%rbp)
1052d4be7aaSRichard Lowemovq    %r8,-0x20(%rbp)
1062d4be7aaSRichard Lowemovq    %rcx,-0x18(%rbp)
1072d4be7aaSRichard Lowemovq    %rdx,-0x10(%rbp)
1082d4be7aaSRichard Lowemovq    %rsi,-0x8(%rbp)
1092d4be7aaSRichard Lowesubq    $0x90,%rsp
1102d4be7aaSRichard LoweSET_SIZE(gcc_mov_big_struct_ret_and_spill, gcc_mov_big_struct_ret_and_spill_end)
1112d4be7aaSRichard Lowe
1122d4be7aaSRichard LoweFUNC(gcc_mov_small_struct_ret)
1132d4be7aaSRichard Lowepushq   %rbp
1142d4be7aaSRichard Lowemovq    %rsp,%rbp
1152d4be7aaSRichard Lowemovq    %rbx,-0x28(%rbp)
1162d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
1172d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
1182d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
1192d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
1202d4be7aaSRichard Lowesubq    $0x50,%rsp
1212d4be7aaSRichard LoweSET_SIZE(gcc_mov_small_struct_ret, gcc_mov_small_struct_ret_end)
1222d4be7aaSRichard Lowe
1232d4be7aaSRichard LoweFUNC(gcc_mov_small_struct_ret_and_spill)
1242d4be7aaSRichard Lowepushq   %rbp
1252d4be7aaSRichard Lowemovq    %rsp,%rbp
1262d4be7aaSRichard Lowemovq    %rbx,-0x38(%rbp)
1272d4be7aaSRichard Lowemovq    %r9,-0x30(%rbp)
1282d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
1292d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
1302d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
1312d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
1322d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
1332d4be7aaSRichard Lowesubq    $0x90,%rsp
1342d4be7aaSRichard LoweSET_SIZE(gcc_mov_small_struct_ret_and_spill, gcc_mov_small_struct_ret_and_spill_end)
1352d4be7aaSRichard Lowe
1362d4be7aaSRichard LoweFUNC(gcc_mov_stack_spill)
1372d4be7aaSRichard Lowepushq   %rbp
1382d4be7aaSRichard Lowemovq    %rsp,%rbp
1392d4be7aaSRichard Lowemovq    %rbx,-0x38(%rbp)
1402d4be7aaSRichard Lowemovq    %r9,-0x30(%rbp)
1412d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
1422d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
1432d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
1442d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
1452d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
1462d4be7aaSRichard Lowesubq    $0x90,%rsp
1472d4be7aaSRichard LoweSET_SIZE(gcc_mov_stack_spill, gcc_mov_stack_spill_end)
1482d4be7aaSRichard Lowe
1492d4be7aaSRichard LoweFUNC(gcc_push_align)
1502d4be7aaSRichard Lowepushq   %rbp
1512d4be7aaSRichard Lowemovq    %rsp,%rbp
1522d4be7aaSRichard Lowepushq   %rdi
1532d4be7aaSRichard Lowepushq   %rsi
1542d4be7aaSRichard Lowepushq   %rdx
1552d4be7aaSRichard Lowepushq   %rcx
1562d4be7aaSRichard Lowepushq   %r8
1572d4be7aaSRichard Lowesubq    $0x8,%rsp
1582d4be7aaSRichard Lowesubq    $0x30,%rsp
1592d4be7aaSRichard LoweSET_SIZE(gcc_push_align, gcc_push_align_end)
1602d4be7aaSRichard Lowe
1612d4be7aaSRichard LoweFUNC(gcc_push_basic)
1622d4be7aaSRichard Lowepushq   %rbp
1632d4be7aaSRichard Lowemovq    %rsp,%rbp
1642d4be7aaSRichard Lowepushq   %rdi
1652d4be7aaSRichard Lowepushq   %rsi
1662d4be7aaSRichard Lowepushq   %rdx
1672d4be7aaSRichard Lowepushq   %rcx
1682d4be7aaSRichard Lowesubq    $0x20,%rsp
1692d4be7aaSRichard LoweSET_SIZE(gcc_push_basic, gcc_push_basic_end)
1702d4be7aaSRichard Lowe
171*702941cdSRichard LoweFUNC(gcc_push_noorder)
172*702941cdSRichard Lowepushq   %rbp
173*702941cdSRichard Lowemovq    %rsp,%rbp
174*702941cdSRichard Lowepushq   %rsi
175*702941cdSRichard Lowepushq   %rdi
176*702941cdSRichard Lowepushq   %rcx
177*702941cdSRichard Lowepushq   %rdx
178*702941cdSRichard Lowesubq    $0x20,%rsp
179*702941cdSRichard LoweSET_SIZE(gcc_push_noorder, gcc_push_noorder_end)
180*702941cdSRichard Lowe
1812d4be7aaSRichard LoweFUNC(gcc_push_big_struct_ret)
1822d4be7aaSRichard Lowepushq   %rbp
1832d4be7aaSRichard Lowemovq    %rsp,%rbp
1842d4be7aaSRichard Lowepushq   %rsi
1852d4be7aaSRichard Lowepushq   %rdx
1862d4be7aaSRichard Lowepushq   %rcx
1872d4be7aaSRichard Lowepushq   %r8
1882d4be7aaSRichard Lowesubq    $0x30,%rsp
1892d4be7aaSRichard LoweSET_SIZE(gcc_push_big_struct_ret, gcc_push_big_struct_ret_end)
1902d4be7aaSRichard Lowe
191*702941cdSRichard LoweFUNC(gcc_push_struct_noorder)
192*702941cdSRichard Lowepushq   %rbp
193*702941cdSRichard Lowemovq    %rsp,%rbp
194*702941cdSRichard Lowepushq   %rdx
195*702941cdSRichard Lowepushq   %rsi
196*702941cdSRichard Lowepushq   %r8
197*702941cdSRichard Lowepushq   %rcx
198*702941cdSRichard Lowesubq    $0x30,%rsp
199*702941cdSRichard LoweSET_SIZE(gcc_push_struct_noorder, gcc_push_struct_noorder_end)
200*702941cdSRichard Lowe
2012d4be7aaSRichard LoweFUNC(gcc_push_big_struct_ret_and_spill)
2022d4be7aaSRichard Lowepushq   %rbp
2032d4be7aaSRichard Lowemovq    %rsp,%rbp
2042d4be7aaSRichard Lowepushq   %rsi
2052d4be7aaSRichard Lowepushq   %rdx
2062d4be7aaSRichard Lowepushq   %rcx
2072d4be7aaSRichard Lowepushq   %r8
2082d4be7aaSRichard Lowepushq   %r9
2092d4be7aaSRichard Lowesubq    $0x8,%rsp
2102d4be7aaSRichard Lowesubq    $0x50,%rsp
2112d4be7aaSRichard LoweSET_SIZE(gcc_push_big_struct_ret_and_spill, gcc_push_big_struct_ret_and_spill_end)
2122d4be7aaSRichard Lowe
2132d4be7aaSRichard LoweFUNC(gcc_push_small_struct_ret)
2142d4be7aaSRichard Lowepushq   %rbp
2152d4be7aaSRichard Lowemovq    %rsp,%rbp
2162d4be7aaSRichard Lowepushq   %rdi
2172d4be7aaSRichard Lowepushq   %rsi
2182d4be7aaSRichard Lowepushq   %rdx
2192d4be7aaSRichard Lowepushq   %rcx
2202d4be7aaSRichard Lowesubq    $0x20,%rsp
2212d4be7aaSRichard LoweSET_SIZE(gcc_push_small_struct_ret, gcc_push_small_struct_ret_end)
2222d4be7aaSRichard Lowe
2232d4be7aaSRichard LoweFUNC(gcc_push_small_struct_ret_and_spill)
2242d4be7aaSRichard Lowepushq   %rbp
2252d4be7aaSRichard Lowemovq    %rsp,%rbp
2262d4be7aaSRichard Lowepushq   %rdi
2272d4be7aaSRichard Lowepushq   %rsi
2282d4be7aaSRichard Lowepushq   %rdx
2292d4be7aaSRichard Lowepushq   %rcx
2302d4be7aaSRichard Lowepushq   %r8
2312d4be7aaSRichard Lowepushq   %r9
2322d4be7aaSRichard Lowesubq    $0x50,%rsp
2332d4be7aaSRichard LoweSET_SIZE(gcc_push_small_struct_ret_and_spill, gcc_push_small_struct_ret_and_spill_end)
2342d4be7aaSRichard Lowe
2352d4be7aaSRichard LoweFUNC(gcc_push_stack_spill)
2362d4be7aaSRichard Lowepushq   %rbp
2372d4be7aaSRichard Lowemovq    %rsp,%rbp
2382d4be7aaSRichard Lowepushq   %rdi
2392d4be7aaSRichard Lowepushq   %rsi
2402d4be7aaSRichard Lowepushq   %rdx
2412d4be7aaSRichard Lowepushq   %rcx
2422d4be7aaSRichard Lowepushq   %r8
2432d4be7aaSRichard Lowepushq   %r9
2442d4be7aaSRichard Lowesubq    $0x50,%rsp
2452d4be7aaSRichard LoweSET_SIZE(gcc_push_stack_spill, gcc_push_stack_spill_end)
2462d4be7aaSRichard Lowe
2472d4be7aaSRichard LoweFUNC(ss_mov_align)
2482d4be7aaSRichard Lowepushq   %rbp
2492d4be7aaSRichard Lowemovq    %rsp,%rbp
2502d4be7aaSRichard Lowesubq    $0x30,%rsp
2512d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
2522d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
2532d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
2542d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
2552d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
2562d4be7aaSRichard LoweSET_SIZE(ss_mov_align, ss_mov_align_end)
2572d4be7aaSRichard Lowe
2582d4be7aaSRichard LoweFUNC(ss_mov_basic)
2592d4be7aaSRichard Lowepushq   %rbp
2602d4be7aaSRichard Lowemovq    %rsp,%rbp
2612d4be7aaSRichard Lowesubq    $0x20,%rsp
2622d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
2632d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
2642d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
2652d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
2662d4be7aaSRichard LoweSET_SIZE(ss_mov_basic, ss_mov_basic_end)
2672d4be7aaSRichard Lowe
2682d4be7aaSRichard LoweFUNC(ss_mov_big_struct_ret)
2692d4be7aaSRichard Lowepushq   %rbp
2702d4be7aaSRichard Lowemovq    %rsp,%rbp
2712d4be7aaSRichard Lowesubq    $0x30,%rsp
2722d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
2732d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
2742d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
2752d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
2762d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
2772d4be7aaSRichard LoweSET_SIZE(ss_mov_big_struct_ret, ss_mov_big_struct_ret_end)
2782d4be7aaSRichard Lowe
2792d4be7aaSRichard LoweFUNC(ss_mov_big_struct_ret_and_spill)
2802d4be7aaSRichard Lowepushq   %rbp
2812d4be7aaSRichard Lowemovq    %rsp,%rbp
2822d4be7aaSRichard Lowesubq    $0x50,%rsp
2832d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
2842d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
2852d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
2862d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
2872d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
2882d4be7aaSRichard Lowemovq    %r9,-0x30(%rbp)
2892d4be7aaSRichard LoweSET_SIZE(ss_mov_big_struct_ret_and_spill, ss_mov_big_struct_ret_and_spill_end)
2902d4be7aaSRichard Lowe
2912d4be7aaSRichard LoweFUNC(ss_mov_small_struct_ret)
2922d4be7aaSRichard Lowepushq   %rbp
2932d4be7aaSRichard Lowemovq    %rsp,%rbp
2942d4be7aaSRichard Lowesubq    $0x20,%rsp
2952d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
2962d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
2972d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
2982d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
2992d4be7aaSRichard LoweSET_SIZE(ss_mov_small_struct_ret, ss_mov_small_struct_ret_end)
3002d4be7aaSRichard Lowe
3012d4be7aaSRichard LoweFUNC(ss_mov_small_struct_ret_and_spill)
3022d4be7aaSRichard Lowepushq   %rbp
3032d4be7aaSRichard Lowemovq    %rsp,%rbp
3042d4be7aaSRichard Lowesubq    $0x50,%rsp
3052d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3062d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
3072d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
3082d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
3092d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
3102d4be7aaSRichard Lowemovq    %r9,-0x30(%rbp)
3112d4be7aaSRichard LoweSET_SIZE(ss_mov_small_struct_ret_and_spill, ss_mov_small_struct_ret_and_spill_end)
3122d4be7aaSRichard Lowe
3132d4be7aaSRichard LoweFUNC(ss_mov_stack_spill)
3142d4be7aaSRichard Lowepushq   %rbp
3152d4be7aaSRichard Lowemovq    %rsp,%rbp
3162d4be7aaSRichard Lowesubq    $0x50,%rsp
3172d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3182d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
3192d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
3202d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
3212d4be7aaSRichard Lowemovq    %r8,-0x28(%rbp)
3222d4be7aaSRichard Lowemovq    %r9,-0x30(%rbp)
3232d4be7aaSRichard LoweSET_SIZE(ss_mov_stack_spill, ss_mov_stack_spill_end)
3242d4be7aaSRichard Lowe
3252d4be7aaSRichard Lowe/* DTrace instrumentation */
3262d4be7aaSRichard LoweFUNC(dtrace_instrumented)
3272d4be7aaSRichard Loweint	$0x3
3282d4be7aaSRichard Lowemovq	%rsp, %rbp
3292d4be7aaSRichard Lowemovq	%rbx,-0x28(%rbp)
3302d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
3312d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
3322d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
3332d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3342d4be7aaSRichard Lowesubq    $0x50,%rsp
3352d4be7aaSRichard LoweSET_SIZE(dtrace_instrumented, dtrace_instrumented_end)
3362d4be7aaSRichard Lowe
3372d4be7aaSRichard Lowe/*
3382d4be7aaSRichard Lowe * System functions with special characteristics, be they non-initial FP save,
3392d4be7aaSRichard Lowe * gaps between FP save and argument saving, or gaps between saved arguments.
3402d4be7aaSRichard Lowe */
3412d4be7aaSRichard LoweFUNC(kmem_alloc)
3422d4be7aaSRichard Loweleaq    -0x1(%rdi),%rax
3432d4be7aaSRichard Lowepushq   %rbp
3442d4be7aaSRichard Lowemovq    %rax,%rdx
3452d4be7aaSRichard Lowemovq    %rsp,%rbp
3462d4be7aaSRichard Lowesubq    $0x30,%rsp
3472d4be7aaSRichard Loweshrq    $0x3,%rdx
3482d4be7aaSRichard Lowemovq    %r12,-0x28(%rbp)
3492d4be7aaSRichard Lowemovq    %rbx,-0x30(%rbp)
3502d4be7aaSRichard Lowecmpq    $0x1ff,%rdx
3512d4be7aaSRichard Lowemovq    %r13,-0x20(%rbp)
3522d4be7aaSRichard Lowemovq    %r14,-0x18(%rbp)
3532d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
3542d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3552d4be7aaSRichard Lowemovq    %rdi,%r12
3562d4be7aaSRichard LoweSET_SIZE(kmem_alloc, kmem_alloc_end)
3572d4be7aaSRichard Lowe
3582d4be7aaSRichard LoweFUNC(uts_kill)
3592d4be7aaSRichard Lowepushq   %rbp
3602d4be7aaSRichard Lowemovq    %rsp,%rbp
3612d4be7aaSRichard Lowesubq    $0x50,%rsp
3622d4be7aaSRichard Lowemovq    %rbx,-0x28(%rbp)
3632d4be7aaSRichard Loweleaq    -0x50(%rbp),%rbx
3642d4be7aaSRichard Lowemovq    %r12,-0x20(%rbp)
3652d4be7aaSRichard Lowemovq    %r13,-0x18(%rbp)
3662d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
3672d4be7aaSRichard Lowemovl    %edi,%r12d
3682d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3692d4be7aaSRichard LoweSET_SIZE(uts_kill, uts_kill_end)
3702d4be7aaSRichard Lowe
3712d4be7aaSRichard LoweFUNC(av1394_ic_bitreverse)
3722d4be7aaSRichard Lowemovq    %rdi,%rdx
3732d4be7aaSRichard Lowemovq    $0x5555555555555555,%rax
3742d4be7aaSRichard Lowemovq    $0x3333333333333333,%rcx
3752d4be7aaSRichard Loweshrq    $0x1,%rdx
3762d4be7aaSRichard Lowepushq   %rbp
3772d4be7aaSRichard Loweandq    %rax,%rdx
3782d4be7aaSRichard Loweandq    %rdi,%rax
3792d4be7aaSRichard Loweaddq    %rax,%rax
3802d4be7aaSRichard Lowemovq    %rsp,%rbp
3812d4be7aaSRichard Lowesubq    $0x10,%rsp
3822d4be7aaSRichard Loweorq     %rdx,%rax
3832d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3842d4be7aaSRichard LoweSET_SIZE(av1394_ic_bitreverse, av1394_ic_bitreverse_end)
3852d4be7aaSRichard Lowe
3862d4be7aaSRichard Lowe/* Problematic functions which should not match */
3872d4be7aaSRichard Lowe
3882d4be7aaSRichard LoweFUNC(no_fp) /* No frame pointer */
3892d4be7aaSRichard Lowemovq	%rdi, %rsi
3902d4be7aaSRichard Lowemovq	%rsi, %rdi
3912d4be7aaSRichard Lowemovq	%rbx,-0x28(%rbp)
3922d4be7aaSRichard Lowemovq    %rcx,-0x20(%rbp)
3932d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
3942d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
3952d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
3962d4be7aaSRichard Lowesubq    $0x50,%rsp
3972d4be7aaSRichard LoweSET_SIZE(no_fp, no_fp_end)
3982d4be7aaSRichard Lowe
3992d4be7aaSRichard Lowe/* Small structure return, but with an SSE type (thus forcing it to the stack) */
4002d4be7aaSRichard LoweFUNC(small_struct_ret_w_float)
4012d4be7aaSRichard Lowepushq   %rbp
4022d4be7aaSRichard Lowemovq    %rsp,%rbp
4032d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
4042d4be7aaSRichard Lowesubq    $0x30,%rsp
4052d4be7aaSRichard LoweSET_SIZE(small_struct_ret_w_float, small_struct_ret_w_float_end)
4062d4be7aaSRichard Lowe
4072d4be7aaSRichard Lowe/* Big structure return, but with an SSE type */
4082d4be7aaSRichard LoweFUNC(big_struct_ret_w_float)
4092d4be7aaSRichard Lowepushq  %rbp
4102d4be7aaSRichard Lowemovq   %rsp,%rbp
4112d4be7aaSRichard Lowemovq   %rsi,-0x8(%rbp)
4122d4be7aaSRichard Lowesubq   $0x50,%rsp
4132d4be7aaSRichard Lowemovq   %rsi,-0x48(%rbp)
4142d4be7aaSRichard Lowemovq   -0x48(%rbp),%rax
4152d4be7aaSRichard Lowemovq   %rax,%rsi
4162d4be7aaSRichard Lowemovl   $0x400f60,%edi
4172d4be7aaSRichard Lowemovl   $0x0,%eax
4182d4be7aaSRichard Lowemovl   $0x1770,%edi
4192d4be7aaSRichard Lowemovl   $0x0,%eax
4202d4be7aaSRichard Loweleave
4212d4be7aaSRichard Loweret
4222d4be7aaSRichard LoweSET_SIZE(big_struct_ret_w_float, big_struct_ret_w_float_end)
4232d4be7aaSRichard Lowe
4242d4be7aaSRichard LoweFUNC(big_struct_arg_by_value)
4252d4be7aaSRichard Lowepushq   %rbp
4262d4be7aaSRichard Lowemovq    %rsp,%rbp
4272d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
4282d4be7aaSRichard Lowesubq    $0x40,%rsp
4292d4be7aaSRichard LoweSET_SIZE(big_struct_arg_by_value, big_struct_arg_by_value_end)
4302d4be7aaSRichard Lowe
4312d4be7aaSRichard LoweFUNC(small_struct_arg_by_value)
4322d4be7aaSRichard Lowepushq   %rbp
4332d4be7aaSRichard Lowemovq    %rsp,%rbp
4342d4be7aaSRichard Lowemovq    %rdx,-0x18(%rbp)
4352d4be7aaSRichard Lowemovq    %rsi,-0x10(%rbp)
4362d4be7aaSRichard Lowemovq    %rdi,-0x8(%rbp)
4372d4be7aaSRichard Lowesubq    $0x50,%rsp
4382d4be7aaSRichard LoweSET_SIZE(small_struct_arg_by_value, small_struct_arg_by_value_end)
439*702941cdSRichard Lowe
440*702941cdSRichard LoweFUNC(interleaved_argument_saves)
441*702941cdSRichard Lowepushq	%rbp
442*702941cdSRichard Lowemovq	%rdi,%rax
443*702941cdSRichard Loweshlq	$0x21,%rax
444*702941cdSRichard Lowemovq	%rsp,%rbp
445*702941cdSRichard Loweshrq	$0x29,%rax
446*702941cdSRichard Lowesubq	$0x30,%rsp
447*702941cdSRichard Lowemovq	%rdi,-0x8(%rbp)
448*702941cdSRichard Lowemovq	%rbx,-0x28(%rbp)
449*702941cdSRichard Lowemovzbl	%dil,%edi
450*702941cdSRichard Lowemovq	%rcx,-0x20(%rbp)
451*702941cdSRichard Lowemovq	%rdx,-0x18(%rbp)
452*702941cdSRichard Lowemovq	%rsi,-0x10(%rbp)
453*702941cdSRichard Lowemovq	0x0(,%rax,8),%rax
454*702941cdSRichard LoweSET_SIZE(interleaved_argument_saves, interleaved_argument_saves_end)
455*702941cdSRichard Lowe
456*702941cdSRichard LoweFUNC(jmp_table)
457*702941cdSRichard Lowepushq	%rbp
458*702941cdSRichard Lowemovq	%rsp,%rbp
459*702941cdSRichard Lowe.word	0x9afe
460*702941cdSRichard Lowe.word	0xffff
461*702941cdSRichard Lowe.word	0xffff
462*702941cdSRichard Lowe.word	0xa8ff
463*702941cdSRichard Lowe.word	0xffff
464*702941cdSRichard Lowe.word	0xffff
465*702941cdSRichard Lowe.word	0x7cff
466*702941cdSRichard Lowe.word	0xffff
467*702941cdSRichard Lowe.word	0xffff
468*702941cdSRichard LoweSET_SIZE(jmp_table, jmp_table_end)
469