From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 9351 invoked from network); 26 Jun 1998 13:11:35 -0000 Received: from ns11.rim.or.jp (root@202.247.130.230) by mail2.redhat.com with SMTP; 26 Jun 1998 13:11:34 -0000 Received: from rayearth.rim.or.jp (rayearth.rim.or.jp [202.247.130.242]) by ns11.rim.or.jp (8.8.5/3.5Wpl2-ns11/RIMNET-2) with ESMTP id WAA22185 for ; Fri, 26 Jun 1998 22:11:31 +0900 (JST) Received: (from uucp@localhost) by rayearth.rim.or.jp (8.8.5/3.5Wpl2-uucp1/RIMNET) with UUCP id WAA02685 for axp-list@redhat.com; Fri, 26 Jun 1998 22:11:31 +0900 (JST) Received: from localhost (goto@news.statabo.rim.or.jp [133.9.131.1]) by statabo.rim.or.jp (8.6.12/3.4Wbeta3-uucp) with ESMTP id VAA00506; Fri, 26 Jun 1998 21:47:18 +0900 To: axp-list@redhat.com Subject: Re: On Alpha, SQRT slows down after RH5.1 upgrade In-Reply-To: Your message of "Thu, 25 Jun 1998 09:04:44 -0700" <19980625090444.B3320@dot.cygnus.com> References: <19980625090444.B3320@dot.cygnus.com> X-Mailer: Mew version 1.92.4 on Emacs 19.28 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19980626214717N.goto@statabo.rim.or.jp> Date: Fri, 26 Jun 1998 21:47:17 +0900 From: Kazushige Goto X-Dispatcher: imput version 971024 Hi, From: Richard Henderson Subject: Re: On Alpha, SQRT slows down after RH5.1 upgrade rth> > mult/su $f11, $f13, $f10 # fm : $f10 = (x * 0.5) * y rth> > mult $f10, $f13, $f10 # fm : $f10 = ((x * 0.5) * y) * y rth> > subt $f15, $f10, $f1 # fa : $f1 = (1.5 - 0.5*x*y*y) rth> > mult $f13, $f1, $f13 # fm : yp = y*(1.5 - 0.5*x*y*y) rth> > mult/su $f11, $f13, $f1 # fm : $f11 = x * 0.5 * yp rth> > mult $f1, $f13, $f11 # fm : $f11 = (x * 0.5 * yp) * yp rth> rth> You need to care for the trap shadow, don't you? Or do we rth> get away with this because the result is used the next insn? Usually, we must add "trapb" after floating point insn. But in this case, we do not have to, because of the dependency of $f10. Rather, it's more important how to use registers. According to original source, mult $f11, $f13, $f11 # fm : $f11 = x * 0.5 * yp mult $f11, $f13, $f11 # fm : $f11 = (x * 0.5 * yp) * yp This first "mult" occurs SIG_FPE. We can modify to mult/su $f11, $f13, $f11 # fm : $f11 = x * 0.5 * yp trapb mult $f11, $f13, $f11 # fm : $f11 = (x * 0.5 * yp) * yp But we can not correct value($f11), because when we get SIG_FPE, $f11 had alreadly been overwirtten with another value. So, the kernel can not set the correct value. I'm sorry that yesterday's patch is not enough to avoid SIG_FPE in the much smaller value(i.e. 2.3e-308). At first, I thouth we had to add "trapb" after "subt/su", but it seems unnecessary as long as I checked. Thanks, goto@statabo.rim.or.jp --- w_sqrt.S.old Fri Jun 26 21:34:47 1998 +++ w_sqrt.S Fri Jun 26 21:38:39 1998 @@ -125,7 +125,7 @@ mult $f13, $f1, $f13 # fm : ypp = $f13 = yp*$f1 subt $f15, $f12, $f1 # fa : $f1 = (1.5 - 0.5) ldt $f15, UP(t3) # .. 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, $f12, $f12 # fm : $f12 = z*0.5 subt $f1, $f11, $f1 # .. fa : $f1 = 1 - z*ypp @@ -137,11 +137,11 @@ mult/c $f0, $f12, $f1 # fm : $f1 = zp * zmi mult/c $f0, $f11, $f15 # fm : $f15 = zp * zpl - subt $f1, $f16, $f13 # fa : y1 = zp*zmi - x - subt $f15, $f16, $f15 # fa : y2 = zp*zpl - x + subt/su $f1, $f16, $f13 # fa : y1 = zp*zmi - x + subt/su $f15, $f16, $f14 # fa : y2 = zp*zpl - x 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 ret