1/*	$OpenBSD: e_remainder.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */
2/*
3 * Written by J.T. Conklin <jtc@NetBSD.org>.
4 * Public domain.
5 */
6
7#include <machine/asm.h>
8
9#include "abi.h"
10
11ENTRY(remainder)
12	XMM_TWO_ARG_DOUBLE_PROLOGUE
13	fldl	ARG_DOUBLE_TWO
14	fldl	ARG_DOUBLE_ONE
151:	fprem1
16	fstsw	%ax
17	btw	$10,%ax
18	jc	1b
19	fstp	%st(1)
20	XMM_DOUBLE_EPILOGUE
21	ret
22END(remainder)
23
24	.section .note.GNU-stack,"",%progbits
25