xref: /openbsd-src/lib/libc/arch/amd64/gen/fabs.S (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1/*	$OpenBSD: fabs.S,v 1.4 2008/12/09 20:54:02 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