1176227Sbde/*
2176227Sbde * Copyright (c) 1993,94 Winning Strategies, Inc.
3176227Sbde * All rights reserved.
4176227Sbde *
5176227Sbde * Redistribution and use in source and binary forms, with or without
6176227Sbde * modification, are permitted provided that the following conditions
7176227Sbde * are met:
8176227Sbde * 1. Redistributions of source code must retain the above copyright
9176227Sbde *    notice, this list of conditions and the following disclaimer.
10176227Sbde * 2. Redistributions in binary form must reproduce the above copyright
11176227Sbde *    notice, this list of conditions and the following disclaimer in the
12176227Sbde *    documentation and/or other materials provided with the distribution.
13176227Sbde * 3. All advertising materials mentioning features or use of this software
14176227Sbde *    must display the following acknowledgement:
15176227Sbde *      This product includes software developed by Winning Strategies, Inc.
16176227Sbde * 4. The name of the author may not be used to endorse or promote products
17176227Sbde *    derived from this software without specific prior written permission.
18176227Sbde *
19176227Sbde * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20176227Sbde * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21176227Sbde * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22176227Sbde * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23176227Sbde * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24176227Sbde * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25176227Sbde * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26176227Sbde * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27176227Sbde * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28176227Sbde * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29176227Sbde */
30176227Sbde
31176227Sbde/*
32176227Sbde * Based on the i387 version written by:
33176227Sbde *	J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
34176227Sbde */
35176227Sbde
36176227Sbde#include <machine/asm.h>
37176227Sbde
38176227SbdeRCSID("from: FreeBSD: src/lib/msun/i387/e_remainder.S,v 1.8 2005/02/04 14:08:32 das Exp")
39176227Sbde__FBSDID("$FreeBSD$")
40176227Sbde
41176227SbdeENTRY(remainder)
42176227Sbde	movsd	%xmm0,-8(%rsp)
43176227Sbde	movsd	%xmm1,-16(%rsp)
44176227Sbde	fldl	-16(%rsp)
45176227Sbde	fldl	-8(%rsp)
46176227Sbde1:	fprem1
47176227Sbde	fstsw	%ax
48176227Sbde	testw	$0x400,%ax
49176227Sbde	jne	1b
50176227Sbde	fstpl	-8(%rsp)
51176227Sbde	movsd	-8(%rsp),%xmm0
52176227Sbde	fstp	%st
53176227Sbde	ret
54217108Skib
55217108Skib	.section .note.GNU-stack,"",%progbits
56