Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 1996 10:47:09 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        asami@cs.berkeley.edu, bde@zeta.org.au
Cc:        culler@cs.berkeley.edu, current@freebsd.org, ken@area238.residence.gatech.edu, marc@bowtie.nl, nisha@cs.berkeley.edu, pattrsn@cs.berkeley.edu, wollman@lcs.mit.edu, wscott@ichips.intel.com
Subject:   Re: more on fast bcopy
Message-ID:  <199605080047.KAA14413@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
> * The commented out code in fpunrolled.s doesn't preserve CR0_TS.

>Really?  This is what I had:

>       movl %cr0,%edx
>       movl $8, %eax   /* CR0_TS */
>       not %eax
>       andl %eax,%edx  /* clear CR0_TS */
>       movl %edx,%cr0
>        :
>       andl $8,%edx
>       movl %cr0,%eax
>       orl %edx, %eax  /* reset CR0_TS to the original value */
>       movl %eax,%cr0

>The original value of %cr0 is saved in %edx, and the CR0_TS bit is
>extracted and then or'ed back into %cr0 at the end.

Actually, it isn't saved in %edx (or anywhere else).

>I did it this way because I didn't know if any of the other bits in
>%cr0 would change inside the loop.

That could be written (without using clts) as:

	movl	%cr0,%eax
	movl	%eax,%edx
	andl	$~8,%eax
	movl	%eax,%cr0
	...
	as above

>By the way, the problems we were seeing were random file corruptions,
>and I thought it was because FP regs aren't saved as part of the
>context switch (and although we are saving/restoring them upon entry
>and leaving our function, something else would come along and mess it
>up).  Will it explain this?

I can't explain the file corruptions.

Bruce



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