1994-02-16 22:21:10 +03:00
|
|
|
/*
|
1995-04-29 02:43:31 +04:00
|
|
|
* Written by J.T. Conklin <jtc@netbsd.org>.
|
|
|
|
* Public domain.
|
1994-02-16 22:21:10 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <machine/asm.h>
|
|
|
|
|
2001-06-19 04:26:29 +04:00
|
|
|
#include "abi.h"
|
|
|
|
|
|
|
|
RCSID("$NetBSD: s_cos.S,v 1.7 2001/06/19 00:26:30 fvdl Exp $")
|
1994-03-12 04:30:22 +03:00
|
|
|
|
1994-02-16 22:21:10 +03:00
|
|
|
ENTRY(cos)
|
2001-06-19 04:26:29 +04:00
|
|
|
XMM_ONE_ARG_DOUBLE_PROLOGUE
|
|
|
|
fldl ARG_DOUBLE_ONE
|
1994-02-16 22:21:10 +03:00
|
|
|
fcos
|
|
|
|
fnstsw %ax
|
|
|
|
andw $0x400,%ax
|
1994-02-18 20:38:59 +03:00
|
|
|
jnz 1f
|
2001-06-19 04:26:29 +04:00
|
|
|
XMM_DOUBLE_EPILOGUE
|
1999-07-02 19:37:33 +04:00
|
|
|
ret
|
1994-02-18 20:38:59 +03:00
|
|
|
1: fldpi
|
1994-02-16 22:21:10 +03:00
|
|
|
fadd %st(0)
|
|
|
|
fxch %st(1)
|
1994-02-18 20:38:59 +03:00
|
|
|
2: fprem1
|
1994-02-16 22:21:10 +03:00
|
|
|
fnstsw %ax
|
|
|
|
andw $0x400,%ax
|
1994-02-18 20:38:59 +03:00
|
|
|
jnz 2b
|
1994-02-16 22:21:10 +03:00
|
|
|
fstp %st(1)
|
|
|
|
fcos
|
2001-06-19 04:26:29 +04:00
|
|
|
XMM_DOUBLE_EPILOGUE
|
1994-02-18 20:38:59 +03:00
|
|
|
ret
|