xref: /freebsd/contrib/netbsd-tests/lib/csu/arch/ia64/h_initfini_align.S (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1/*	$NetBSD: h_initfini_align.S,v 1.2 2014/03/16 09:27:04 cherry Exp $	*/
2
3#include <machine/asm.h>
4
5RCSID("$NetBSD: h_initfini_align.S,v 1.2 2014/03/16 09:27:04 cherry Exp $")
6
7ENTRY(check_stack_alignment, 0)
8	.prologue
9	.regstk 0, 2, 0, 0
10
11	alloc loc0 = ar.pfs, 0, 2, 0, 0
12
13	.body
14	mov ret0 = 1
15	;;
16
17	/* ar.bsp has an 8-byte alignment requirement */
18 	mov loc1 = ar.bsp
19	;;
20
21	and loc1 = 7, loc1
22	;;
23
24	cmp.eq	p1, p0 = 0, loc1
25	(p0)	mov ret0 = 0
26	;;
27
28	/* sp has a 16-byte alignment requirement */
29	(p1)	mov loc1 = sp
30	;;
31	(p1)	and loc1 = 15, loc1
32	;;
33
34	(p1)	cmp.eq p1, p0 = 0, loc1
35	(p0)	mov ret0 = 0
36
37	br.ret.sptk.few rp
38