* sysdeps/alpha/fpu/e_sqrt.c [!_IEEE_FP]: Correctly handle inputs near DBL_MIN.

1998-07-29  6:39  Kazushige Goto <goto@statabo.rim.or.jp>

	* sysdeps/alpha/fpu/e_sqrt.c [!_IEEE_FP]: Correctly handle
	inputs near DBL_MIN.
This commit is contained in:
Richard Henderson 1998-07-28 23:41:26 +00:00
parent 1bc21e7a70
commit f50e9c9df0
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,8 @@
1998-07-29 6:39 Kazushige Goto <goto@statabo.rim.or.jp>
* sysdeps/alpha/fpu/e_sqrt.c [!_IEEE_FP]: Correctly handle
inputs near DBL_MIN.
1998-07-28 Ulrich Drepper <drepper@cygnus.com> 1998-07-28 Ulrich Drepper <drepper@cygnus.com>
* resolv/nss_dns/dns-host.c (getanswer_r): Lower the priority of * resolv/nss_dns/dns-host.c (getanswer_r): Lower the priority of

View File

@ -212,19 +212,21 @@ __ieee754_sqrt:
sll $2, 32, $2 # e0 : sll $2, 32, $2 # e0 :
ldt $f14, $DN($4) # .. e1 : ldt $f14, $DN($4) # .. e1 :
stq $2, $Y($sp) # e0 : stq $2, $Y($sp) # e0 :
ldt $f13, $Y($sp) # e1 : nop # .. e1 : avoid pipe flash
nop # e0 :
ldt $f13, $Y($sp) # .. e1 :
mult $f11, $f13, $f10 # fm : $f10 = (x * 0.5) * y mult/su $f11, $f13, $f10 # fm : $f10 = (x * 0.5) * y
mult $f10, $f13, $f10 # fm : $f10 = ((x * 0.5) * y) * y mult $f10, $f13, $f10 # fm : $f10 = ((x * 0.5) * y) * y
subt $f15, $f10, $f1 # fa : $f1 = (1.5 - 0.5*x*y*y) subt $f15, $f10, $f1 # fa : $f1 = (1.5 - 0.5*x*y*y)
mult $f13, $f1, $f13 # fm : yp = y*(1.5 - 0.5*x*y*y) mult $f13, $f1, $f13 # fm : yp = y*(1.5 - 0.5*x*y*y)
mult $f11, $f13, $f11 # fm : $f11 = x * 0.5 * yp mult/su $f11, $f13, $f1 # fm : $f11 = x * 0.5 * yp
mult $f11, $f13, $f11 # fm : $f11 = (x * 0.5 * yp) * yp mult $f1, $f13, $f11 # fm : $f11 = (x * 0.5 * yp) * yp
subt $f18, $f11, $f1 # fa : $f1= (1.5-2^-30) - 0.5*x*yp*yp subt $f18, $f11, $f1 # fa : $f1= (1.5-2^-30) - 0.5*x*yp*yp
mult $f13, $f1, $f13 # fm : ypp = $f13 = yp*$f1 mult $f13, $f1, $f13 # fm : ypp = $f13 = yp*$f1
subt $f15, $f12, $f1 # fa : $f1 = (1.5 - 0.5) subt $f15, $f12, $f1 # fa : $f1 = (1.5 - 0.5)
ldt $f15, $UP($4) # .. e1 : ldt $f15, $UP($4) # .. e1 :
mult $f16, $f13, $f10 # fm : z = $f10 = x * ypp mult/su $f16, $f13, $f10 # fm : z = $f10 = x * ypp
mult $f10, $f13, $f11 # fm : $f11 = z*ypp mult $f10, $f13, $f11 # fm : $f11 = z*ypp
mult $f10, $f12, $f12 # fm : $f12 = z*0.5 mult $f10, $f12, $f12 # fm : $f12 = z*0.5
subt $f1, $f11, $f1 # .. fa : $f1 = 1 - z*ypp subt $f1, $f11, $f1 # .. fa : $f1 = 1 - z*ypp
@ -236,11 +238,11 @@ __ieee754_sqrt:
mult/c $f0, $f12, $f1 # fm : $f1 = zp * zmi mult/c $f0, $f12, $f1 # fm : $f1 = zp * zmi
mult/c $f0, $f11, $f15 # fm : $f15 = zp * zpl mult/c $f0, $f11, $f15 # fm : $f15 = zp * zpl
subt $f1, $f16, $f13 # fa : y1 = zp*zmi - x subt/su $f1, $f16, $f13 # fa : y1 = zp*zmi - x
subt $f15, $f16, $f15 # fa : y2 = zp*zpl - x subt/su $f15, $f16, $f14 # fa : y2 = zp*zpl - x
fcmovge $f13, $f12, $f0 # res = (y1 >= 0) ? zmi : res fcmovge $f13, $f12, $f0 # res = (y1 >= 0) ? zmi : res
fcmovlt $f15, $f11, $f0 # res = (y2 < 0) ? zpl : res fcmovlt $f14, $f11, $f0 # res = (y2 < 0) ? zpl : res
addq $sp, 16, $sp # e0 : addq $sp, 16, $sp # e0 :
ret # .. e1 : ret # .. e1 :