xref: /openbsd-src/lib/libc/arch/amd64/gen/fabs.S (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1/*	$OpenBSD: fabs.S,v 1.7 2015/05/29 08:50:12 uebayasi 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
18END(fabs)
19