Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Mar 2004 18:16:56 +1000
From:      Peter Grehan <grehan@freebsd.org>
To:        freebsd-threads@freebsd.org
Subject:   User-space context switch and floating-point
Message-ID:  <40459478.9060702@freebsd.org>

next in thread | raw e-mail | index | archive | help
Here's the comment I currently have in libpthread/.../powerpc/context.S:

  * XXX XXX
  *  Floating-point is a big issue. Since there's no way to determine
  * if the caller has used FP, all volatile register need to be saved.
  * If FP hasn't been used, this results in a lazy FP exception in
  * the kernel and from that point on FP is always switched in/out
  * for the thread, which may be a big performance drag for the system.
  *  An alternative is to use the the getcontext system call, which
  * will do the right thing for floating point but will save all
  * registers rather than the caller-saved subset, and has the overhead
  * of a syscall.
  *  Maybe another option would be to give a light-weight way for a
  * thread to determine if FP is in used: perhaps a syscall that
  * returns this info immediately in the asm traphandler, or an
  * OSX-style read-only per-thread page with a flag to indicate FP state.

  Any opinions ? I noticed the alpha/sparc64 routines don't save FP.

later,

Peter.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40459478.9060702>