Date: Sat, 17 Jul 2010 19:11:36 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Cc: remko@FreeBSD.org, freebsd-i386@FreeBSD.org Subject: Re: i386/79091: [i386] [patch] Small optimization for i386/support.s Message-ID: <20100717185702.D3664@delplex.bde.org> In-Reply-To: <20100716141704.GA8965@pm513-1.comsys.ntu-kpi.kiev.ua> References: <201007140707.o6E773ff067326@freefall.freebsd.org> <20100716141704.GA8965@pm513-1.comsys.ntu-kpi.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 16 Jul 2010, Andrey Simonenko wrote: > On Wed, Jul 14, 2010 at 07:07:03AM +0000, remko@FreeBSD.org wrote: >> Synopsis: [i386] [patch] Small optimization for i386/support.s >> Hello, the code in question is using 'rcx' now instead of 'ecx'to restore >> the registers. That might have solved your problem can you please have a look at that please and confirm whether it's still relevant? > > That PR was about optimization for suword() and similar functions for > i386 and amd64 architectures. %ecx is used for i386 and %rcx is used > for amd64, but the idea is the same. I do not understand why these > lines are necessary for suword-like functions, all fuword-like functions > do not reinitialize %ecx and %rcx registers after MOV instruction that > potentially can generate some exception (eg. page fault). Yes, parts of the patch still apply, and they now apply to amd64 too. The I386C_CPU cases went away. fusufault on i386 still needs to reload %ecx since it is now called for faults from casuword* which does trash %ecx. Perhaps casuword* can use better register allocation to avoid trashing %ecx. Call-used registers are in short supply so this seems hard. casuword* on amd64 already has better register allocation and doesn't trash %ecx, but it has the same sillyness as the suword family -- it "restores" %ecx without even a wrong comment that it is restoring a trashed register (after not trashing the register). Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100717185702.D3664>