From owner-freebsd-current Tue May 7 17:52:45 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA01100 for current-outgoing; Tue, 7 May 1996 17:52:45 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA01092 for ; Tue, 7 May 1996 17:52:39 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id KAA14413; Wed, 8 May 1996 10:47:09 +1000 Date: Wed, 8 May 1996 10:47:09 +1000 From: Bruce Evans Message-Id: <199605080047.KAA14413@godzilla.zeta.org.au> To: asami@cs.berkeley.edu, bde@zeta.org.au Subject: Re: more on fast bcopy 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 Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > * 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