From owner-freebsd-hackers Tue May 28 08:35:29 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA07452 for hackers-outgoing; Tue, 28 May 1996 08:35:29 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA07445 for ; Tue, 28 May 1996 08:35:20 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id BAA24835; Wed, 29 May 1996 01:33:21 +1000 Date: Wed, 29 May 1996 01:33:21 +1000 From: Bruce Evans Message-Id: <199605281533.BAA24835@godzilla.zeta.org.au> To: ajones@ctron.com, hackers@freefall.freebsd.org Subject: Re: using floating point arithmetic inside a device driver Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I'm writing a device driver which needs to do some floating point >calculations, but when the floating point code executes the kernel traps >with number 22 "FPU device not available". I'm have an AMD 486DX4-120. >I'm not concerned with portability at this time (ie running on SX's). Floating point isn't supported in the kernel. Supporting it by switching the floating point state on every syscall, trap and interrupt would waste a lot of time (several hundred cycles per switch). "Lazy" switching (i.e., switching only when necessary) would waste less time (about 40 cycles per switch on a P133) (except when it is actually used it would waste more time) but would be more complicated. FreeBSD uses lazy switching but only for processes. Bruce