summaryrefslogtreecommitdiff
path: root/src/cmd/tests/kernel/misc.s
blob: ae1b567095a016a0636f55cec935a5d4abe4e2fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.section .text
.global _sse_test
.type _sse_test, @function

/* Written in assembly to ensure gcc won't mess with the XMM registers */
_sse_test:
	movdqu (%rdi), %xmm1
	push %rdi /* preserve */

	call fork
	cmp $0, %rax
	je child

	/* in parent - wait for the child to die */
	mov %rax, %rdi
	mov $0, %rsi
	mov $0, %rdx
	call _sys_wait2

	pop %rdi
	movdqu %xmm1, (%rdi)
	ret

child:
	pxor %xmm1, %xmm1
	mov $0, %rdi
	call _sys_exit