fabs.S revision 125600
1125600Speter/*- 2125600Speter * Copyright (c) 2004 Peter Wemm 3125600Speter * All rights reserved. 4125600Speter * 5125600Speter * Redistribution and use in source and binary forms, with or without 6125600Speter * modification, are permitted provided that the following conditions 7125600Speter * are met: 8125600Speter * 1. Redistributions of source code must retain the above copyright 9125600Speter * notice, this list of conditions and the following disclaimer. 10125600Speter * 2. Redistributions in binary form must reproduce the above copyright 11125600Speter * notice, this list of conditions and the following disclaimer in the 12125600Speter * documentation and/or other materials provided with the distribution. 13125600Speter * 14125600Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15125600Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16125600Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17125600Speter * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18125600Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19125600Speter * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20125600Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21125600Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22125600Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23125600Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24125600Speter * SUCH DAMAGE. 25125600Speter */ 26125600Speter 27114298Sobrien#include <machine/asm.h> 28114298Sobrien__FBSDID("$FreeBSD: head/lib/libc/amd64/gen/fabs.S 125600 2004-02-08 21:21:45Z peter $"); 29114298Sobrien 30114298Sobrien/* 31125600Speter * Return floating point absolute value of a double. 32114298Sobrien */ 33114298Sobrien 34125600Speter .text 35114298SobrienENTRY(fabs) 36125600Speter movsd %xmm0, %xmm1 37125600Speter movsd signbit(%rip), %xmm0 38125600Speter andnpd %xmm1, %xmm0 39114298Sobrien ret 40125600Speter 41125600Speter .data 42125600Spetersignbit: 43125600Speter .quad 0x8000000000000000 44