From owner-cvs-src@FreeBSD.ORG Sun Jun 29 09:47:45 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432E61065674; Sun, 29 Jun 2008 09:47:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id CFD118FC0A; Sun, 29 Jun 2008 09:47:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c220-239-252-11.carlnfd3.nsw.optusnet.com.au (c220-239-252-11.carlnfd3.nsw.optusnet.com.au [220.239.252.11]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m5T9lfPA007634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Jun 2008 19:47:42 +1000 Date: Sun, 29 Jun 2008 19:47:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Christoph Mallon In-Reply-To: <486731F4.9050400@gmx.de> Message-ID: <20080629174222.V93221@delplex.bde.org> References: <200806252105.m5PL5AUp064418@repoman.freebsd.org> <48654667.1040401@gmx.de> <20080628114028.M89039@delplex.bde.org> <4865F895.8030600@gmx.de> <20080629132901.Q92490@delplex.bde.org> <486731F4.9050400@gmx.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, Marius Strobl , src-committers@freebsd.org, cvs-all@freebsd.org, Bruce Evans Subject: Re: cvs commit: src/sys/sparc64/include in_cksum.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2008 09:47:45 -0000 On Sun, 29 Jun 2008, Christoph Mallon wrote: > Bruce Evans wrote: >>> I have to disagree. Where does the GCC documentation state, that "cc" has >>> no effect on x86? It is the other way round: The compiler assumes, the >> >> Well, in gcc-1.40, gcc.info says nothing about "cc", apparently because >> "cc" didn't exist in gcc-1.40. gcc-1.40 had to assume that cc was >> always clobbered. I think there are enough old i386 asm statements > > GCC 1.4? Would you please bury this corpse again? It smells. (; I don't remember using gcc.1.4, but many of the basic asm statements in FreeBSD and Linux have the same age as gcc-1.40. >> since gcc doesn't really understand cc in asms). (Linux-2.6.10/include/ >> asm-i386/*.h has 177 __asm__ statements (133 with volatile) with only >> 11 "cc"'s. Examples of ones without "cc"'s are everything in string.h, >> where things like scasb for strcmp() normally clobber "cc".) >> >> Newer versions of gcc.info have to say to use it in clobber lists, to >> support CPUs with a shorter history than i386 and to prepare for changing >> the assumptions on i386. > > Three fourth of the assembler statements needing volatile seems way to high > to me. Three fourths of asm statements would need cc clobbers with your rule, and only 1 hundredth of them currently have them :-(. I exaggerate slightly -- the ratios might be more like 2/4 and 1/10, depending on how common arithmetic operations are in asm statements (they aren't in most asm statements because C handles plain arithmetic operations well). BTW, what happens for floating point condition codes? Nothing is documented, so we have to guess that the cc clobber covers FP condition codes or that all condition codes are assumed to be clobbered by all asms. > I did not find the strcmp() implementation, which uses scasb. I only > found strcmp.S, which is not inline assembler and does not use scas either, > which would have suprised me (nor cmpsb, which would be more logical). Try linux-x.y.z/include/asm-i386/string.h. Some of this has been imported into FreeBSD, in i386-bitops.h in ext2fs. File systems don't benefit from this much micro-optimization (for i486's), but checksumming does. Bruce