⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 katanf.s

📁 早期freebsd实现
💻 S
字号:
/*- * Copyright (c) 1985 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Computer Consoles Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *	@(#)Katanf.s	7.1 (Berkeley) 12/6/90 */#include "../tahoe/SYS.h"	.textENTRY(Katanf, 0)	tstl	4(fp)			# if (arg > 0)	jleq	1f	pushl	20(fp)			# hfs	pushl	8(fp)	pushl	4(fp)	callf	$16,satan	ret				# return(satan(arg));1:					# else	pushl	20(fp)			# hfs	lnd	4(fp)	pushd	callf	$16,satan	lnf	r0	stf	r0	ret				# return(-satan(-arg));ASENTRY(satan, R2|R3)	subl3	$60,fp,sp	cmpd2	4(fp),_sq2m1		# if (arg < sq2m1)	jgeq	1f	pushl	12(fp)			# hfs	pushl	8(fp)	pushl	4(fp)	callf	$16,xatan	ret				# return(xatan(arg));1:	cmpd2	4(fp),_sq2p1		# else if (arg > sq2p1)	jgtr	9f	pushl	12(fp)			# hfs	ldd	one; pushd	ldd	4(fp); pushd	callf	$24,_Kaddd		# (arg+1.0)	pushl	12(fp)			# hfs of _Kdivd	pushl	r1	pushl	r0	pushl	12(fp)			# hfs	ldd	one; pushd	ldd	4(fp); pushd	callf	$24,_Ksubd		# (arg-1.0)	pushl	r1	pushl	r0	callf	$24,_Kdivd		# (arg-1.0)/(arg+1.0)	pushl	12(fp)			# hfs	pushl	r1	pushl	r0	callf	$16,xatan		# xatan((ag-1.0)/(arg+1.0))	pushl	12(fp)			# hfs	pushl	r1	pushl	r0	ldd	_pio4; pushd	callf	$24,_Kaddd	ldd	r0; cvdf; stf r0	ret				# return(pio4+xatan((xatan(...)));9:	pushl	12(fp)		ldd	4(fp); pushd	ldd	one; pushd	callf	$24,_Kdivd		# (1.0/arg)	pushl	12(fp)			# hfs	ldd	r0; pushd	callf	$16,xatan					# clrl	-60+4(fp)					# movl	r0,-60(fp)	pushl	12(fp)			# hfs	ldd	r0; pushd	ldd	_pio2; pushd	callf	$24,_Ksubd	ldd	r0; cvdf; stf r0	retASENTRY(xatan, 0)	subl3	$68,fp,sp	pushl	12(fp)			# hfs	ldd	4(fp); pushd; pushd	callf	$24,_Kmuld		# argsq = arg*arg;	ldd	r0	std	-60(fp)			# argsq	pushl	12(fp)			# hfs	pushd				ldd	_p5; pushd	callf	$24,_Kmuld		# p5*argsq	pushl	12(fp)			# hfs	ldd	_p4; pushd				ldd	r0; pushd	callf	$24,_Kaddd		# (p5*argsq+p4)	pushl	12(fp)			# hfs	ldd	-60(fp); pushd	ldd	r0; pushd	callf	$24,_Kmuld		# (p5*argsq+p4)*argsq	pushl	12(fp)			# hfs	ldd	_p3; pushd				ldd	r0; pushd	callf	$24,_Kaddd		# ((p5*argsq+p4)*argsq+p3)	pushl	12(fp)			# hfs	ldd	-60(fp); pushd	ldd	r0; pushd	callf	$24,_Kmuld		# (..)*argsq	pushl	12(fp)			# hfs	ldd	_p2; pushd				ldd	r0; pushd	callf	$24,_Kaddd		# (..)*argsq+p2)	pushl	12(fp)			# hfs	ldd	-60(fp); pushd	ldd	r0; pushd	callf	$24,_Kmuld		# ((..)*argsq+p2)*argsq	pushl	12(fp)			# hfs	ldd	_p1; pushd				ldd	r0; pushd	callf	$24,_Kaddd		# ((..)*argsq+p2)*argsq+p1)	pushl	12(fp)			# hfs	ldd	-60(fp); pushd	ldd	r0; pushd	callf	$24,_Kmuld		# (..)*argsq	pushl	12(fp)			# hfs	ldd	_p0; pushd				ldd	r0; pushd	callf	$24,_Kaddd		# ((..)*argsq+p1)*argsq+p0)	pushl	12(fp)			# hfs	ldd	4(fp); pushd	ldd	r0; pushd	callf	$24,_Kmuld		# (..)*arg	ldd	r0	std	-68(fp); cvdf; stf r0	# value	ret	.data	.align	2_sq2p1:	.long	0x411A8279, 0x99FCEF31 # .double 2.414213562373095_sq2m1:	.long	0x3FD413CC, 0xCFE77990 # .double .41421356237309503_pio2:	.long	0x40C90FDA, 0xA22168C1 # .double 1.5707963267948966_pio4:	.long	0x40490FDA, 0xA22168C1 # .double .78539816339744829_p0:	.long	0x407FFFFF, 0xFD687A4B # .double .99999999939652999_p1:	.long	0xBFAAAAA2, 0x09F9DBF2 # .double -.3333330762079_p2:	.long	0x3F4CC820, 0x0670059B # .double .199982166665_p3:	.long	0xBF11D182, 0x6601878B # .double -.142400777317_p4:	.long	0x3ED88B47, 0x4EFC9AF9 # .double .10573440275_p5:	.long	0xBE772E4B, 0x0E689AEB # .double -.060346883one:	.long	0x40800000, 0x00000000 # .double 1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -