亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wm_sqrt.s

?? LINUX1.0源代碼,代碼條理清晰
?? S
字號:
	.file	"wm_sqrt.S"
/*---------------------------------------------------------------------------+
 |  wm_sqrt.S                                                                |
 |                                                                           |
 | Fixed point arithmetic square root evaluation.                            |
 |                                                                           |
 | Copyright (C) 1992,1993                                                   |
 |                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
 |                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au    |
 |                                                                           |
 | Call from C as:                                                           |
 |   void wm_sqrt(FPU_REG *n, unsigned int control_word)                     |
 |                                                                           |
 +---------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------+
 |  wm_sqrt(FPU_REG *n, unsigned int control_word)                           |
 |    returns the square root of n in n.                                     |
 |                                                                           |
 |  Use Newton's method to compute the square root of a number, which must   |
 |  be in the range  [1.0 .. 4.0),  to 64 bits accuracy.                     |
 |  Does not check the sign or tag of the argument.                          |
 |  Sets the exponent, but not the sign or tag of the result.                |
 |                                                                           |
 |  The guess is kept in %esi:%edi                                           |
 +---------------------------------------------------------------------------*/

#include "exception.h"
#include "fpu_asm.h"


#ifdef REENTRANT_FPU
/*	Local storage on the stack: */
#define FPU_accum_3	-4(%ebp)	/* ms word */
#define FPU_accum_2	-8(%ebp)
#define FPU_accum_1	-12(%ebp)
#define FPU_accum_0	-16(%ebp)

/*
 * The de-normalised argument:
 *                  sq_2                  sq_1              sq_0
 *        b b b b b b b ... b b b   b b b .... b b b   b 0 0 0 ... 0
 *           ^ binary point here
 */
#define FPU_fsqrt_arg_2	-20(%ebp)	/* ms word */
#define FPU_fsqrt_arg_1	-24(%ebp)
#define FPU_fsqrt_arg_0	-28(%ebp)	/* ls word, at most the ms bit is set */

#else
/*	Local storage in a static area: */
.data
	.align 4,0
FPU_accum_3:
	.long	0		/* ms word */
FPU_accum_2:
	.long	0
FPU_accum_1:
	.long	0
FPU_accum_0:
	.long	0

/* The de-normalised argument:
                    sq_2                  sq_1              sq_0
          b b b b b b b ... b b b   b b b .... b b b   b 0 0 0 ... 0
             ^ binary point here
 */
FPU_fsqrt_arg_2:
	.long	0		/* ms word */
FPU_fsqrt_arg_1:
	.long	0
FPU_fsqrt_arg_0:
	.long	0		/* ls word, at most the ms bit is set */
#endif REENTRANT_FPU


.text
	.align 2,144

.globl _wm_sqrt
_wm_sqrt:
	pushl	%ebp
	movl	%esp,%ebp
#ifdef REENTRANT_FPU
	subl	$28,%esp
#endif REENTRANT_FPU
	pushl	%esi
	pushl	%edi
	pushl	%ebx

	movl	PARAM1,%esi

	movl	SIGH(%esi),%eax
	movl	SIGL(%esi),%ecx
	xorl	%edx,%edx

/* We use a rough linear estimate for the first guess.. */

	cmpl	EXP_BIAS,EXP(%esi)
	jnz	sqrt_arg_ge_2

	shrl	$1,%eax			/* arg is in the range  [1.0 .. 2.0) */
	rcrl	$1,%ecx
	rcrl	$1,%edx

sqrt_arg_ge_2:
/* From here on, n is never accessed directly again until it is
   replaced by the answer. */

	movl	%eax,FPU_fsqrt_arg_2		/* ms word of n */
	movl	%ecx,FPU_fsqrt_arg_1
	movl	%edx,FPU_fsqrt_arg_0

/* Make a linear first estimate */
	shrl	$1,%eax
	addl	$0x40000000,%eax
	movl	$0xaaaaaaaa,%ecx
	mull	%ecx
	shll	%edx			/* max result was 7fff... */
	testl	$0x80000000,%edx	/* but min was 3fff... */
	jnz	sqrt_prelim_no_adjust

	movl	$0x80000000,%edx	/* round up */

sqrt_prelim_no_adjust:
	movl	%edx,%esi	/* Our first guess */

/* We have now computed (approx)   (2 + x) / 3, which forms the basis
   for a few iterations of Newton's method */

	movl	FPU_fsqrt_arg_2,%ecx	/* ms word */

/*
 * From our initial estimate, three iterations are enough to get us
 * to 30 bits or so. This will then allow two iterations at better
 * precision to complete the process.
 */

/* Compute  (g + n/g)/2  at each iteration (g is the guess). */
	shrl	%ecx		/* Doing this first will prevent a divide */
				/* overflow later. */

	movl	%ecx,%edx	/* msw of the arg / 2 */
	divl	%esi		/* current estimate */
	shrl	%esi		/* divide by 2 */
	addl	%eax,%esi	/* the new estimate */

	movl	%ecx,%edx
	divl	%esi
	shrl	%esi
	addl	%eax,%esi

	movl	%ecx,%edx
	divl	%esi
	shrl	%esi
	addl	%eax,%esi

/*
 * Now that an estimate accurate to about 30 bits has been obtained (in %esi),
 * we improve it to 60 bits or so.
 *
 * The strategy from now on is to compute new estimates from
 *      guess := guess + (n - guess^2) / (2 * guess)
 */

/* First, find the square of the guess */
	movl	%esi,%eax
	mull	%esi
/* guess^2 now in %edx:%eax */

	movl	FPU_fsqrt_arg_1,%ecx
	subl	%ecx,%eax
	movl	FPU_fsqrt_arg_2,%ecx	/* ms word of normalized n */
	sbbl	%ecx,%edx
	jnc	sqrt_stage_2_positive

/* Subtraction gives a negative result,
   negate the result before division. */
	notl	%edx
	notl	%eax
	addl	$1,%eax
	adcl	$0,%edx

	divl	%esi
	movl	%eax,%ecx

	movl	%edx,%eax
	divl	%esi
	jmp	sqrt_stage_2_finish

sqrt_stage_2_positive:
	divl	%esi
	movl	%eax,%ecx

	movl	%edx,%eax
	divl	%esi

	notl	%ecx
	notl	%eax
	addl	$1,%eax
	adcl	$0,%ecx

sqrt_stage_2_finish:
	sarl	$1,%ecx		/* divide by 2 */
	rcrl	$1,%eax

	/* Form the new estimate in %esi:%edi */
	movl	%eax,%edi
	addl	%ecx,%esi

	jnz	sqrt_stage_2_done	/* result should be [1..2) */

#ifdef PARANOID
/* It should be possible to get here only if the arg is ffff....ffff */
	cmp	$0xffffffff,FPU_fsqrt_arg_1
	jnz	sqrt_stage_2_error
#endif PARANOID

/* The best rounded result. */
	xorl	%eax,%eax
	decl	%eax
	movl	%eax,%edi
	movl	%eax,%esi
	movl	$0x7fffffff,%eax
	jmp	sqrt_round_result

#ifdef PARANOID
sqrt_stage_2_error:
	pushl	EX_INTERNAL|0x213
	call	EXCEPTION
#endif PARANOID

sqrt_stage_2_done:

/* Now the square root has been computed to better than 60 bits. */

/* Find the square of the guess. */
	movl	%edi,%eax		/* ls word of guess */
	mull	%edi
	movl	%edx,FPU_accum_1

	movl	%esi,%eax
	mull	%esi
	movl	%edx,FPU_accum_3
	movl	%eax,FPU_accum_2

	movl	%edi,%eax
	mull	%esi
	addl	%eax,FPU_accum_1
	adcl	%edx,FPU_accum_2
	adcl	$0,FPU_accum_3

/*	movl	%esi,%eax */
/*	mull	%edi */
	addl	%eax,FPU_accum_1
	adcl	%edx,FPU_accum_2
	adcl	$0,FPU_accum_3

/* guess^2 now in FPU_accum_3:FPU_accum_2:FPU_accum_1 */

	movl	FPU_fsqrt_arg_0,%eax		/* get normalized n */
	subl	%eax,FPU_accum_1
	movl	FPU_fsqrt_arg_1,%eax
	sbbl	%eax,FPU_accum_2
	movl	FPU_fsqrt_arg_2,%eax		/* ms word of normalized n */
	sbbl	%eax,FPU_accum_3
	jnc	sqrt_stage_3_positive

/* Subtraction gives a negative result,
   negate the result before division */
	notl	FPU_accum_1
	notl	FPU_accum_2
	notl	FPU_accum_3
	addl	$1,FPU_accum_1
	adcl	$0,FPU_accum_2

#ifdef PARANOID
	adcl	$0,FPU_accum_3	/* This must be zero */
	jz	sqrt_stage_3_no_error

sqrt_stage_3_error:
	pushl	EX_INTERNAL|0x207
	call	EXCEPTION

sqrt_stage_3_no_error:
#endif PARANOID

	movl	FPU_accum_2,%edx
	movl	FPU_accum_1,%eax
	divl	%esi
	movl	%eax,%ecx

	movl	%edx,%eax
	divl	%esi

	sarl	$1,%ecx		/* divide by 2 */
	rcrl	$1,%eax

	/* prepare to round the result */

	addl	%ecx,%edi
	adcl	$0,%esi

	jmp	sqrt_stage_3_finished

sqrt_stage_3_positive:
	movl	FPU_accum_2,%edx
	movl	FPU_accum_1,%eax
	divl	%esi
	movl	%eax,%ecx

	movl	%edx,%eax
	divl	%esi

	sarl	$1,%ecx		/* divide by 2 */
	rcrl	$1,%eax

	/* prepare to round the result */

	notl	%eax		/* Negate the correction term */
	notl	%ecx
	addl	$1,%eax
	adcl	$0,%ecx		/* carry here ==> correction == 0 */
	adcl	$0xffffffff,%esi

	addl	%ecx,%edi
	adcl	$0,%esi

sqrt_stage_3_finished:

/*
 * The result in %esi:%edi:%esi should be good to about 90 bits here,
 * and the rounding information here does not have sufficient accuracy
 * in a few rare cases.
 */
	cmpl	$0xffffffe0,%eax
	ja	sqrt_near_exact_x

	cmpl	$0x00000020,%eax
	jb	sqrt_near_exact

	cmpl	$0x7fffffe0,%eax
	jb	sqrt_round_result

	cmpl	$0x80000020,%eax
	jb	sqrt_get_more_precision

sqrt_round_result:
/* Set up for rounding operations */
	movl	%eax,%edx
	movl	%esi,%eax
	movl	%edi,%ebx
	movl	PARAM1,%edi
	movl	EXP_BIAS,EXP(%edi)	/* Result is in  [1.0 .. 2.0) */
	movl	PARAM2,%ecx
	jmp	fpu_reg_round_sqrt


sqrt_near_exact_x:
/* First, the estimate must be rounded up. */
	addl	$1,%edi
	adcl	$0,%esi

sqrt_near_exact:
/*
 * This is an easy case because x^1/2 is monotonic.
 * We need just find the square of our estimate, compare it
 * with the argument, and deduce whether our estimate is
 * above, below, or exact. We use the fact that the estimate
 * is known to be accurate to about 90 bits.
 */
	movl	%edi,%eax		/* ls word of guess */
	mull	%edi
	movl	%edx,%ebx		/* 2nd ls word of square */
	movl	%eax,%ecx		/* ls word of square */

	movl	%edi,%eax
	mull	%esi
	addl	%eax,%ebx
	addl	%eax,%ebx

#ifdef PARANOID
	cmp	$0xffffffb0,%ebx
	jb	sqrt_near_exact_ok

	cmp	$0x00000050,%ebx
	ja	sqrt_near_exact_ok

	pushl	EX_INTERNAL|0x214
	call	EXCEPTION

sqrt_near_exact_ok:
#endif PARANOID

	or	%ebx,%ebx
	js	sqrt_near_exact_small

	jnz	sqrt_near_exact_large

	or	%ebx,%edx
	jnz	sqrt_near_exact_large

/* Our estimate is exactly the right answer */
	xorl	%eax,%eax
	jmp	sqrt_round_result

sqrt_near_exact_small:
/* Our estimate is too small */
	movl	$0x000000ff,%eax
	jmp	sqrt_round_result
	
sqrt_near_exact_large:
/* Our estimate is too large, we need to decrement it */
	subl	$1,%edi
	sbbl	$0,%esi
	movl	$0xffffff00,%eax
	jmp	sqrt_round_result


sqrt_get_more_precision:
/* This case is almost the same as the above, except we start
   with an extra bit of precision in the estimate. */
	stc			/* The extra bit. */
	rcll	$1,%edi		/* Shift the estimate left one bit */
	rcll	$1,%esi

	movl	%edi,%eax		/* ls word of guess */
	mull	%edi
	movl	%edx,%ebx		/* 2nd ls word of square */
	movl	%eax,%ecx		/* ls word of square */

	movl	%edi,%eax
	mull	%esi
	addl	%eax,%ebx
	addl	%eax,%ebx

/* Put our estimate back to its original value */
	stc			/* The ms bit. */
	rcrl	$1,%esi		/* Shift the estimate left one bit */
	rcrl	$1,%edi

#ifdef PARANOID
	cmp	$0xffffff60,%ebx
	jb	sqrt_more_prec_ok

	cmp	$0x000000a0,%ebx
	ja	sqrt_more_prec_ok

	pushl	EX_INTERNAL|0x215
	call	EXCEPTION

sqrt_more_prec_ok:
#endif PARANOID

	or	%ebx,%ebx
	js	sqrt_more_prec_small

	jnz	sqrt_more_prec_large

	or	%ebx,%ecx
	jnz	sqrt_more_prec_large

/* Our estimate is exactly the right answer */
	movl	$0x80000000,%eax
	jmp	sqrt_round_result

sqrt_more_prec_small:
/* Our estimate is too small */
	movl	$0x800000ff,%eax
	jmp	sqrt_round_result
	
sqrt_more_prec_large:
/* Our estimate is too large */
	movl	$0x7fffff00,%eax
	jmp	sqrt_round_result

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91福利国产成人精品照片| 久久不见久久见中文字幕免费| 国产乱码精品一区二区三区av| 久久香蕉国产线看观看99| 国产.欧美.日韩| 一区二区三区在线观看欧美 | 91电影在线观看| 色综合久久六月婷婷中文字幕| 日本三级韩国三级欧美三级| 国产精品久久久久久亚洲毛片| 欧美人xxxx| bt7086福利一区国产| 午夜精品久久久久| 亚洲第四色夜色| 亚洲精品一区二区三区99| 91污在线观看| 国产精品一区二区男女羞羞无遮挡| 韩国v欧美v亚洲v日本v| 日韩黄色在线观看| 亚洲日本在线a| 国产欧美一区二区三区在线看蜜臀| 欧美精品久久久久久久多人混战| 91亚洲国产成人精品一区二区三 | 亚洲精品国产高清久久伦理二区| 久久综合久色欧美综合狠狠| 久久嫩草精品久久久久| 666欧美在线视频| 欧美亚州韩日在线看免费版国语版| 国内精品不卡在线| 97超碰欧美中文字幕| 国产在线国偷精品产拍免费yy | 欧美一二三区在线| 欧美体内she精视频| 欧美一级高清片| 中文字幕一区二区三区不卡在线| 国产亚洲成aⅴ人片在线观看| 欧美一二三在线| 国产精品人妖ts系列视频| 2020日本不卡一区二区视频| 国产精品成人一区二区艾草| 蜜桃视频在线观看一区二区| 日韩成人av影视| 成人黄色在线看| 成人爱爱电影网址| 欧美久久一区二区| 国产精品久久久久久久久免费丝袜 | 91福利区一区二区三区| 亚洲精品在线三区| 亚洲欧美偷拍三级| 亚洲天堂成人在线观看| 蜜桃在线一区二区三区| 色哟哟国产精品| 欧美成人综合网站| 2023国产精品自拍| 亚洲综合精品自拍| 天天av天天翘天天综合网| 国产一区不卡视频| 日韩一级片在线观看| 亚洲在线视频一区| 99re在线精品| 国产欧美一区二区三区在线看蜜臀| 午夜精品久久久久久久99水蜜桃 | 日韩精品电影在线观看| 99re6这里只有精品视频在线观看| 欧美大片一区二区三区| 精品欧美一区二区在线观看| 国产成人免费视频网站高清观看视频 | 宅男噜噜噜66一区二区66| 国产精品免费视频观看| 国产在线视视频有精品| 国产老肥熟一区二区三区| 欧美成人a∨高清免费观看| 成人永久免费视频| 国产网站一区二区三区| 色婷婷精品久久二区二区蜜臀av | 日韩一区二区三区电影| 国产成人综合网| 亚洲国产精品久久久男人的天堂| 91视频精品在这里| 免费亚洲电影在线| 欧美xfplay| 在线欧美日韩精品| 亚洲va在线va天堂| 国产日韩欧美精品一区| 91.麻豆视频| 97久久精品人人澡人人爽| 麻豆精品精品国产自在97香蕉| 亚洲欧美日韩一区二区三区在线观看| 91精品在线免费观看| 91免费国产在线| 国产麻豆91精品| 蜜臀av一级做a爰片久久| 一二三四区精品视频| 国产精品久久久久精k8| 久久亚洲欧美国产精品乐播| 欧美日韩国产另类一区| 99r精品视频| 国产精品一区二区无线| 免费xxxx性欧美18vr| 亚洲柠檬福利资源导航| 国产女人aaa级久久久级| 欧美成人一区二区三区| 欧美日韩一区二区三区在线看| 日本美女一区二区| 亚洲午夜久久久久中文字幕久| 久久久久国产精品麻豆ai换脸| 日韩欧美国产小视频| 欧美日韩不卡在线| 欧美色大人视频| 欧洲精品在线观看| 一本色道**综合亚洲精品蜜桃冫| 成人av综合在线| 成人av在线播放网站| 国产成人午夜99999| 国产精品羞羞答答xxdd| 激情小说欧美图片| 国产资源精品在线观看| 国产一区在线观看麻豆| 精品无码三级在线观看视频 | 国产三区在线成人av| 精品久久五月天| 精品国产一区二区三区不卡| 精品蜜桃在线看| 久久日一线二线三线suv| 精品福利一二区| 久久久久久免费毛片精品| 欧美国产日韩一二三区| 欧美日韩国产一级| 日韩午夜在线影院| 26uuu久久天堂性欧美| 国产丝袜美腿一区二区三区| 欧美精品一区二区三区久久久| 久久久久青草大香线综合精品| 国产亚洲精品aa午夜观看| 亚洲视频你懂的| 亚洲成人中文在线| 精品一区二区国语对白| 成人性生交大片免费看中文 | 国产精品一品视频| 不卡的电影网站| 欧美日韩免费一区二区三区视频| 欧美一区二区三区视频免费| 一本色道久久综合狠狠躁的推荐 | 精品国产污污免费网站入口| 国产亚洲一区二区三区在线观看 | 欧美曰成人黄网| 欧美一级专区免费大片| 国产日韩欧美电影| 亚洲国产精品一区二区www在线| 精品一区免费av| 99视频精品免费视频| 欧美精品一级二级| 国产欧美视频一区二区| 亚洲123区在线观看| 国产精品综合网| 欧美亚洲一区二区在线观看| 欧美精品一区二区三区四区 | 国产丝袜美腿一区二区三区| 亚洲午夜av在线| 国产成人免费av在线| 欧美视频自拍偷拍| 欧美国产一区二区| 秋霞影院一区二区| 成人av免费在线| 日韩欧美视频在线| 夜夜嗨av一区二区三区网页| 国产一区免费电影| 精品视频一区三区九区| 中文字幕+乱码+中文字幕一区| 日日夜夜精品视频天天综合网| 99久久综合精品| 久久亚洲欧美国产精品乐播| 三级成人在线视频| 欧美性视频一区二区三区| 国产视频一区二区在线| 另类成人小视频在线| 欧美日本在线播放| 亚洲欧美在线视频观看| 国产呦萝稀缺另类资源| 日韩一二三四区| 亚洲国产色一区| 一本一道综合狠狠老| 亚洲国产精品v| 精品一二三四区| 日韩欧美另类在线| 国产aⅴ精品一区二区三区色成熟| 在线亚洲+欧美+日本专区| 国产精品久久夜| 国产成人精品一区二区三区四区| 欧美一区二区在线视频| 五月天丁香久久| 欧美日韩一二三| 亚洲国产你懂的| 欧洲在线/亚洲| 亚洲综合丁香婷婷六月香| 99v久久综合狠狠综合久久| 国产精品久久久久久久久免费丝袜 | 国产亚洲成年网址在线观看| 久久99国产精品免费网站| 91精品国产综合久久香蕉的特点 |