s_tan.S revision 1.2
1/* $OpenBSD: s_tan.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ 2/* 3 * Written by J.T. Conklin <jtc@netbsd.org>. 4 * Public domain. 5 */ 6 7#include <machine/asm.h> 8 9ENTRY(tan) 10 fldl 4(%esp) 11 fptan 12 fnstsw %ax 13 andw $0x400,%ax 14 jnz 1f 15 fstp %st(0) 16 ret 171: fldpi 18 fadd %st(0) 19 fxch %st(1) 202: fprem1 21 fstsw %ax 22 andw $0x400,%ax 23 jnz 2b 24 fstp %st(1) 25 fptan 26 fstp %st(0) 27 ret 28