[Top] [All Lists]

Re: FPU emulator unsafe for SMP?

To: Jun Sun <>
Subject: Re: FPU emulator unsafe for SMP?
From: Dominic Sweetman <>
Date: Wed, 20 Feb 2002 08:27:19 +0000
Cc: "Kevin D. Kissell" <>,
In-reply-to: <>
References: <> <> <> <> <002b01c1b607$6afbd5c0$10eca8c0@grendel> <> <00af01c1b9a2$c0d6d5f0$10eca8c0@grendel> <>
User-agent: SEMI/1.13.7 (Awazu) CLIME/1.13.6 (中ノ庄) MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386-redhat-linux)
Somewhere in this thread:

> > > > > Hmm, I see. The lazy fpu context switch code is not SMP safe.
> > > > > I see fishy things like "last_task_used_math" etc...

Lazy FPU context switching?  Let's turn the whole thing off...

It may be heretical... but the lazy FPU context switch was invented
for 16MHz CPUs using a write-through cache and non-burst memory, where
saving 16 x 64-bit registers took 6us or so (and quite a bit less,
later, to read them back).  Call it 8us.

A 500MHz CPU with a writeback primary cache - which typically keeps up
with the CPU pipeline - takes about 120ns to do the job (there are
more registers these days).  The overhead is not only less than 2% in
absolute terms, but is about a third what it used to be relative to
the overall CPU performance...

Really, is it worth all this trouble?

Dominic Sweetman
Algorithmics Ltd
The Fruit Farm, Ely Road, Chittering, CAMBS CB5 9PH, ENGLAND
phone +44 1223 706200/fax +44 1223 706250/direct +44 1223 706205

<Prev in Thread] Current Thread [Next in Thread>