xref: /openbsd-src/lib/libc/arch/amd64/gen/fabs.S (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1/*	$OpenBSD: fabs.S,v 1.6 2011/07/08 22:28:32 martynas Exp $	*/
2/*	$NetBSD: fabs.S,v 1.1 2001/06/19 00:25:02 fvdl Exp $	*/
3
4#include <machine/asm.h>
5
6/*
7 * Ok, this sucks. Is there really no way to push an xmm register onto
8 * the FP stack directly?
9 */
10
11ENTRY(fabs)
12	movsd	%xmm0, -8(%rsp)
13	fldl	-8(%rsp)
14	fabs
15	fstpl	-8(%rsp)
16	movsd	-8(%rsp),%xmm0
17	ret
18