Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!rutgers!ucsd!chiton!cdl From: cdl@chiton.ucsd.edu (Carl Lowenstein) Newsgroups: comp.sys.next Subject: Re: 68040 Math / Why so much system time? Keywords: 68040 math, system time Message-ID: <702@chiton.ucsd.edu> Date: 14 Feb 91 17:54:39 GMT References: <1991Feb14.160749.19048@batcomputer.tn.cornell.edu> Reply-To: cdl@chiton (Carl Lowenstein) Distribution: na Organization: MPL of SIO at UCSD Lines: 35 In article <1991Feb14.160749.19048@batcomputer.tn.cornell.edu> finn@batcomputer.tn.cornell.edu (Lee Samuel Finn) writes: >Ok, I've just finished upgrading to OS2.0 and the 68040 logic board. > I wrote a stupid program to exercise some trancendental >arithmetic and then timed the puppy: >4.8u 27.7s 0:38 84% 0+0k 3+0io 0pf+0w >Nearly 86% of the execution time of this program is system, and only >14% is user. If the call to sin() is changed to sqrt(), the statistics >are _very_ different: >9.0u 0.0s 0:09 99% 0+0k 1+0io 0pf+0w >Now, all the execution time is user time. >Why all the system time spent doing a sin()? 1) the 68030 processor does not have built-in floating point instructions therefore its floating point is handled by a 68882 FPU which has built-in transcendental functions which are pretty fast. 2) the 68040 processor has a built-in floating point instructions which do not include transcendental functions which must then be handled by kernel exception traps which are slow and take up system time. One hopes that eventually libm.a will be re-written to not call the built-in transcendentals of the 68882, computing transcendental functions using only the floating point instructions native to the 68040, and thus avoiding the exception traps. -- carl lowenstein marine physical lab u.c. san diego {decvax|ucbvax} !ucsd!mpl!cdl cdl@mpl.ucsd.edu clowenstein@ucsd.edu