1305382Sbde/*
2305382Sbde * Copyright (c) 1993,94 Winning Strategies, Inc.
3305382Sbde * All rights reserved.
4305382Sbde *
5305382Sbde * Redistribution and use in source and binary forms, with or without
6305382Sbde * modification, are permitted provided that the following conditions
7305382Sbde * are met:
8305382Sbde * 1. Redistributions of source code must retain the above copyright
9305382Sbde *    notice, this list of conditions and the following disclaimer.
10305382Sbde * 2. Redistributions in binary form must reproduce the above copyright
11305382Sbde *    notice, this list of conditions and the following disclaimer in the
12305382Sbde *    documentation and/or other materials provided with the distribution.
13305382Sbde * 3. All advertising materials mentioning features or use of this software
14305382Sbde *    must display the following acknowledgement:
15305382Sbde *      This product includes software developed by Winning Strategies, Inc.
16305382Sbde * 4. The name of the author may not be used to endorse or promote products
17305382Sbde *    derived from this software without specific prior written permission.
18305382Sbde *
19305382Sbde * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20305382Sbde * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21305382Sbde * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22305382Sbde * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23305382Sbde * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24305382Sbde * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25305382Sbde * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26305382Sbde * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27305382Sbde * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28305382Sbde * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29305382Sbde */
30305382Sbde
31305382Sbde/*
32305382Sbde * Based on the i387 version written by:
33305382Sbde *	J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
34305382Sbde */
35305382Sbde
36305382Sbde#include <machine/asm.h>
37305382Sbde__FBSDID("$FreeBSD: stable/11/lib/msun/amd64/e_fmod.S 324006 2017-09-26 09:01:56Z dim $")
38305382Sbde
39305382SbdeENTRY(fmod)
40305382Sbde	movsd	%xmm0,-8(%rsp)
41305382Sbde	movsd	%xmm1,-16(%rsp)
42305382Sbde	fldl	-16(%rsp)
43305382Sbde	fldl	-8(%rsp)
44305382Sbde1:	fprem
45305382Sbde	fstsw	%ax
46305382Sbde	testw	$0x400,%ax
47305382Sbde	jne	1b
48305382Sbde	fstpl	-8(%rsp)
49305382Sbde	movsd	-8(%rsp),%xmm0
50305382Sbde	fstp	%st
51305382Sbde	ret
52305382SbdeEND(fmod)
53305382Sbde
54305382Sbde	.section .note.GNU-stack,"",%progbits
55