David Malone wrote:
> On Tue, Aug 21, 2001 at 11:27:38AM -0500, Kevin Day wrote:
> > A quick peek at swtch.s seems to show that the SSE registers (XMM0-7) aren'
    t
> > being preserved across context switches. Am I missing somewhere that's doin
    g
> > this, or are they really not being saved now?
> 
> SSE support has recently been added to -current and -stable.

Yes, but the question was "how is it preserved"?  The SSE stuff works the
same as the FPU stuff in that it is switched lazily.  See npxsave() and
where it is called.  If a process "attaches" to the fpu, its state is kept
in the fpu the whole time.  It is not extracted at context switch time.
So, we can be running a different process while the fpu/xmm stuff is holding
the original process's context.  If the new process tries to use the SSE/fpu
stuff, a trap happens, we save the original process's context in the original
pcb and then give ownership to the new process.

And for SMP, we handle it differently again. :-/

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to