From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936525AbXGWVG7 (ORCPT ); Mon, 23 Jul 2007 17:06:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757602AbXGWVGs (ORCPT ); Mon, 23 Jul 2007 17:06:48 -0400 Received: from mail6.sea5.speakeasy.net ([69.17.117.8]:44001 "EHLO mail6.sea5.speakeasy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756208AbXGWVGr (ORCPT ); Mon, 23 Jul 2007 17:06:47 -0400 Date: Mon, 23 Jul 2007 14:06:45 -0700 (PDT) From: Trent Piepho X-X-Sender: xyzzy@shell2.speakeasy.net To: Jeremy Fitzhardinge cc: Satyam Sharma , Linux Kernel Mailing List , David Howells , Nick Piggin , Andi Kleen , Andrew Morton , Linus Torvalds Subject: Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__ __volatile__ In-Reply-To: <46A51254.8000508@goop.org> Message-ID: References: <20070723160528.22137.84144.sendpatchset@cselinux1.cse.iitk.ac.in> <20070723160603.22137.16516.sendpatchset@cselinux1.cse.iitk.ac.in> <46A4D612.9050209@goop.org> <46A4E7E3.8090105@goop.org> <46A51254.8000508@goop.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote: > Trent Piepho wrote: > > gcc also tries to count the number of instructions, to guess how large in > > bytes the asm block is, as it could make a difference for near vs short > > jumps, etc. > > > > How does it do that? By looking for \n, ';', etc? Yes: Some targets require that GCC track the size of each instruction used in order to generate correct code. Because the final length of an `asm' is only known by the assembler, GCC must make an estimate as to how big it will be. The estimate is formed by counting the number of statements in the pattern of the `asm' and multiplying that by the length of the longest instruction on that processor. Statements in the `asm' are identified by newline characters and whatever statement separator characters are supported by the assembler; on most processors this is the ``;'' character.