Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Nov 1999 01:18:34 +0100 (CET)
From:      Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Athlons..
Message-ID:  <199911040018.BAA06030@dorifer.heim3.tu-clausthal.de>

next in thread | raw e-mail | index | archive | help
Mark Ovens wrote in list.freebsd-questions:
 > On Tue, Nov 02, 1999 at 02:28:40AM +0100, Oliver Fromme wrote:
 > > Stephen Roome wrote in list.freebsd-questions:
 > >  > Does anyone know if the following example, taken from AMD's documentation,
 > >  > would improve bcopy performance on the Athlon? (over the routine that would be
 > >  > defaulted to ?)
 > > 
 > > This _might_ improve performance when copying very large
 > > regions.  However, the problem is, that movq (which is an
 > > MMX instruction) clobbers the FPU registers, which is a
 > > bad thing.
 > 
 > ISTR reading that this is an Intel-only problem and that AMD's
 > 3D-Now! instructions don't clobber the FPU registers. Can't remember
 > the reason though, dedicated registers?

Unfortunately, that is not true.  The 3DNow instructions use
exactly the same registers as the MMX instructions.  In fact,
you can use MMX and 3DNow computations at the same time.  For
example, you can use an MMX instruction to negate the result of
a 3DNow computation efficiently.

There are two things which make 3DNow CPUs somewhat more usable
than MMX-only CPUs:  First, 3DNow supports floating point
operations (MMX is integer only), so you usually don't have to
switch between standard FPU mode and 3DNow (or at least not
that often).  Second, AMD invented a new instruction called
"femms" which can be used to switch between FPU and 3DNow
instructions, much faster than the intel MMX CPUs can.

But, still, any such switch will clear FPU and 3DNow/MMX
registers, because theyre mapped to the same register space
internally.  Otherwise, it would not be possible to have
multiple programs working with MMX/3DNow in a multitasking
operating system in which the scheduler has no specific
support for saving and restoring MMX/3DNow registers.

Regards
   Oliver

PS:  I programmed both MMX and 3DNow stuff in assembler under
FreeBSD (e.g. an improved version of the Seti@home client), so
I think I know it pretty well.  ;-)

-- 
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)

"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
                                         (Terry Pratchett)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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